org.openejb.core.ivm
Class IntraVmHandle

java.lang.Object
  extended by org.openejb.core.ivm.IntraVmHandle
All Implemented Interfaces:
Serializable, javax.ejb.Handle, javax.ejb.HomeHandle

public class IntraVmHandle
extends Object
implements Serializable, javax.ejb.HomeHandle, javax.ejb.Handle

IntraVM implementation of the interface javax.ejb.Handle

Author:
David Blevins, Richard Monson-Haefel
See Also:
Serialized Form

Field Summary
protected  Object theProxy
          The Proxy subclass that represents the bean deployment's EJBHome or EJBObject.
 
Constructor Summary
IntraVmHandle()
          Constructs an IntraVmHandle that has no refernce to an EJBHome or EJBObject.
IntraVmHandle(Object proxy)
          Constructs an IntraVmHandle that has a refernce to the specified EJBHome or EJBObject stub/proxy.
 
Method Summary
 javax.ejb.EJBHome getEJBHome()
          Returns the stub/proxy referenced by this handle as an EJBHome.
 javax.ejb.EJBObject getEJBObject()
          Returns the stub/proxy referenced by this handle as an EJBObject.
 Object getPrimaryKey()
           
protected  void setProxy(Object prxy)
          Sets the EJBHome or EJBObject stub/proxy that this handle is a reference to.
protected  Object writeReplace()
          If the handle is being copied between bean instances in a RPC call we use the IntraVmArtifact If the handle is referenced by a stateful bean that is being passivated by the container, we allow this object to be serialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theProxy

protected Object theProxy
The Proxy subclass that represents the bean deployment's EJBHome or EJBObject.

See Also:
Proxy
Constructor Detail

IntraVmHandle

public IntraVmHandle()
Constructs an IntraVmHandle that has no refernce to an EJBHome or EJBObject.


IntraVmHandle

public IntraVmHandle(Object proxy)
Constructs an IntraVmHandle that has a refernce to the specified EJBHome or EJBObject stub/proxy.

Parameters:
proxy -
Method Detail

setProxy

protected void setProxy(Object prxy)
Sets the EJBHome or EJBObject stub/proxy that this handle is a reference to.

Parameters:
prxy - The proxy object that this handle will reference.

getEJBHome

public javax.ejb.EJBHome getEJBHome()
Returns the stub/proxy referenced by this handle as an EJBHome.

Specified by:
getEJBHome in interface javax.ejb.HomeHandle
Returns:
the proxy object this handle is a reference to.

getEJBObject

public javax.ejb.EJBObject getEJBObject()
Returns the stub/proxy referenced by this handle as an EJBObject.

Specified by:
getEJBObject in interface javax.ejb.Handle
Returns:
the proxy object this handle is a reference to.

getPrimaryKey

public Object getPrimaryKey()

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
If the handle is being copied between bean instances in a RPC call we use the IntraVmArtifact If the handle is referenced by a stateful bean that is being passivated by the container, we allow this object to be serialized. If the handle is serialized outside the core container system, we allow the application server to handle it.

Returns:
Object
Throws:
ObjectStreamException


Copyright © 1999-2010 OpenEJB. All Rights Reserved.