001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.ws.rm;
019:
020: import java.util.Collection;
021: import java.util.Collections;
022: import java.util.List;
023: import java.util.Map;
024: import java.util.Set;
025: import java.util.concurrent.Executor;
026:
027: import javax.xml.namespace.QName;
028:
029: import org.apache.cxf.databinding.DataBinding;
030: import org.apache.cxf.endpoint.Endpoint;
031: import org.apache.cxf.interceptor.Interceptor;
032: import org.apache.cxf.service.Service;
033: import org.apache.cxf.service.invoker.Invoker;
034: import org.apache.cxf.service.model.EndpointInfo;
035: import org.apache.cxf.service.model.ServiceInfo;
036:
037: /**
038: *
039: */
040: public class WrappedService implements Service {
041:
042: private Service wrappedService;
043: private DataBinding dataBinding;
044: private QName name;
045: private List<ServiceInfo> serviceInfos;
046: private Map<QName, Endpoint> endpoints;
047: private Invoker invoker;
048:
049: WrappedService(Service wrapped, QName n, ServiceInfo info) {
050: wrappedService = wrapped;
051: name = n;
052: serviceInfos = Collections.singletonList(info);
053: }
054:
055: public Service getWrappedService() {
056: return wrappedService;
057: }
058:
059: public DataBinding getDataBinding() {
060: return dataBinding;
061: }
062:
063: public QName getName() {
064: return name;
065: }
066:
067: public List<ServiceInfo> getServiceInfos() {
068: return serviceInfos;
069: }
070:
071: public ServiceInfo getServiceInfo() {
072: return serviceInfos.get(0);
073: }
074:
075: public void setDataBinding(DataBinding arg0) {
076: dataBinding = arg0;
077: }
078:
079: public Map<QName, Endpoint> getEndpoints() {
080: return endpoints;
081: }
082:
083: public Invoker getInvoker() {
084: return invoker;
085: }
086:
087: public void setInvoker(Invoker arg0) {
088: invoker = arg0;
089: }
090:
091: // remaining APIs all wrapped
092:
093: public Executor getExecutor() {
094: return wrappedService.getExecutor();
095: }
096:
097: public void setExecutor(Executor arg0) {
098: wrappedService.setExecutor(arg0);
099: }
100:
101: public List<Interceptor> getInFaultInterceptors() {
102: return wrappedService.getInFaultInterceptors();
103: }
104:
105: public List<Interceptor> getInInterceptors() {
106: return wrappedService.getInInterceptors();
107: }
108:
109: public List<Interceptor> getOutFaultInterceptors() {
110: return wrappedService.getOutFaultInterceptors();
111: }
112:
113: public List<Interceptor> getOutInterceptors() {
114: return wrappedService.getOutInterceptors();
115: }
116:
117: public void clear() {
118: wrappedService.clear();
119: }
120:
121: public boolean containsKey(Object key) {
122: return wrappedService.containsKey(key);
123: }
124:
125: public boolean containsValue(Object value) {
126: return wrappedService.containsValue(value);
127: }
128:
129: public Set<java.util.Map.Entry<String, Object>> entrySet() {
130: return wrappedService.entrySet();
131: }
132:
133: public Object get(Object key) {
134: return wrappedService.get(key);
135: }
136:
137: public boolean isEmpty() {
138: return wrappedService.isEmpty();
139: }
140:
141: public Set<String> keySet() {
142: return wrappedService.keySet();
143: }
144:
145: public Object put(String key, Object value) {
146: return wrappedService.put(key, value);
147: }
148:
149: public void putAll(Map<? extends String, ? extends Object> t) {
150: wrappedService.putAll(t);
151: }
152:
153: public Object remove(Object key) {
154: return wrappedService.remove(key);
155: }
156:
157: public int size() {
158: return wrappedService.size();
159: }
160:
161: public Collection<Object> values() {
162: return wrappedService.values();
163: }
164:
165: void setEndpoint(Endpoint e) {
166: endpoints = Collections.singletonMap(e.getEndpointInfo()
167: .getName(), e);
168: }
169:
170: public EndpointInfo getEndpointInfo(QName endpoint) {
171: return serviceInfos.get(0).getEndpoint(endpoint);
172: }
173:
174: }
|