org.jboss.ejb3.stateful
Class ProxiedStatefulBeanContext

java.lang.Object
  extended by org.jboss.ejb3.BaseContext<T>
      extended by org.jboss.ejb3.session.SessionBeanContext<T>
          extended by org.jboss.ejb3.session.SessionSpecBeanContext<StatefulContainer>
              extended by org.jboss.ejb3.stateful.StatefulBeanContext
                  extended by org.jboss.ejb3.stateful.ProxiedStatefulBeanContext
All Implemented Interfaces:
Externalizable, Serializable, org.jboss.ejb3.cache.Identifiable, org.jboss.ejb3.interceptors.container.BeanContext<Object>, org.jboss.ejb3.tx.container.StatefulBeanContext<Object>

public class ProxiedStatefulBeanContext
extends StatefulBeanContext
implements Externalizable

Proxy to a NestedStatefulBeanContext that can be independently passivated, activated and replicated without disturbing the object it is proxying.

Version:
$Revision: 73457 $
Author:
Bill Burke, Brian Stansberry
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.ejb3.stateful.StatefulBeanContext
beanMO, containedIn, containerClusterUid, containerGuid, contains, currentBean, discarded, id, inInvocation, isClustered, lastUsed, lock, markedForPassivation, markedForReplication, passivated, persistenceContexts, propagatedContainedIn, removed, replicationIsPassivation, txSynchronized
 
Fields inherited from class org.jboss.ejb3.session.SessionBeanContext
ejbContext
 
Fields inherited from class org.jboss.ejb3.BaseContext
bean, container, interceptorInstances, log, metadata, rm
 
Constructor Summary
ProxiedStatefulBeanContext()
          Only for externalization.
ProxiedStatefulBeanContext(StatefulBeanContext delegate)
           
 
Method Summary
 void activateAfterReplication()
          Ignores the call, as activation of this proxy context does not affect the underlying bean (which is activated along with its parent context).
 void addContains(StatefulBeanContext ctx)
           
 void addExtendedPersistenceContext(String id, javax.persistence.EntityManager pc)
           
 boolean equals(Object obj)
           
 void extractBeanAndInterceptors()
           
 boolean getCanPassivate()
          Checks whether this context or any of its children are in use.
 boolean getCanRemoveFromCache()
           
 StatefulBeanContext getContainedIn()
           
 StatefulContainer getContainer()
           
 List<StatefulBeanContext> getContains()
           
protected  StatefulBeanContext getDelegate()
           
 javax.ejb.EJBContext getEJBContext()
           
 javax.persistence.EntityManager getExtendedPersistenceContext(String id)
           
 Map<String,javax.persistence.EntityManager> getExtendedPersistenceContexts()
           
 Object getId()
           
 Object getInstance()
          Returns the enterprise bean, never returns null.
 Object getInterceptor(Class<?> interceptorClass)
           
 Object[] getInterceptorInstances(InterceptorInfo[] interceptorInfos)
           
 Object getInvokedMethodKey()
           
 ReentrantLock getLock()
           
 org.jboss.aop.metadata.SimpleMetaData getMetaData()
           
 boolean getReplicationIsPassivation()
           
 StatefulBeanContext getUltimateContainedIn()
           
 int hashCode()
           
 void initialiseInterceptorInstances()
           
 boolean isDiscarded()
           
 boolean isInInvocation()
           
 boolean isInUse()
           
 boolean isRemoved()
           
 boolean isTxSynchronized()
           
 void passivateAfterReplication()
          Ignores the call, as passivation of this proxy context does not affect the underlying bean (which is passivated along with its parent context).
 void popContainedIn()
           
 void postActivate()
          Ignores the call, as activation of this proxy context does not affect the underlying bean (which is activated along with its parent context).
 void postReplicate()
          Ignores the call, as replication of this proxy context does not affect the underlying bean (which is replicated along with its parent context).
 void prePassivate()
          Ignores the call, as passivation of this proxy context does not affect the underlying bean (which is passivated along with its parent context).
 void preReplicate()
          Ignores the call, as replication of this proxy context does not affect the underlying bean (which is replicated along with its parent context).
 StatefulBeanContext pushContainedIn()
           
 void readExternal(ObjectInput in)
           
 void remove()
           
 void removeContains(StatefulBeanContext ctx)
           
 void removeExtendedPersistenceContext(String id)
           
 boolean scanForExtendedPersistenceContext(String id, StatefulBeanContext ignore)
           
 void setDiscarded(boolean discarded)
           
 void setInInvocation(boolean inInvocation)
           
 void setInUse(boolean inUse)
           
 void setReplicationIsPassivation(boolean replicationIsPassivation)
           
 void setTxSynchronized(boolean txSynchronized)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.jboss.ejb3.stateful.StatefulBeanContext
