KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > entity > interfaces > TestEntityUtil


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

4 package org.jboss.test.entity.interfaces;
5
6 /**
7  * Utility class for TestEntity.
8  */

9 public class TestEntityUtil
10 {
11
12    // Home interface lookup methods
13

14    /**
15     * Obtain remote home interface from default initial context
16     * @return Home interface for TestEntity. Lookup using JNDI_NAME
17     */

18    public static org.jboss.test.entity.interfaces.TestEntityHome getHome() throws javax.naming.NamingException JavaDoc
19    {
20       // Obtain initial context
21
javax.naming.InitialContext JavaDoc initialContext = new javax.naming.InitialContext JavaDoc();
22       try {
23          java.lang.Object JavaDoc objRef = initialContext.lookup(org.jboss.test.entity.interfaces.TestEntityHome.JNDI_NAME);
24          return (org.jboss.test.entity.interfaces.TestEntityHome) javax.rmi.PortableRemoteObject.narrow(objRef, org.jboss.test.entity.interfaces.TestEntityHome.class);
25       } finally {
26          initialContext.close();
27       }
28    }
29
30    /**
31     * Obtain remote home interface from parameterised initial context
32     * @param environment Parameters to use for creating initial context
33     * @return Home interface for TestEntity. Lookup using JNDI_NAME
34     */

35    public static org.jboss.test.entity.interfaces.TestEntityHome getHome( java.util.Hashtable JavaDoc environment ) throws javax.naming.NamingException JavaDoc
36    {
37       // Obtain initial context
38
javax.naming.InitialContext JavaDoc initialContext = new javax.naming.InitialContext JavaDoc(environment);
39       try {
40          java.lang.Object JavaDoc objRef = initialContext.lookup(org.jboss.test.entity.interfaces.TestEntityHome.JNDI_NAME);
41          return (org.jboss.test.entity.interfaces.TestEntityHome) javax.rmi.PortableRemoteObject.narrow(objRef, org.jboss.test.entity.interfaces.TestEntityHome.class);
42       } finally {
43          initialContext.close();
44       }
45    }
46
47    /**
48     * Obtain local home interface from default initial context
49     * @return Local home interface for TestEntity. Lookup using JNDI_NAME
50     */

51    public static org.jboss.test.entity.interfaces.TestEntityLocalHome getLocalHome() throws javax.naming.NamingException JavaDoc
52    {
53       // Local homes shouldn't be narrowed, as there is no RMI involved.
54
// Obtain initial context
55
javax.naming.InitialContext JavaDoc initialContext = new javax.naming.InitialContext JavaDoc();
56       try {
57          return (org.jboss.test.entity.interfaces.TestEntityLocalHome) initialContext.lookup(org.jboss.test.entity.interfaces.TestEntityLocalHome.JNDI_NAME);
58       } finally {
59          initialContext.close();
60       }
61    }
62
63 }
Popular Tags