01: /*
02: * Generated file - Do not edit!
03: */
04: package org.jboss.test.cmp2.cmrtree.ejb;
05:
06: import javax.naming.InitialContext;
07: import javax.naming.NamingException;
08:
09: /**
10: * Utility class for A.
11: */
12: public class AUtil {
13:
14: /** Cached local home (EJBLocalHome). Uses lazy loading to obtain its value (loaded by getLocalHome() methods). */
15: private static ALocalHome cachedLocalHome = null;
16:
17: // Home interface lookup methods
18:
19: /**
20: * Obtain local home interface from default initial context
21: * @return Local home interface for A. Lookup using JNDI_NAME
22: */
23: public static ALocalHome getLocalHome() throws NamingException {
24: // Local homes shouldn't be narrowed, as there is no RMI involved.
25: if (cachedLocalHome == null) {
26: // Obtain initial context
27: InitialContext initialContext = new InitialContext();
28: try {
29: cachedLocalHome = (ALocalHome) initialContext
30: .lookup(ALocalHome.JNDI_NAME);
31: } finally {
32: initialContext.close();
33: }
34: }
35: return cachedLocalHome;
36: }
37:
38: }
|