org.jboss.ejb.plugins
Class SingletonStatelessSessionInstancePool

java.lang.Object
  |
  +--org.jboss.ejb.plugins.SingletonStatelessSessionInstancePool
All Implemented Interfaces:
ContainerPlugin, InstancePool, Service, XmlLoadable

public class SingletonStatelessSessionInstancePool
extends java.lang.Object
implements InstancePool, XmlLoadable

Singleton pool for session beans. This lets you have singletons in EJB!

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

Constructor Summary
SingletonStatelessSessionInstancePool()
           
 
Method Summary
protected  EnterpriseContext create(java.lang.Object instance, Container con)
           
 void destroy()
           
 void discard(EnterpriseContext ctx)
          Discard an anonymous instance after invocation.
 void free(EnterpriseContext ctx)
          Return an instance after invocation.
 EnterpriseContext get()
          Get the singleton instance
 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

SingletonStatelessSessionInstancePool

public SingletonStatelessSessionInstancePool()
Method Detail

setContainer

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

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 the singleton instance
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 EnterpriseContext create(java.lang.Object instance,
                                   Container con)
                            throws java.lang.Exception


Copyright © 2000 The JBoss Organization. All Rights Reserved.