KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openejb > core > ivm > naming > IntraVmJndiReference


1 package org.openejb.core.ivm.naming;
2
3 import javax.naming.NamingException JavaDoc;
4
5 import org.openejb.OpenEJB;
6
7 /**
8  * This class is used when the object to be referenced is accessible through
9  * the OpenEJB global name space.
10  *
11  * The lookup name is provided, but not the context because it can be obtained
12  * dynamically using OpenEJB.getJNDIContext() method.
13  *
14  * The object is not resolved until it's requested.
15  *
16  * This is primarily used when constructing the JNDI ENC for a bean.
17  */

18 public class IntraVmJndiReference implements Reference{
19     
20     private String JavaDoc jndiName;
21     
22     public IntraVmJndiReference(String JavaDoc jndiName){
23         this.jndiName = jndiName;
24     }
25     
26     public Object JavaDoc getObject( ) throws NamingException{
27         return OpenEJB.getJNDIContext().lookup( jndiName );
28     }
29 }
30
Popular Tags