isModified
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxiedStatefulBeanContext

public ProxiedStatefulBeanContext(StatefulBeanContext delegate)

ProxiedStatefulBeanContext

public ProxiedStatefulBeanContext()
Only for externalization.

Method Detail

getDelegate

protected StatefulBeanContext getDelegate()

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class StatefulBeanContext
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class StatefulBeanContext
Throws:
IOException
ClassNotFoundException

getContains

public List<StatefulBeanContext> getContains()
Overrides:
getContains in class StatefulBeanContext

getExtendedPersistenceContext

public javax.persistence.EntityManager getExtendedPersistenceContext(String id)
Overrides:
getExtendedPersistenceContext in class StatefulBeanContext

addExtendedPersistenceContext

public void addExtendedPersistenceContext(String id,
                                          javax.persistence.EntityManager pc)
Overrides:
addExtendedPersistenceContext in class StatefulBeanContext

getExtendedPersistenceContexts

public Map<String,javax.persistence.EntityManager> getExtendedPersistenceContexts()
Overrides:
getExtendedPersistenceContexts in class StatefulBeanContext

removeExtendedPersistenceContext

public void removeExtendedPersistenceContext(String id)
Overrides:
removeExtendedPersistenceContext in class StatefulBeanContext

scanForExtendedPersistenceContext

public boolean scanForExtendedPersistenceContext(String id,
                                                 StatefulBeanContext ignore)
Overrides:
scanForExtendedPersistenceContext in class StatefulBeanContext

getContainedIn

public StatefulBeanContext getContainedIn()
Overrides:
getContainedIn in class StatefulBeanContext

addContains

public void addContains(StatefulBeanContext ctx)
Overrides:
addContains in class StatefulBeanContext

removeContains

public void removeContains(StatefulBeanContext ctx)
Overrides:
removeContains in class StatefulBeanContext

pushContainedIn

public StatefulBeanContext pushContainedIn()
Overrides:
pushContainedIn in class StatefulBeanContext

popContainedIn

public void popContainedIn()
Overrides:
popContainedIn in class StatefulBeanContext

getUltimateContainedIn

public StatefulBeanContext getUltimateContainedIn()
Overrides:
getUltimateContainedIn in class StatefulBeanContext

isInUse

public boolean isInUse()
Overrides:
isInUse in class StatefulBeanContext

setInUse

public void setInUse(boolean inUse)
Overrides:
setInUse in class StatefulBeanContext

isDiscarded

public boolean isDiscarded()
Overrides:
isDiscarded in class StatefulBeanContext

setDiscarded

public void setDiscarded(boolean discarded)
Overrides:
setDiscarded in class StatefulBeanContext

isRemoved

public boolean isRemoved()
Overrides:
isRemoved in class StatefulBeanContext

getLock

public ReentrantLock getLock()
Overrides:
getLock in class StatefulBeanContext

isInInvocation

public boolean isInInvocation()
Overrides:
isInInvocation in class StatefulBeanContext

setInInvocation

public void setInInvocation(boolean inInvocation)
Overrides:
setInInvocation in class StatefulBeanContext

getId

public Object getId()
Specified by:
getId in interface org.jboss.ejb3.cache.Identifiable
Overrides:
getId in class StatefulBeanContext

isTxSynchronized

public boolean isTxSynchronized()
Overrides:
isTxSynchronized in class StatefulBeanContext

