001: /**
002: *
003: * Licensed to the Apache Software Foundation (ASF) under one or more
004: * contributor license agreements. See the NOTICE file distributed with
005: * this work for additional information regarding copyright ownership.
006: * The ASF licenses this file to You under the Apache License, Version 2.0
007: * (the "License"); you may not use this file except in compliance with
008: * 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, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */package org.apache.openejb.jee;
018:
019: import javax.xml.bind.annotation.XmlAccessType;
020: import javax.xml.bind.annotation.XmlAccessorType;
021: import javax.xml.bind.annotation.XmlAttribute;
022: import javax.xml.bind.annotation.XmlElement;
023: import javax.xml.bind.annotation.XmlID;
024: import javax.xml.bind.annotation.XmlType;
025: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
026: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
027: import javax.xml.namespace.QName;
028: import java.util.ArrayList;
029: import java.util.List;
030:
031: /**
032: * The service-ref element declares a reference to a Web
033: * service. It contains optional description, display name and
034: * icons, a declaration of the required Service interface,
035: * an optional WSDL document location, an optional set
036: * of JAX-RPC mappings, an optional QName for the service element,
037: * an optional set of Service Endpoint Interfaces to be resolved
038: * by the container to a WSDL port, and an optional set of handlers.
039: */
040: @XmlAccessorType(XmlAccessType.FIELD)
041: @XmlType(name="service-refType",propOrder={"description","displayName","icon","serviceRefName","serviceInterface","serviceRefType","wsdlFile","jaxrpcMappingFile","serviceQname","portComponentRef","handler","handlerChains","mappedName","injectionTarget"})
042: public class ServiceRef implements JndiReference {
043:
044: @XmlElement(required=true)
045: protected List<Text> description;
046: @XmlElement(name="display-name",required=true)
047: protected List<Text> displayName;
048: @XmlElement(required=true)
049: protected List<Icon> icon;
050: @XmlElement(name="service-ref-name",required=true)
051: protected String serviceRefName;
052: @XmlElement(name="service-interface",required=true)
053: protected String serviceInterface;
054: @XmlElement(name="service-ref-type")
055: protected String serviceRefType;
056: @XmlElement(name="wsdl-file")
057: protected String wsdlFile;
058: @XmlElement(name="jaxrpc-mapping-file")
059: protected String jaxrpcMappingFile;
060: @XmlElement(name="service-qname")
061: protected QName serviceQname;
062: @XmlElement(name="port-component-ref",required=true)
063: protected List<PortComponentRef> portComponentRef;
064: @XmlElement(required=true)
065: protected List<Handler> handler;
066: @XmlElement(name="handler-chains")
067: protected HandlerChains handlerChains;
068: @XmlElement(name="mapped-name")
069: protected String mappedName;
070: @XmlElement(name="injection-target",required=true)
071: protected List<InjectionTarget> injectionTarget;
072: @XmlAttribute
073: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
074: @XmlID
075: protected String id;
076:
077: public String getName() {
078: return getServiceRefName();
079: }
080:
081: public String getKey() {
082: return getName();
083: }
084:
085: public String getType() {
086: return getServiceRefType();
087: }
088:
089: public void setName(String name) {
090: setServiceRefName(name);
091: }
092:
093: public void setType(String type) {
094: }
095:
096: public List<Text> getDescription() {
097: if (description == null) {
098: description = new ArrayList<Text>();
099: }
100: return this .description;
101: }
102:
103: public List<Text> getDisplayName() {
104: if (displayName == null) {
105: displayName = new ArrayList<Text>();
106: }
107: return this .displayName;
108: }
109:
110: public List<Icon> getIcon() {
111: if (icon == null) {
112: icon = new ArrayList<Icon>();
113: }
114: return this .icon;
115: }
116:
117: public String getServiceRefName() {
118: return serviceRefName;
119: }
120:
121: public void setServiceRefName(String value) {
122: this .serviceRefName = value;
123: }
124:
125: public String getServiceInterface() {
126: return serviceInterface;
127: }
128:
129: public void setServiceInterface(String value) {
130: this .serviceInterface = value;
131: }
132:
133: public String getServiceRefType() {
134: return serviceRefType;
135: }
136:
137: public void setServiceRefType(String value) {
138: this .serviceRefType = value;
139: }
140:
141: public String getWsdlFile() {
142: return wsdlFile;
143: }
144:
145: public void setWsdlFile(String value) {
146: this .wsdlFile = value;
147: }
148:
149: public String getJaxrpcMappingFile() {
150: return jaxrpcMappingFile;
151: }
152:
153: public void setJaxrpcMappingFile(String value) {
154: this .jaxrpcMappingFile = value;
155: }
156:
157: /**
158: * Gets the value of the serviceQname property.
159: */
160: public QName getServiceQname() {
161: return serviceQname;
162: }
163:
164: /**
165: * Sets the value of the serviceQname property.
166: */
167: public void setServiceQname(QName value) {
168: this .serviceQname = value;
169: }
170:
171: public List<PortComponentRef> getPortComponentRef() {
172: if (portComponentRef == null) {
173: portComponentRef = new ArrayList<PortComponentRef>();
174: }
175: return this .portComponentRef;
176: }
177:
178: public HandlerChains getHandlerChains() {
179: return handlerChains;
180: }
181:
182: public void setHandlerChains(HandlerChains value) {
183: this .handlerChains = value;
184: }
185:
186: public List<Handler> getHandler() {
187: if (handler == null) {
188: handler = new ArrayList<Handler>();
189: }
190: return this .handler;
191: }
192:
193: public HandlerChains getAllHandlers() {
194: // convert the handlers to handler chain
195: if (handlerChains == null && handler != null) {
196: HandlerChains handlerChains = new HandlerChains();
197: HandlerChain handlerChain = new HandlerChain();
198: handlerChain.getHandler().addAll(handler);
199: handlerChains.getHandlerChain().add(handlerChain);
200: return handlerChains;
201: } else {
202: return handlerChains;
203: }
204: }
205:
206: public String getMappedName() {
207: return mappedName;
208: }
209:
210: public void setMappedName(String value) {
211: this .mappedName = value;
212: }
213:
214: public List<InjectionTarget> getInjectionTarget() {
215: if (injectionTarget == null) {
216: injectionTarget = new ArrayList<InjectionTarget>();
217: }
218: return this .injectionTarget;
219: }
220:
221: public String getId() {
222: return id;
223: }
224:
225: public void setId(String value) {
226: this.id = value;
227: }
228:
229: }
|