01: /*
02: * Generated file - Do not edit!
03: */
04: package org.jboss.test.cmp2.cmrtree.ejb;
05:
06: import javax.naming.NamingException;
07:
08: /**
09: * Utility class for B.
10: */
11: public class BUtil {
12:
13: /** Cached local home (EJBLocalHome). Uses lazy loading to obtain its value (loaded by getLocalHome() methods). */
14: private static BLocalHome cachedLocalHome = null;
15:
16: // Home interface lookup methods
17:
18: /**
19: * Obtain local home interface from default initial context
20: * @return Local home interface for B. Lookup using JNDI_NAME
21: */
22: public static BLocalHome getLocalHome() throws NamingException {
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 initialContext = new javax.naming.InitialContext();
27: try {
28: cachedLocalHome = (BLocalHome) initialContext
29: .lookup(BLocalHome.JNDI_NAME);
30: } finally {
31: initialContext.close();
32: }
33: }
34: return cachedLocalHome;
35: }
36:
37: }
|