setTxSynchronized

public void setTxSynchronized(boolean txSynchronized)
Overrides:
setTxSynchronized in class StatefulBeanContext

remove

public void remove()
Overrides:
remove in class StatefulBeanContext

getContainer

public StatefulContainer getContainer()
Overrides:
getContainer in class StatefulBeanContext

getInstance

public Object getInstance()
Description copied from class: BaseContext
Returns the enterprise bean, never returns null.

Specified by:
getInstance in interface org.jboss.ejb3.interceptors.container.BeanContext<Object>
Overrides:
getInstance in class StatefulBeanContext

getMetaData

public org.jboss.aop.metadata.SimpleMetaData getMetaData()
Specified by:
getMetaData in interface org.jboss.ejb3.tx.container.StatefulBeanContext<Object>
Overrides:
getMetaData in class StatefulBeanContext

getInterceptorInstances

public Object[] getInterceptorInstances(InterceptorInfo[] interceptorInfos)
Overrides:
getInterceptorInstances in class StatefulBeanContext

extractBeanAndInterceptors

public void extractBeanAndInterceptors()
Overrides:
extractBeanAndInterceptors in class StatefulBeanContext

getEJBContext

public javax.ejb.EJBContext getEJBContext()
Overrides:
getEJBContext in class StatefulBeanContext

prePassivate

public void prePassivate()
Ignores the call, as passivation of this proxy context does not affect the underlying bean (which is passivated along with its parent context).

Overrides:
prePassivate in class StatefulBeanContext

postActivate

public void postActivate()
Ignores the call, as activation of this proxy context does not affect the underlying bean (which is activated along with its parent context).

Overrides:
postActivate in class StatefulBeanContext

passivateAfterReplication

public void passivateAfterReplication()
Ignores the call, as passivation of this proxy context does not affect the underlying bean (which is passivated along with its parent context).

Overrides:
passivateAfterReplication in class StatefulBeanContext

activateAfterReplication

public void activateAfterReplication()
Ignores the call, as activation of this proxy context does not affect the underlying bean (which is activated along with its parent context).

Overrides:
activateAfterReplication in class StatefulBeanContext

getCanPassivate

public boolean getCanPassivate()
Description copied from class: StatefulBeanContext
Checks whether this context or any of its children are in use.

Overrides:
getCanPassivate in class StatefulBeanContext

getCanRemoveFromCache

public boolean getCanRemoveFromCache()
Overrides:
getCanRemoveFromCache in class StatefulBeanContext

getReplicationIsPassivation

public boolean getReplicationIsPassivation()
Overrides:
getReplicationIsPassivation in class StatefulBeanContext

setReplicationIsPassivation

public void setReplicationIsPassivation(boolean replicationIsPassivation)
Overrides:
setReplicationIsPassivation in class StatefulBeanContext

preReplicate

public void preReplicate()
Ignores the call, as replication of this proxy context does not affect the underlying bean (which is replicated along with its parent context).

Overrides:
preReplicate in class StatefulBeanContext

postReplicate

public void postReplicate()
Ignores the call, as replication of this proxy context does not affect the underlying bean (which is replicated along with its parent context).

Overrides:
postReplicate in class StatefulBeanContext

getInvokedMethodKey

public Object getInvokedMethodKey()
Overrides:
getInvokedMethodKey in class StatefulBeanContext

getInterceptor

public Object getInterceptor(Class<?> interceptorClass)
                      throws IllegalArgumentException
Specified by:
getInterceptor in interface org.jboss.ejb3.interceptors.container.BeanContext<Object>
Overrides:
getInterceptor in class BaseContext<StatefulContainer>
Throws:
IllegalArgumentException

initialiseInterceptorInstances

public void initialiseInterceptorInstances()
Overrides:
initialiseInterceptorInstances in class BaseContext<StatefulContainer>

equals

public boolean equals(Object obj)
Overrides:
equals in class StatefulBeanContext

hashCode

public int hashCode()
Overrides:
hashCode in class StatefulBeanContext


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.