com.caucho.config.types
Class EjbRef

java.lang.Object
  extended by com.caucho.config.types.BaseRef
      extended by com.caucho.config.types.EjbRef
All Implemented Interfaces:
ObjectProxy
Direct Known Subclasses:
EjbLocalRef

public class EjbRef
extends BaseRef
implements ObjectProxy

Configuration for the ejb-ref. An ejb-ref is used to make an ejb available within the environment in which the ejb-ref is declared.


Field Summary
 
Fields inherited from class com.caucho.config.types.BaseRef
_injectionTarget, _modulePath, _sourceEjbName
 
Constructor Summary
EjbRef()
           
EjbRef(javax.naming.Context context)
           
EjbRef(Path modulePath)
           
EjbRef(Path modulePath, java.lang.String sourceEjbName)
           
 
Method Summary
 void bind()
           
 java.lang.Object createObject(java.util.Hashtable env)
          Creates the object from the proxy.
 java.lang.Object getByType(java.lang.Class type)
           
 java.lang.String getEjbRefName()
          Returns the ejb name.
 java.lang.Class getHome()
          Returns the home class.
 InjectionTarget getInjectionTarget()
          Gets the injection-target
 java.lang.Class getLocal()
           
 java.lang.Class getRemote()
          Returns the remote class.
protected  java.lang.String getTagName()
           
 void init()
           
 void initBinding(AbstractServer ejbServer)
           
 boolean isEjbLocalRef()
           
 void mergeFrom(EjbRef other)
          Merges duplicated information in application-client.xml / resin-application-client.xml
 void setClientClassName(java.lang.String clientClassName)
           
 void setConfigLocation(java.lang.String loc)
           
 void setDescription(java.lang.String description)
           
 void setEjbLink(java.lang.String ejbLink)
          Set the target of the reference, an alternative to #setJndiName(String).
 void setEjbRefName(java.lang.String name)
          Sets the name to use in the local jndi context.
 void setEjbRefType(java.lang.String type)
           
 void setForeignName(java.lang.String foreignName)
          Sets the canonical jndi name to use to find the bean that is the target of the reference.
 void setHome(java.lang.Class home)
           
 void setId(java.lang.String id)
           
 void setInjectionTarget(InjectionTarget injectionTarget)
          Sets the injection-target
 void setRemote(java.lang.Class remote)
           
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.config.types.BaseRef
getFieldOrMethod, getJavaClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EjbRef

public EjbRef()

EjbRef

public EjbRef(javax.naming.Context context)

EjbRef

public EjbRef(Path modulePath)

EjbRef

public EjbRef(Path modulePath,
              java.lang.String sourceEjbName)
Method Detail

setConfigLocation

public void setConfigLocation(java.lang.String loc)

isEjbLocalRef

public boolean isEjbLocalRef()

getInjectionTarget

public InjectionTarget getInjectionTarget()
Gets the injection-target

Overrides:
getInjectionTarget in class BaseRef

getLocal

public java.lang.Class getLocal()

getTagName

protected java.lang.String getTagName()

setId

public void setId(java.lang.String id)

setDescription

public void setDescription(java.lang.String description)

setClientClassName

public void setClientClassName(java.lang.String clientClassName)

setEjbRefName

public void setEjbRefName(java.lang.String name)
Sets the name to use in the local jndi context. This is the jndi lookup name that code uses to obtain the home for the bean when doing a jndi lookup.
   ejb/Gryffindor
   ...
   (new InitialContext()).lookup("java:comp/env/ejb/Gryffindor");
 


setInjectionTarget

public void setInjectionTarget(InjectionTarget injectionTarget)
Sets the injection-target

Overrides:
setInjectionTarget in class BaseRef

getEjbRefName

public java.lang.String getEjbRefName()
Returns the ejb name.


setEjbRefType

public void setEjbRefType(java.lang.String type)

setHome

public void setHome(java.lang.Class home)

getHome

public java.lang.Class getHome()
Returns the home class.


setRemote

public void setRemote(java.lang.Class remote)

getRemote

public java.lang.Class getRemote()
Returns the remote class.


setForeignName

public void setForeignName(java.lang.String foreignName)
Sets the canonical jndi name to use to find the bean that is the target of the reference. For remote beans, a <jndi-link> LinkProxy is used to link the local jndi context referred to in this name to a remote context.


setEjbLink

public void setEjbLink(java.lang.String ejbLink)
Set the target of the reference, an alternative to #setJndiName(String). The format of the ejbLink is "bean", or "jarname#bean", where bean is the ejb-name of a bean within the same enterprise application, and jarname further qualifies the identity of the target.


mergeFrom

public void mergeFrom(EjbRef other)
Merges duplicated information in application-client.xml / resin-application-client.xml


init

public void init()
          throws java.lang.Exception
Throws:
java.lang.Exception

bind

public void bind()
          throws java.lang.Exception
Throws:
java.lang.Exception

initBinding

public void initBinding(AbstractServer ejbServer)
                 throws java.lang.Exception
Throws:
java.lang.Exception

createObject

public java.lang.Object createObject(java.util.Hashtable env)
                              throws javax.naming.NamingException
Creates the object from the proxy.

Specified by:
createObject in interface ObjectProxy
Returns:
the object named by the proxy.
Throws:
javax.naming.NamingException

getByType

public java.lang.Object getByType(java.lang.Class type)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object