KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

9 public class ChildUtil
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.enums.ejb.ChildLocalHome 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 Child. Lookup using JNDI_NAME
20     */

21    public static org.jboss.test.cmp2.enums.ejb.ChildLocalHome 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.enums.ejb.ChildLocalHome) initialContext.lookup(org.jboss.test.cmp2.enums.ejb.ChildLocalHome.JNDI_NAME);
29          } finally {
30             initialContext.close();
31          }
32       }
33       return cachedLocalHome;
34    }
35
36 }
Popular Tags