站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 3.2.7 connector API Documentation 英文版文档

CachedConnectionInterceptor (JBoss Connector API) - JBoss 3.2.7 connector API Documentation 英文版文档


org.jboss.resource.connectionmanager
Class CachedConnectionInterceptor

java.lang.Object
  extended byorg.jboss.ejb.plugins.AbstractInterceptor
      extended byorg.jboss.resource.connectionmanager.CachedConnectionInterceptor
All Implemented Interfaces:
org.jboss.ejb.ContainerPlugin, org.jboss.ejb.EntityPersistenceManager, org.jboss.ejb.Interceptor, org.jboss.system.Service

public class CachedConnectionInterceptor
extends org.jboss.ejb.plugins.AbstractInterceptor
implements org.jboss.ejb.EntityPersistenceManager

CachedConnectionInterceptor.java Created: Sat Jan 12 01:22:06 2002

Version:
Author:
David Jencks, Erwin Guib

Field Summary
 
Fields inherited from class org.jboss.ejb.plugins.AbstractInterceptor
nextInterceptor
 
Constructor Summary
CachedConnectionInterceptor()
           
 
Method Summary
 void activateEntity(org.jboss.ejb.EntityEnterpriseContext instance)
          This method is called when an entity shall be activated.
 void create()
           
 Object createBeanClassInstance()
          Returns a new instance of the bean class or a subclass of the bean class.
 void createEntity(Method m, Object[] args, org.jboss.ejb.EntityEnterpriseContext instance)
          This method is called whenever an entity is to be created.
 void destroy()
           
 Collection findEntities(Method finderMethod, Object[] args, org.jboss.ejb.EntityEnterpriseContext instance, org.jboss.ejb.GenericEntityObjectFactory factory)
          This method is called when collections of entities are to be found.
 Object findEntity(Method finderMethod, Object[] args, org.jboss.ejb.EntityEnterpriseContext instance, org.jboss.ejb.GenericEntityObjectFactory factory)
          This method is called when single entities are to be found.
 org.jboss.ejb.Container getContainer()
           
 Object invoke(org.jboss.invocation.Invocation mi)
           
 void invokeEjbStore(org.jboss.ejb.EntityEnterpriseContext ctx)
           
 Object invokeHome(org.jboss.invocation.Invocation mi)
           
 boolean isModified(org.jboss.ejb.EntityEnterpriseContext ctx)
           
 boolean isStoreRequired(org.jboss.ejb.EntityEnterpriseContext instance)
          This method is used to determine if an entity should be stored.
 void loadEntity(org.jboss.ejb.EntityEnterpriseContext instance)
          This method is called whenever an entity shall be load from the underlying storage.
 void passivateEntity(org.jboss.ejb.EntityEnterpriseContext instance)
          This method is called when an entity shall be passivate.
 void postCreateEntity(Method m, Object[] args, org.jboss.ejb.EntityEnterpriseContext instance)
           
 void removeEntity(org.jboss.ejb.EntityEnterpriseContext instance)
          This method is called when an entity shall be removed from the underlying storage.
 void setContainer(org.jboss.ejb.Container container)
           
 void start()
           
 void stop()
           
 void storeEntity(org.jboss.ejb.EntityEnterpriseContext ctx)
          This method is called whenever an entity shall be stored to the underlying storage.
 
Methods inherited from class org.jboss.ejb.plugins.AbstractInterceptor
getNext, setNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedConnectionInterceptor

public CachedConnectionInterceptor()
                            throws Exception
Method Detail

start

public void start()
           throws Exception
Specified by:
start in interface org.jboss.system.Service
Throws:
Exception -

stop

public void stop()
Specified by:
stop in interface org.jboss.system.Service

destroy

public void destroy()
Specified by:
destroy in interface org.jboss.system.Service

create

public void create()
            throws Exception
Specified by:
create in interface org.jboss.system.Service
Throws:
Exception -

invoke

public Object invoke(org.jboss.invocation.Invocation mi)
              throws Exception
Specified by:
invoke in interface org.jboss.ejb.Interceptor
Returns:
Throws:
Exception -

invokeHome

public Object invokeHome(org.jboss.invocation.Invocation mi)
                  throws Exception
Specified by:
invokeHome in interface org.jboss.ejb.Interceptor
Returns:
Throws:
Exception -

setContainer

public void setContainer(org.jboss.ejb.Container container)
Specified by:
setContainer in interface org.jboss.ejb.ContainerPlugin

getContainer

public org.jboss.ejb.Container getContainer()

createBeanClassInstance

public Object createBeanClassInstance()
                               throws Exception
Returns a new instance of the bean class or a subclass of the bean class.

Specified by:
createBeanClassInstance in interface org.jboss.ejb.EntityPersistenceManager
Returns:
the new instance
Throws:
Exception

createEntity

public void createEntity(Method m,
                         Object[] args,
                         org.jboss.ejb.EntityEnterpriseContext instance)
                  throws Exception
This method is called whenever an entity is to be created. The persistence manager is responsible for calling the ejbCreate methods on the instance and to handle the results properly wrt the persistent store.

