01: /**
02: *
03: * Licensed to the Apache Software Foundation (ASF) under one or more
04: * contributor license agreements. See the NOTICE file distributed with
05: * this work for additional information regarding copyright ownership.
06: * The ASF licenses this file to You under the Apache License, Version 2.0
07: * (the "License"); you may not use this file except in compliance with
08: * the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */package org.apache.openejb.core.webservices;
18:
19: import javax.xml.namespace.QName;
20: import javax.xml.ws.Service;
21: import java.net.URL;
22: import java.util.ArrayList;
23: import java.util.List;
24: import java.util.WeakHashMap;
25:
26: public class ServiceRefData {
27: private static final WeakHashMap<Object, ServiceRefData> registry = new WeakHashMap<Object, ServiceRefData>();
28:
29: public static ServiceRefData getServiceRefData(Object key) {
30: return registry.get(key);
31: }
32:
33: public static ServiceRefData putServiceRefData(Object key,
34: ServiceRefData value) {
35: return registry.put(key, value);
36: }
37:
38: private final String id;
39: private final QName serviceQName;
40: private final Class<? extends Service> serviceClass;
41: private final QName portQName;
42: private final Class<?> referenceClass;
43: private final URL wsdlURL;
44: private final List<HandlerChainData> handlerChains = new ArrayList<HandlerChainData>();
45: private final List<PortRefData> portRefs = new ArrayList<PortRefData>();
46:
47: public ServiceRefData(String id, QName serviceQName,
48: Class<? extends Service> serviceClass, QName portQName,
49: Class<?> referenceClass, URL wsdlURL,
50: List<HandlerChainData> handlerChains,
51: List<PortRefData> portRefs) {
52: this .id = id;
53: this .serviceQName = serviceQName;
54: this .serviceClass = serviceClass;
55: this .portQName = portQName;
56: this .referenceClass = referenceClass;
57: this .wsdlURL = wsdlURL;
58: if (handlerChains != null) {
59: this .handlerChains.addAll(handlerChains);
60: }
61: if (portRefs != null) {
62: this .portRefs.addAll(portRefs);
63: }
64: }
65:
66: public String getId() {
67: return id;
68: }
69:
70: public QName getServiceQName() {
71: return serviceQName;
72: }
73:
74: public Class<? extends Service> getServiceClass() {
75: return serviceClass;
76: }
77:
78: public QName getPortQName() {
79: return portQName;
80: }
81:
82: public Class<?> getReferenceClass() {
83: return referenceClass;
84: }
85:
86: public URL getWsdlURL() {
87: return wsdlURL;
88: }
89:
90: public List<HandlerChainData> getHandlerChains() {
91: return handlerChains;
92: }
93:
94: public List<PortRefData> getPortRefs() {
95: return portRefs;
96: }
97: }
|