KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > engine > SOAPActionBasedDispatcher


1 /*
2 * Copyright 2004,2005 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */

16 package org.apache.axis2.engine;
17
18 import org.apache.axis2.context.MessageContext;
19 import org.apache.axis2.description.HandlerDescription;
20 import org.apache.axis2.description.OperationDescription;
21 import org.apache.axis2.description.ServiceDescription;
22
23 import javax.xml.namespace.QName JavaDoc;
24
25 /**
26  * Class Dispatcher
27  */

28 public class SOAPActionBasedDispatcher extends AbstractDispatcher {
29     /**
30      * Field NAME
31      */

32     public static final QName JavaDoc NAME =
33         new QName JavaDoc("http://axis.ws.apache.org", "SOAPActionBasedDispatcher");
34
35     public SOAPActionBasedDispatcher() {
36         init(new HandlerDescription(NAME));
37     }
38
39     public OperationDescription findOperation(
40         ServiceDescription service,
41         MessageContext messageContext)
42         throws AxisFault {
43
44         String JavaDoc action = (String JavaDoc) messageContext.getSoapAction();
45         if (action != null) {
46             OperationDescription op = service.getOperationBySOAPAction(action);
47             if(op == null){
48                 op = service.getOperation(new QName JavaDoc(action));
49             }
50             return op;
51         }
52         return null;
53     }
54
55     /* (non-Javadoc)
56      * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext)
57      */

58     public ServiceDescription findService(MessageContext messageContext) throws AxisFault {
59         return null;
60     }
61
62 }
63
Popular Tags