org.jboss.proxy.ejb.handle
Class StatefulHandleImpl

java.lang.Object
  extended byorg.jboss.proxy.ejb.handle.StatefulHandleImpl
All Implemented Interfaces:
javax.ejb.Handle, Serializable

public class StatefulHandleImpl
extends Object
implements javax.ejb.Handle

An EJB stateful session bean handle.

Version:
$Revision: 1.9.2.6 $
Author:
Marc Fleury, Jason Dillon, Bill Burke
See Also:
Serialized Form

Field Summary
protected static Method GET_EJB_OBJECT
          A reference to Handle.getEJBObject().
 Object id
           
 Invoker invoker
           
 String invokerProxyBinding
           
 String jndiName
           
 int objectName
          The identity of the bean.
 
Constructor Summary
StatefulHandleImpl(int objectName, String jndiName, Invoker invoker, String invokerProxyBinding, Object id, Object invokerID)
          Create an ejb handle for a stateful session bean.
 
Method Summary
 javax.ejb.EJBObject getEJBObject()
          Handle implementation.
 Object getID()
           
 String getJNDIName()
           
protected  boolean isLocal()
          Returns wether we are local to the originating container or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GET_EJB_OBJECT

protected static final Method GET_EJB_OBJECT
A reference to Handle.getEJBObject().


objectName

public int objectName
The identity of the bean.


jndiName

public String jndiName

invokerProxyBinding

public String invokerProxyBinding

invoker

public Invoker invoker

id

public Object id
Constructor Detail

StatefulHandleImpl

public StatefulHandleImpl(int objectName,
                          String jndiName,
                          Invoker invoker,
                          String invokerProxyBinding,
                          Object id,
                          Object invokerID)
Create an ejb handle for a stateful session bean.

Parameters:
objectName - - the session container jmx name
jndiName - - the session home ejb name
invoker - - the invoker to request the EJBObject from
invokerProxyBinding - - the type of invoker binding
id - - the session id
Method Detail

getID

public Object getID()
Returns:
the internal session identifier

getJNDIName

public String getJNDIName()
Returns:
the jndi name

getEJBObject

public javax.ejb.EJBObject getEJBObject()
                                 throws RemoteException
Handle implementation. This differs from Stateless and Entity handles which just invoke standard methods (create and findByPrimaryKey respectively) on the Home interface (proxy). There is no equivalent option for stateful SBs, so a direct invocation on the container has to be made to locate the bean by its id (the stateful SB container provides an implementation of getEJBObject). This means the security context has to be set here just as it would be in the Proxy.

Specified by:
getEJBObject in interface javax.ejb.Handle
Returns:
EJBObject reference.
Throws:
ServerException - Could not get EJBObject.
RemoteException

isLocal

protected boolean isLocal()
Returns wether we are local to the originating container or not.



Copyright © 2002 JBoss Group, LLC. All Rights Reserved.