|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
JaxRpcRuntime.java | - | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
* Copyright 2001-2004 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 |
|
|
17 |
package org.apache.geronimo.ews.ws4j2ee.wsutils;
|
|
18 |
|
|
19 |
import org.apache.axis.MessageContext;
|
|
20 |
|
|
21 |
import javax.naming.InitialContext;
|
|
22 |
import javax.naming.NamingException;
|
|
23 |
import javax.rmi.PortableRemoteObject;
|
|
24 |
|
|
25 |
/**
|
|
26 |
* <p>This class provide acsess to the JAX-RPC runtime dynamic information
|
|
27 |
* to the WS4J2ee runtime.</p>
|
|
28 |
*
|
|
29 |
* @author Srinath Perera(hemapani@opensource.lk)
|
|
30 |
*/
|
|
31 |
public class JaxRpcRuntime { |
|
32 |
private static MessageContext MSG_CONTEXT = null; |
|
33 |
|
|
34 | 0 |
public static void setMessageContext(MessageContext msgcontext) { |
35 | 0 |
MSG_CONTEXT = msgcontext; |
36 |
} |
|
37 |
|
|
38 | 0 |
public static MessageContext getMessageContext(MessageContext msgcontext) { |
39 | 0 |
return MSG_CONTEXT;
|
40 |
} |
|
41 |
|
|
42 | 0 |
public static Object getRemoteHome(String jndiname, Class homeclass) throws J2EEFault { |
43 | 0 |
try {
|
44 | 0 |
InitialContext context = new InitialContext();
|
45 | 0 |
Object objref = context.lookup(jndiname); |
46 | 0 |
return PortableRemoteObject.narrow(objref, homeclass);
|
47 |
} catch (ClassCastException e) {
|
|
48 | 0 |
e.printStackTrace(); |
49 | 0 |
throw new J2EEFault(e); |
50 |
} catch (NamingException e) {
|
|
51 | 0 |
e.printStackTrace(); |
52 | 0 |
throw new J2EEFault(e); |
53 |
} |
|
54 |
} |
|
55 |
} |
|
56 |
|
|