KickJava   Java API By Example, From Geeks To Geeks.

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


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.addressing.EndpointReference;
19 import org.apache.axis2.context.ConfigurationContext;
20 import org.apache.axis2.context.MessageContext;
21 import org.apache.axis2.description.HandlerDescription;
22 import org.apache.axis2.handlers.AbstractHandler;
23
24 import javax.xml.namespace.QName JavaDoc;
25
26 /**
27  * Class Dispatcher
28  */

29 public class DispatchPostConditionsEvaluator extends AbstractHandler implements Handler {
30     /**
31      * Field NAME
32      */

33     public static final QName JavaDoc NAME =
34         new QName JavaDoc("http://axis.ws.apache.org", "DispatchPostConditionsEvaluator");
35
36     /**
37      * Constructor Dispatcher
38      */

39     private ConfigurationContext engineContext;
40
41     public DispatchPostConditionsEvaluator() {
42         init(new HandlerDescription(NAME));
43     }
44
45     /**
46      * Method invoke
47      *
48      * @param msgctx
49      * @throws AxisFault
50      */

51     public final void invoke(MessageContext msgctx) throws AxisFault {
52         EndpointReference toEPR = msgctx.getTo();
53         if (msgctx.getServiceContext() == null) {
54             throw new AxisFault("Service Not found EPR is " + ((toEPR!= null)?toEPR.getAddress():""));
55         }
56
57         if (msgctx.getServiceContext() != null && msgctx.getOperationContext() == null) {
58             throw new AxisFault("Operation Not found EPR is " + ((toEPR!= null)?toEPR.getAddress():"") + " and WSA Action = "+ msgctx.getWSAAction());
59         }
60
61     }
62
63 }
64
Popular Tags