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: */
019:
020: package org.apache.axis2.jaxws.description;
021:
022: import org.apache.axis2.description.AxisOperation;
023:
024: import javax.xml.namespace.QName;
025: import java.lang.reflect.Method;
026:
027: /**
028: * An OperationDescripton corresponds to a method on an SEI. That SEI could be explicit (i.e.
029: * WebService.endpointInterface=sei.class) or implicit (i.e. public methods on the service
030: * implementation are the contract and thus the implicit SEI). Note that while
031: * OperationDescriptions are created on both the client and service side, implicit SEIs will only
032: * occur on the service side.
033: * <p/>
034: * OperationDescriptons contain information that is only relevent for and SEI-based service, i.e.
035: * one that is invoked via specific methods. This class does not exist for Provider-based services
036: * (i.e. those that specify WebServiceProvider)
037: * <p/>
038: * <pre>
039: * <b>OperationDescription details</b>
040: * <p/>
041: * CORRESPONDS TO: A single operation on an SEI (on both Client and Server)
042: * <p/>
043: * AXIS2 DELEGATE: AxisOperation
044: * <p/>
045: * CHILDREN: 0..n ParameterDescription
046: * 0..n FaultDescription (Note: Not fully implemented)
047: * <p/>
048: * ANNOTATIONS:
049: * WebMethod [181]
050: * SOAPBinding [181]
051: * Oneway [181]
052: * WebResult [181]
053: * RequestWrapper [224]
054: * ResponseWrapper [224]
055: * <p/>
056: * WSDL ELEMENTS:
057: * operation
058: * <p/>
059: * </pre>
060: */
061: public interface OperationDescription {
062: /**
063: * Paramater set on AxisOperation which contains an ArrayList of SOAP header QNames
064: * corresponding to SEI parameters.
065: */
066: public static final String HEADER_PARAMETER_QNAMES = "org.apache.axis2.jaxws.description.OperationDescription.headerParameterQNames";
067:
068: public EndpointInterfaceDescription getEndpointInterfaceDescription();
069:
070: public FaultDescription[] getFaultDescriptions();
071:
072: public FaultDescription resolveFaultByExceptionName(
073: String exceptionClassName);
074:
075: public ParameterDescription getParameterDescription(
076: int parameterNumber);
077:
078: public ParameterDescription getParameterDescription(
079: String parameterName);
080:
081: public ParameterDescription[] getParameterDescriptions();
082:
083: // indicates whether or not an @XmlList annotation was found on the method
084: public boolean isListType();
085:
086: public abstract AxisOperation getAxisOperation();
087:
088: public String getJavaMethodName();
089:
090: public String getJavaDeclaringClassName();
091:
092: public String[] getJavaParameters();
093:
094: // TODO: Fix up the difference between getSEIMethod and getMethodFromServiceImpl when java reflection is removed.
095:
096: /**
097: * Client side and non-DBC service side only! Return the SEI method for which a
098: * service.getPort(Class SEIClass) created the EndpointDescriptionInterface and the associated
099: * OperationDescriptions. Returns null on the service implementation side.
100: *
101: * @return
102: */
103: public Method getSEIMethod();
104:
105: /**
106: * Service implementation side only! Given a service implementation class, find the method on
107: * that class that corresponds to this operation description. This is necessary because on the
108: * service impl side, the OperationDescriptions can be built using byte-scanning and without the
109: * class actually having been loaded.
110: *
111: * @param serviceImpl
112: * @return
113: */
114: public Method getMethodFromServiceImpl(Class serviceImpl);
115:
116: /**
117: * Answer if this operation corresponds to the JAX-WS Client-only async methods. These methods
118: * are of the form: javax.xml.ws.Response<T> method(...) java.util.concurrent.Future<?>
119: * method(..., javax.xml.ws.AsyncHandler<T>)
120: *
121: * @return
122: */
123: public boolean isJAXWSAsyncClientMethod();
124:
125: public QName getName();
126:
127: public String getOperationName();
128:
129: public String getAction();
130:
131: public boolean isOneWay();
132:
133: public boolean isExcluded();
134:
135: public boolean isOperationReturningResult();
136:
137: public String getResultName();
138:
139: public String getResultTargetNamespace();
140:
141: public String getResultPartName();
142:
143: public boolean isResultHeader();
144:
145: /**
146: * Return the Class of the return type. For JAX-WS async returns of type Response<T> or
147: * AsyncHandler<T>, the class associated with Response or AsyncHanler respectively is returned.
148: * To get the class associated with <T>
149: *
150: * @return Class
151: * @see getResultActualType()
152: */
153: public Class getResultType();
154:
155: /**
156: * Return the actual Class of the type. For a JAX-WS async return type of Response<T> or
157: * AsyncHandler<T>, the class associated with <T> is returned. For non-JAX-WS async returns,
158: * the class associated with the return type is returned. Note that for a Generic return type,
159: * such as List<Foo>, the class associated with List will be returned.
160: *
161: * @return actual Class
162: */
163: public Class getResultActualType();
164:
165: /**
166: * @return the class name of the wrapper class. NOTE: This method will return null if the
167: * request wrapper class is not known during the description layer processing. In such
168: * cases the implementation may use proprietary code to find the class. For example,
169: * JAXWS may look for a matching class in the sei package, in a special jaxws package or
170: * proceed without the class name
171: */
172: public String getRequestWrapperClassName();
173:
174: public String getRequestWrapperTargetNamespace();
175:
176: public String getRequestWrapperLocalName();
177:
178: /**
179: * @return the class name of the wrapper class. NOTE: This method will return null if the
180: * request wrapper class is not known during the description layer processing. In such
181: * cases the implementation may use proprietary code to find the class. For example,
182: * JAXWS may look for a matching class in the sei package, in a special jaxws package or
183: * proceed without the class name
184: */
185: public String getResponseWrapperClassName();
186:
187: public String getResponseWrapperTargetNamespace();
188:
189: public String getResponseWrapperLocalName();
190:
191: public String[] getParamNames();
192:
193: // TODO: These should return Enums defined on this interface, not from the Annotation
194: public javax.jws.soap.SOAPBinding.ParameterStyle getSoapBindingParameterStyle();
195:
196: public javax.jws.soap.SOAPBinding.Style getSoapBindingStyle();
197:
198: public javax.jws.soap.SOAPBinding.Use getSoapBindingUse();
199:
200: public OperationRuntimeDescription getOperationRuntimeDesc(
201: String name);
202:
203: public void setOperationRuntimeDesc(OperationRuntimeDescription ord);
204:
205: /**
206: * For JAX-WS client-side async operations, this will return the corresponding sync
207: * OperationDescription.
208: *
209: * Note that if this method is used within the metadata layer, it is possible that it will return
210: * null. That will happen if the metadata layer is constructed from annotations on the SEI
211: * (not WSDL). In that case, it is possible that the async methods on the SEI are processed
212: * before the sync method. In that case, there will be no sync method yet. If this method
213: * is called outside the metadata layer, then if the async methods exist, the sync method
214: * should also exist.
215: *
216: * @return OperationDescription corresponding to the sync operation, or null (see note above).
217: */
218: public OperationDescription getSyncOperation();
219:
220: /**
221: * Returns the namespace of binding input message for the operation
222: */
223: public String getBindingInputNamespace();
224:
225: /**
226: * Returns the namespace of binding output message for the operation
227: */
228: public String getBindingOutputNamespace();
229:
230: /**
231: * @return Attachment Description for the return type or null
232: */
233: public AttachmentDescription getResultAttachmentDescription();
234: }
|