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