Specified by:
createEntity in interface org.jboss.ejb.EntityPersistenceManager
Parameters:
m - the create method in the home interface that was called
args - any create parameters
instance - the instance being used for this create call
Throws:
Exception

postCreateEntity

public void postCreateEntity(Method m,
                             Object[] args,
                             org.jboss.ejb.EntityEnterpriseContext instance)
                      throws Exception
Specified by:
postCreateEntity in interface org.jboss.ejb.EntityPersistenceManager
Throws:
Exception

findEntity

public Object findEntity(Method finderMethod,
                         Object[] args,
                         org.jboss.ejb.EntityEnterpriseContext instance,
                         org.jboss.ejb.GenericEntityObjectFactory factory)
                  throws Exception
This method is called when single entities are to be found. The persistence manager must find out whether the wanted instance is available in the persistence store, and if so it shall use the ContainerInvoker plugin to create an EJBObject to the instance, which is to be returned as result.

Specified by:
findEntity in interface org.jboss.ejb.EntityPersistenceManager
Parameters:
finderMethod - the find method in the home interface that was called
args - any finder parameters
instance - the instance to use for the finder call
Returns:
an EJBObject representing the found entity
Throws:
Exception

findEntities

public Collection findEntities(Method finderMethod,
                               Object[] args,
                               org.jboss.ejb.EntityEnterpriseContext instance,
                               org.jboss.ejb.GenericEntityObjectFactory factory)
                        throws Exception
This method is called when collections of entities are to be found. The persistence manager must find out whether the wanted instances are available in the persistence store, and if so it shall use the ContainerInvoker plugin to create EJBObjects to the instances, which are to be returned as result.

Specified by:
findEntities in interface org.jboss.ejb.EntityPersistenceManager
Parameters:
finderMethod - the find method in the home interface that was called
args - any finder parameters
instance - the instance to use for the finder call
Returns:
an EJBObject collection representing the found entities
Throws:
Exception

activateEntity

public void activateEntity(org.jboss.ejb.EntityEnterpriseContext instance)
                    throws RemoteException
This method is called when an entity shall be activated. The persistence manager must call the ejbActivate method on the instance.

Specified by:
activateEntity in interface org.jboss.ejb.EntityPersistenceManager
Parameters:
instance - the instance to use for the activation
Throws:
RemoteException - thrown if some system exception occurs

loadEntity

public void loadEntity(org.jboss.ejb.EntityEnterpriseContext instance)
                throws RemoteException
This method is called whenever an entity shall be load from the underlying storage. The persistence manager must load the state from the underlying storage and then call ejbLoad on the supplied instance.

Specified by:
loadEntity in interface org.jboss.ejb.EntityPersistenceManager
Parameters:
instance - the instance to synchronize
Throws:
RemoteException - thrown if some system exception occurs

isStoreRequired

public boolean isStoreRequired(org.jboss.ejb.EntityEnterpriseContext instance)
                        throws Exception
This method is used to determine if an entity should be stored.

Specified by:
isStoreRequired in interface org.jboss.ejb.EntityPersistenceManager
Parameters:
instance - the instance to check
Returns:
true, if the entity has been modified
Throws:
Exception - thrown if some system exception occurs

isModified

public boolean isModified(org.jboss.ejb.EntityEnterpriseContext ctx)
                   throws Exception
Specified by:
isModified in interface org.jboss.ejb.EntityPersistenceManager
Throws:
Exception

storeEntity

public void storeEntity(org.jboss.ejb.EntityEnterpriseContext ctx)
                 throws RemoteException
This method is called whenever an entity shall be stored to the underlying storage. The persistence manager must call ejbStore on the supplied instance and then store the state to the underlying storage.

Specified by:
storeEntity in interface org.jboss.ejb.EntityPersistenceManager
Throws:
RemoteException - thrown if some system exception occurs

invokeEjbStore

public void invokeEjbStore(org.jboss.ejb.EntityEnterpriseContext ctx)
                    throws RemoteException
Specified by:
invokeEjbStore in interface org.jboss.ejb.EntityPersistenceManager
Throws:
RemoteException

passivateEntity

public void passivateEntity(org.jboss.ejb.EntityEnterpriseContext instance)
                     throws RemoteException
This method is called when an entity shall be passivate. The persistence manager must call the ejbPassivate method on the instance.

Specified by:
passivateEntity in interface org.jboss.ejb.EntityPersistenceManager
Parameters:
instance - the instance to passivate
Throws:
RemoteException - thrown if some system exception occurs

removeEntity

public void removeEntity(org.jboss.ejb.EntityEnterpriseContext instance)
                  throws RemoteException,
                         javax.ejb.RemoveException
This method is called when an entity shall be removed from the underlying storage. The persistence manager must call ejbRemove on the instance and then remove its state from the underlying storage.

Specified by:
removeEntity in interface org.jboss.ejb.EntityPersistenceManager
Parameters:
instance - the instance to remove
Throws:
RemoteException - thrown if some system exception occurs
javax.ejb.RemoveException - thrown if the instance could not be removed


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