01: /*
02: * Generated file - Do not edit!
03: */
04: package org.jboss.test.cmp2.fkstackoverflow.ejb;
05:
06: /**
07: * Utility class for Facade.
08: */
09: public class FacadeUtil {
10: private static FacadeHome cachedRemoteHome = null;
11:
12: // Home interface lookup methods
13:
14: /**
15: * Obtain remote home interface from default initial context
16: * @return Home interface for Facade. Lookup using JNDI_NAME
17: */
18: public static FacadeHome getHome()
19: throws javax.naming.NamingException {
20: if (cachedRemoteHome == null) {
21: // Obtain initial context
22: javax.naming.InitialContext initialContext = new javax.naming.InitialContext();
23: try {
24: Object objRef = initialContext
25: .lookup(FacadeHome.JNDI_NAME);
26: cachedRemoteHome = (FacadeHome) javax.rmi.PortableRemoteObject
27: .narrow(objRef, FacadeHome.class);
28: } finally {
29: initialContext.close();
30: }
31: }
32: return cachedRemoteHome;
33: }
34:
35: /**
36: * Obtain remote home interface from parameterised initial context
37: * @param environment Parameters to use for creating initial context
38: * @return Home interface for Facade. Lookup using JNDI_NAME
39: */
40: public static FacadeHome getHome(java.util.Hashtable environment)
41: throws javax.naming.NamingException {
42: // Obtain initial context
43: javax.naming.InitialContext initialContext = new javax.naming.InitialContext(
44: environment);
45: try {
46: Object objRef = initialContext.lookup(FacadeHome.JNDI_NAME);
47: return (FacadeHome) javax.rmi.PortableRemoteObject.narrow(
48: objRef, FacadeHome.class);
49: } finally {
50: initialContext.close();
51: }
52: }
53:
54: }
|