jrun.ejb
Class SimpleInstancePool

jrunx.kernel.ServiceAdapter
  |
  +--jrun.ejb.SimpleInstancePool
All Implemented Interfaces:
InstancePool, javax.naming.Referenceable, java.io.Serializable, Service, ServiceMBean
Direct Known Subclasses:
EntityInstancePool

public class SimpleInstancePool
extends ServiceAdapter
implements InstancePool

This is a simple implementation of the InstancePool interface based on Sean's original InstancePool class. A super-basic implementation of a Class instance pool. Possibly use the generic pooling library for this in the future, but even if not add configurable elements like max size, min size, etc.

Author:
Sean Neville, Paul Reilly
See Also:
Serialized Form

Fields inherited from class jrunx.kernel.ServiceAdapter
DEFAULT_DEACTIVATED, DEFAULT_DOMAIN, DOMAIN_NAME_SEPARATOR, DOMAIN_NAME_SUFFIX, domainName, jndiBindable, LOGGER_CACHE_TIME, SCHEDULER_SERVICE, SECURITY_MANAGER, server, status, TRANSACTION_MANAGER
 
Fields inherited from interface jrunx.kernel.Service
INITIALIZED, STARTED, STARTING, STOPPED, STOPPING, UNINITIALIZED
 
Constructor Summary
SimpleInstancePool()
           
 
Method Summary
 void discard(Instance instance)
           
 Instance get()
           
 int getMaxSize()
           
 int getMinSize()
           
 void pool(Instance instance)
           
 void setMaxSize(int maxSize)
           
 void setMinSize(int minSize)
           
 
Methods inherited from class jrunx.kernel.ServiceAdapter
bind, destroy, findObjectInstance, findObjectInstance, findObjectInstance, getBindToJNDI, getDeactivated, getDomainName, getDomainSearchPath, getJRunService, getLogger, getName, getParentService, getReference, getResourceManager, getServerName, getServerProperties, getStatus, init, invokeMethod, isInPartition, isPartition, lookup, postDeregister, postRegister, preDeregister, preRegister, requestServer, scheduleRunnable, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, start, stop, toString, unbind, unscheduleRunnable, updateStatus
 

Constructor Detail

SimpleInstancePool

public SimpleInstancePool()
Method Detail

getMaxSize

public int getMaxSize()
Specified by:
getMaxSize in interface InstancePool
Following copied from interface: jrun.ejb.InstancePool
Returns:
max size for this pool

getMinSize

public int getMinSize()
Specified by:
getMinSize in interface InstancePool
Following copied from interface: jrun.ejb.InstancePool
Returns:
min size for this pool

setMaxSize

public void setMaxSize(int maxSize)
Specified by:
setMaxSize in interface InstancePool
Following copied from interface: jrun.ejb.InstancePool
Parameters:
max - size for this pool

setMinSize

public void setMinSize(int minSize)
Specified by:
setMinSize in interface InstancePool
Following copied from interface: jrun.ejb.InstancePool
Parameters:
min - size for this pool

get

public Instance get()
Specified by:
get in interface InstancePool
Following copied from interface: jrun.ejb.InstancePool
Returns:
a pooled instance.

pool

public void pool(Instance instance)
Specified by:
pool in interface InstancePool
Following copied from interface: jrun.ejb.InstancePool
Parameters:
instance - the instance object to be pooled.

discard

public void discard(Instance instance)
             throws java.util.NoSuchElementException
Specified by:
discard in interface InstancePool
Following copied from interface: jrun.ejb.InstancePool
Parameters:
instance - the instance object to be discarded from the pool.


Copyright � 2002 Macromedia Corporation. All Rights Reserved.