FileDocCategorySizeDatePackage
StatefulBeanContextReference.javaAPI DocJBoss 4.2.12694Fri Jul 13 20:53:50 BST 2007org.jboss.ejb3.stateful

StatefulBeanContextReference

public class StatefulBeanContextReference extends Object implements Externalizable
Serializable reference to stateful bean context that can be disconnected
author
Bill Burke
version
$Revision: 60650 $

Fields Summary
private static final long
serialVersionUID
The serialVersionUID
private transient StatefulBeanContext
beanContext
private Object
oid
private String
containerId
Constructors Summary
public StatefulBeanContextReference()

   
   

    
   
   
public StatefulBeanContextReference(StatefulBeanContext beanContext)

      this.beanContext = beanContext;
      oid = beanContext.getId();
      containerId = beanContext.getContainer().getObjectName().getCanonicalName();
   
Methods Summary
public StatefulBeanContextgetBeanContext()

      if (beanContext == null)
      {
         StatefulContainer container = (StatefulContainer)Ejb3Registry.getContainer(containerId);
         // We are willing to accept a context that has been marked as removed
         // as it can still hold nested children
         beanContext = container.getCache().get(oid, false);
      }
      return beanContext;
   
public voidreadExternal(java.io.ObjectInput in)

      containerId = in.readUTF();
      oid = in.readObject();
   
public voidwriteExternal(java.io.ObjectOutput out)

      out.writeUTF(containerId);
      out.writeObject(oid);