org.jboss.ejb.plugins
Class AbstractInstancePool

java.lang.Object
  |
  +--org.jboss.ejb.plugins.AbstractInstancePool
All Implemented Interfaces:
ContainerPlugin, InstancePool, Service, XmlLoadable
Direct Known Subclasses:
EntityInstancePool, MessageDrivenInstancePool, StatefulSessionInstancePool, StatelessSessionInstancePool

public abstract class AbstractInstancePool
extends java.lang.Object
implements InstancePool, XmlLoadable

Version:
$Revision: 1.9 $
Author:
Rickard Öberg (rickard.oberg@telkel.com)
See Also:

Constructor Summary
AbstractInstancePool()
           
 
Method Summary
protected abstract  EnterpriseContext create(java.lang.Object instance)
           
 void destroy()
           
 void discard(EnterpriseContext ctx)
          Discard an anonymous instance after invocation.
 void free(EnterpriseContext ctx)
          Return an instance after invocation.
 EnterpriseContext get()
          Get an instance without identity.
 Container getContainer()
           
 void importXml(org.w3c.dom.Element element)
           
 void init()
           
 void setContainer(Container c)
          Set the callback to the container.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractInstancePool

public AbstractInstancePool()
Method Detail

setContainer

public void setContainer(Container c)
Set the callback to the container. This is for initialization. The IM may extract the configuration from the container.
Specified by:
setContainer in interface ContainerPlugin
Parameters:
c -  

getContainer

public Container getContainer()

init

public void init()
          throws java.lang.Exception
Specified by:
init in interface Service

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Service

stop

public void stop()
Specified by:
stop in interface Service

destroy

public void destroy()
Specified by:
destroy in interface Service

get

public EnterpriseContext get()
                      throws java.lang.Exception
Get an instance without identity. Can be used by finders,create-methods, and activation
Specified by:
get in interface InstancePool
Returns:
Context /w instance
Throws:
java.rmi.RemoteException -  

free

public void free(EnterpriseContext ctx)
Return an instance after invocation. Called in 2 cases: a) Done with finder method b) Just removed
Specified by:
free in interface InstancePool
Parameters:
ctx -  

discard

public void discard(EnterpriseContext ctx)
Description copied from interface: InstancePool
Discard an anonymous instance after invocation. This is called if the instance should not be reused, perhaps due to some exception being thrown from it.
Specified by:
discard in interface InstancePool
Following copied from interface: org.jboss.ejb.InstancePool
Parameters:
ctx -  

importXml

public void importXml(org.w3c.dom.Element element)
               throws DeploymentException
Specified by:
importXml in interface XmlLoadable

create

protected abstract EnterpriseContext create(java.lang.Object instance)
                                     throws java.lang.Exception


Copyright © 2000 The JBoss Organization. All Rights Reserved.