KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > cmp2 > ejbselect > BUtil


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

4 package org.jboss.test.cmp2.ejbselect;
5
6 /**
7  * Utility class for B.
8  */

9 public class BUtil
10 {
11
12    /** Cached local home (EJBLocalHome). Uses lazy loading to obtain its value (loaded by getLocalHome() methods). */
13    private static org.jboss.test.cmp2.ejbselect.BLocalHome cachedLocalHome = null;
14
15    // Home interface lookup methods
16

17    /**
18     * Obtain local home interface from default initial context
19     * @return Local home interface for B. Lookup using JNDI_NAME
20     */

21    public static org.jboss.test.cmp2.ejbselect.BLocalHome getLocalHome() throws javax.naming.NamingException JavaDoc
22    {
23       // Local homes shouldn't be narrowed, as there is no RMI involved.
24
if (cachedLocalHome == null) {
25          // Obtain initial context
26
javax.naming.InitialContext JavaDoc initialContext = new javax.naming.InitialContext JavaDoc();
27          try {
28             cachedLocalHome = (org.jboss.test.cmp2.ejbselect.BLocalHome) initialContext.lookup(org.jboss.test.cmp2.ejbselect.BLocalHome.JNDI_NAME);
29          } finally {
30             initialContext.close();
31          }
32       }
33       return cachedLocalHome;
34    }
35
36 }
Popular Tags