org.objectweb.easybeans.rpc
Class AbsCallRef

java.lang.Object
  extended by org.objectweb.easybeans.rpc.AbsCallRef
All Implemented Interfaces:
javax.naming.Referenceable
Direct Known Subclasses:
LocalCallRef, RemoteCallRef

public abstract class AbsCallRef
extends java.lang.Object
implements javax.naming.Referenceable

Define a common Referenceable objectd used by local or remote EJB.

Author:
Florent Benoit

Field Summary
static java.lang.String CONTAINER_ID
          Property used for referencing the container ID.
private  java.lang.String containerId
          Container id.
static java.lang.String FACTORY_NAME
          Property used for referencing the name of the factory.
private  java.lang.String factoryName
          Factory name.
static java.lang.String INTERFACE_NAME
          Property used for referencing the interface class name.
private  java.lang.String itfClassName
          Name of the interface class.
static java.lang.String USE_ID
          Property used for using an unique ID or not.
private  boolean useID
          useID : true if all instance build with this ref are unique (stateful), false if it references the same object (stateless).
 
Constructor Summary
AbsCallRef(java.lang.String itfClassName, java.lang.String containerId, java.lang.String factoryName, boolean useID)
          Constructor : build a reference.
 
Method Summary
 java.lang.String getItfClassName()
          Gets the interface class name.
abstract  javax.naming.Reference getReference()
          Retrieves the Reference of this object.
protected  void updateRefAddr(javax.naming.Reference reference)
          Adds some settings to the reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTAINER_ID

public static final java.lang.String CONTAINER_ID
Property used for referencing the container ID.

See Also:
Constant Field Values

FACTORY_NAME

public static final java.lang.String FACTORY_NAME
Property used for referencing the name of the factory.

See Also:
Constant Field Values

INTERFACE_NAME

public static final java.lang.String INTERFACE_NAME
Property used for referencing the interface class name.

See Also:
Constant Field Values

USE_ID

public static final java.lang.String USE_ID
Property used for using an unique ID or not.

See Also:
Constant Field Values

itfClassName

private java.lang.String itfClassName
Name of the interface class.


containerId

private java.lang.String containerId
Container id.


factoryName

private java.lang.String factoryName
Factory name.


useID

private boolean useID
useID : true if all instance build with this ref are unique (stateful), false if it references the same object (stateless).

Constructor Detail

AbsCallRef

public AbsCallRef(java.lang.String itfClassName,
                  java.lang.String containerId,
                  java.lang.String factoryName,
                  boolean useID)
Constructor : build a reference.

Parameters:
itfClassName - the name of the interface.
containerId - the ID of the container.
factoryName - the name of the factory
useID - true if all instance build with this ref are unique (stateful), false if it references the same object (stateless)
Method Detail

getReference

public abstract javax.naming.Reference getReference()
                                             throws javax.naming.NamingException
Retrieves the Reference of this object.

Specified by:
getReference in interface javax.naming.Referenceable
Returns:
The non-null Reference of this object.
Throws:
javax.naming.NamingException - If a naming exception was encountered while retrieving the reference.

updateRefAddr

protected void updateRefAddr(javax.naming.Reference reference)
Adds some settings to the reference.

Parameters:
reference - the reference to configure

getItfClassName

public java.lang.String getItfClassName()
Gets the interface class name.

Returns:
the name of the interface.