KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > context > OperationContextFactory


1 /*
2  * Copyright 2004,2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * 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, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  *
16  * Runtime state of the engine
17  */

18 package org.apache.axis2.context;
19
20 import org.apache.axis2.description.OperationDescription;
21 import org.apache.axis2.engine.AxisFault;
22 import org.apache.wsdl.WSDLConstants;
23
24 public class OperationContextFactory implements WSDLConstants {
25
26     public static OperationContext createMEPContext(int mepURI,
27                                                     OperationDescription axisOp, ServiceContext serviceContext)
28             throws AxisFault {
29         if (MEP_CONSTANT_IN_OUT == mepURI || MEP_CONSTANT_IN_ONLY == mepURI
30                 || MEP_CONSTANT_IN_OPTIONAL_OUT == mepURI
31                 || MEP_CONSTANT_ROBUST_IN_ONLY == mepURI
32                 || MEP_CONSTANT_OUT_ONLY == mepURI
33                 || MEP_CONSTANT_OUT_IN == mepURI
34                 || MEP_CONSTANT_OUT_OPTIONAL_IN == mepURI
35                 || MEP_CONSTANT_ROBUST_OUT_ONLY == mepURI) {
36             return new OperationContext(axisOp, serviceContext);
37
38         } else {
39             throw new AxisFault("Cannot handle the MEP " + mepURI
40                     + " for the current invocation of Operation ");
41         }
42     }
43
44 }
45
Popular Tags