01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with 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,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.axis2.jaxws.dispatchers;
20:
21: import org.apache.axis2.AxisFault;
22: import org.apache.axis2.context.MessageContext;
23: import org.apache.axis2.description.AxisOperation;
24: import org.apache.axis2.description.AxisService;
25: import org.apache.axis2.engine.AbstractDispatcher;
26: import org.apache.axis2.engine.SOAPActionBasedDispatcher;
27: import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
28: import org.apache.commons.logging.Log;
29: import org.apache.commons.logging.LogFactory;
30:
31: import javax.xml.namespace.QName;
32:
33: /**
34: * This dispatcher will look for a specific operation on the AxisService and return it
35: * if found. This dispatcher is used for Provider-based endpoints which do not have WSDL
36: * associated with them. Those types of endpoints will not have WSDL operations created for them
37: * since (a) there is no WSDL and (b) there is no SEI from which to build operations using
38: * annotations. For these types of endpoints, a generic operation will have been added to the
39: * service which will accept any incoming WSDL operation and pass the incoming message to the
40: * Provider endpoint.
41: */
42: public class GenericProviderDispatcher extends AbstractDispatcher {
43: private static final Log log = LogFactory
44: .getLog(GenericProviderDispatcher.class);
45:
46: /* (non-Javadoc)
47: * @see org.apache.axis2.engine.AbstractDispatcher#findOperation(org.apache.axis2.description.AxisService, org.apache.axis2.context.MessageContext)
48: */
49: @Override
50: public AxisOperation findOperation(AxisService service,
51: MessageContext messageContext) throws AxisFault {
52: AxisOperation theOperation = null;
53: if (log.isDebugEnabled()) {
54: log.debug("findOperation service = " + service
55: + "; messagectx: " + messageContext);
56: }
57:
58: // If there's an AxisService, then look for the specially named operation and return it
59: if (service != null) {
60: theOperation = service
61: .getOperation(new QName(
62: EndpointInterfaceDescription.JAXWS_NOWSDL_PROVIDER_OPERATION_NAME));
63: if (log.isDebugEnabled()) {
64: log
65: .debug("operation "
66: + EndpointInterfaceDescription.JAXWS_NOWSDL_PROVIDER_OPERATION_NAME
67: + " is " + theOperation);
68: }
69: }
70:
71: return theOperation;
72: }
73:
74: /* (non-Javadoc)
75: * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
76: */
77: @Override
78: public AxisService findService(MessageContext messageContext)
79: throws AxisFault {
80: // This dispatcher will not try to resolve and AxisService if one hasn't been
81: // resolved already
82: return null;
83: }
84:
85: /* (non-Javadoc)
86: * @see org.apache.axis2.engine.AbstractDispatcher#initDispatcher()
87: */
88: @Override
89: public void initDispatcher() {
90: // No initialization necessary
91: }
92:
93: }
|