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

AbstractInstancePool (JBoss Server API) - JBoss 3.2.7 server API Documentation 英文版文档


org.jboss.ejb.plugins
Class AbstractInstancePool

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.ejb.plugins.AbstractInstancePool
All Implemented Interfaces:
AbstractInstancePoolMBean, ContainerPlugin, InstancePool, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean, XmlLoadable
Direct Known Subclasses:
EntityInstancePool, MessageDrivenInstancePool, StatefulSessionInstancePool, StatelessSessionInstancePool

public abstract class AbstractInstancePool
extends org.jboss.system.ServiceMBeanSupport
implements AbstractInstancePoolMBean, InstancePool, XmlLoadable

Abstract Instance Pool class containing the basic logic to create an EJB Instance Pool.

Version:
$Revision: 1.28.2.15 $
Author:
Rickard 锟絙erg, Marc Fleury, Andreas Schaefer, Sacha Labourey, Scott Stark/a>

Field Summary
protected  Container container
          The Container the instance pool is associated with
protected  int currentIndex
           
protected  int maxSize
          The maximum number of instances allowed in the pool
protected  int minSize
          The minimum size of the pool
protected  boolean minSizeInitialized
           
protected  int overMax
           
protected  int overMin
           
protected  EnterpriseContext[] pool
          The pool data structure
protected  boolean reclaim
          determine if we reuse EnterpriseContext objects i.e.
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
AbstractInstancePool()
           
 
Method Summary
protected abstract  EnterpriseContext create(Object instance)
           
protected  void destroyService()
           
 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()
           
 int getCurrentSize()
          Return the size of the pool.
 int getMaximumSize()
           
 int getMaxSize()
          Get the maximum size of the pool.
 int getMinimumSize()
           
 boolean getStrictMaximumSize()
           
 long getStrictTimeout()
           
 void importXml(Element element)
          XmlLoadable implementation
 void setContainer(Container c)
          Set the callback to the container.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

container

protected Container container
The Container the instance pool is associated with


pool

protected EnterpriseContext[] pool
The pool data structure


currentIndex

protected int currentIndex

maxSize

protected int maxSize
The maximum number of instances allowed in the pool


minSize

protected int minSize
The minimum size of the pool


reclaim

protected boolean reclaim
determine if we reuse EnterpriseContext objects i.e. if we actually do pooling


overMin

protected volatile int overMin

overMax

protected volatile int overMax

minSizeInitialized

protected boolean minSizeInitialized
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()
Returns:
Callback to the container which can be null if not set proviously

getCurrentSize

public int getCurrentSize()
Description copied from interface: InstancePool
Return the size of the pool.

Specified by:
getCurrentSize in interface AbstractInstancePoolMBean
Returns:
the current pool size

getMaxSize

public int getMaxSize()
Description copied from interface: InstancePool
Get the maximum size of the pool.

Specified by:
getMaxSize in interface AbstractInstancePoolMBean
Returns:
the current pool size

get

public EnterpriseContext get()
                      throws 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:
RemoteException
Exception - 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
Parameters:
ctx - The context to discard.

getMaximumSize

public int getMaximumSize()
Specified by:
getMaximumSize in interface AbstractInstancePoolMBean
Returns:
the maximum size.

getMinimumSize

public int getMinimumSize()
Specified by:
getMinimumSize in interface AbstractInstancePoolMBean
Returns:
the minimum size.

getStrictMaximumSize

public boolean getStrictMaximumSize()
Specified by:
getStrictMaximumSize in interface AbstractInstancePoolMBean
Returns:
whether string pooling.

getStrictTimeout

public long getStrictTimeout()
Specified by:
getStrictTimeout in interface AbstractInstancePoolMBean
Returns:
the strict timeout.

importXml

public void importXml(Element element)
               throws org.jboss.deployment.DeploymentException
XmlLoadable implementation

Specified by:
importXml in interface XmlLoadable
Throws:
org.jboss.deployment.DeploymentException

create

protected abstract EnterpriseContext create(Object instance)
                                     throws Exception
Throws:
Exception

destroyService

protected void destroyService()
                       throws Exception
Throws:
Exception


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