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

NestedStatefulBeanContext

public class NestedStatefulBeanContext extends StatefulBeanContext
Overrides superclass to not use MarshalledValue in externalization, as a nested context is meant to be serialized as part of its parent context and to share with it object references to any XPC or managed entities. Serializing with a MarshalledValue would result in separate deserializations of the XPCs and managed entities.
author
Bill Burke
version
$Revision: 60651 $

Fields Summary
private static final long
serialVersionUID
The serialVersionUID
Constructors Summary
Methods Summary
public voidreadExternal(java.io.ObjectInput in)

      containerName = in.readUTF();
      id = in.readObject();
      metadata = (SimpleMetaData) in.readObject();
      bean = in.readObject();
      persistenceContexts = (HashMap<String, EntityManager>)  in.readObject();
      interceptorInstances = (HashMap<Class, Object>)in.readObject();
      contains = (List<StatefulBeanContext>) in.readObject();
      removed = in.readBoolean();
      replicationIsPassivation = in.readBoolean();
      
      // Since we can't write a ref to our parent, our children also
      // don't have a ref to use.  So reestablish it.
      if (contains != null)
      {
         for (StatefulBeanContext contained : contains)
         {
            contained.containedIn = this;
         }
      }
      
      // If we've just been deserialized, we are passivated
      passivated = true;
   
public voidwriteExternal(java.io.ObjectOutput out)


        
   
      out.writeUTF(getContainer().getObjectName().getCanonicalName());
      out.writeObject(id);
      out.writeObject(metadata);
      out.writeObject(bean);
      out.writeObject(persistenceContexts);
      out.writeObject(interceptorInstances);
      out.writeObject(contains);
      // Cannot write a ref to our parent as that seems to blow up serialization
      //out.writeObject(containedIn);
      out.writeBoolean(removed);
      out.writeBoolean(replicationIsPassivation);