KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > cmp2 > enums > ejb > FacadeUtil


1 /*
2  * Generated file - Do not edit!
3  */

4 package org.jboss.test.cmp2.enums.ejb;
5
6 /**
7  * Utility class for Facade.
8  */

9 public class FacadeUtil
10 {
11    /** Cached remote home (EJBHome). Uses lazy loading to obtain its value (loaded by getHome() methods). */
12    private static org.jboss.test.cmp2.enums.ejb.FacadeHome cachedRemoteHome = null;
13
14    // Home interface lookup methods
15

16    /**
17     * Obtain remote home interface from default initial context
18     * @return Home interface for Facade. Lookup using JNDI_NAME
19     */

20    public static org.jboss.test.cmp2.enums.ejb.FacadeHome getHome() throws javax.naming.NamingException JavaDoc
21    {
22       if (cachedRemoteHome == null) {
23          // Obtain initial context
24
javax.naming.InitialContext JavaDoc initialContext = new javax.naming.InitialContext JavaDoc();
25          try {
26             java.lang.Object JavaDoc objRef = initialContext.lookup(org.jboss.test.cmp2.enums.ejb.FacadeHome.JNDI_NAME);
27             cachedRemoteHome = (org.jboss.test.cmp2.enums.ejb.FacadeHome) javax.rmi.PortableRemoteObject.narrow(objRef, org.jboss.test.cmp2.enums.ejb.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 org.jboss.test.cmp2.enums.ejb.FacadeHome getHome( java.util.Hashtable JavaDoc environment ) throws javax.naming.NamingException JavaDoc
41    {
42       // Obtain initial context
43
javax.naming.InitialContext JavaDoc initialContext = new javax.naming.InitialContext JavaDoc(environment);
44       try {
45          java.lang.Object JavaDoc objRef = initialContext.lookup(org.jboss.test.cmp2.enums.ejb.FacadeHome.JNDI_NAME);
46          return (org.jboss.test.cmp2.enums.ejb.FacadeHome) javax.rmi.PortableRemoteObject.narrow(objRef, org.jboss.test.cmp2.enums.ejb.FacadeHome.class);
47       } finally {
48          initialContext.close();
49       }
50    }
51
52 }
Popular Tags