|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.pool.DefaultPool
public class DefaultPool
A default implementation of Pool.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.pool.Pool |
|---|
DEFAULT_POOL_CAPACITY |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultPool()
Constructs a Pool Service. |
|
| Method Summary | |
|---|---|
void |
clearPool()
Clears all instances from the pool. |
void |
clearPool(String className)
Clears instances of a named class from the pool. |
int |
getCapacity()
Gets the default capacity of the pool. |
int |
getCapacity(String className)
Gets the capacity of the pool for a named class. |
ObjectName |
getFactoryName()
Gets the factory of this pool. |
Object |
getInstance(Class clazz)
Gets an instance of a specified class either from the pool or by instatiating from the class if the pool is empty. |
Object |
getInstance(Class clazz,
Object[] params,
String[] signature)
Gets an instance of a specified class either from the pool or by instatiating from the class if the pool is empty. |
Object |
getInstance(String className)
Gets an instance of a named class. |
Object |
getInstance(String className,
Object[] params,
String[] signature)
Gets an instance of a named class. |
Object |
getInstance(String className,
ObjectName loader)
Gets an instance of a named class using a specified class loader. |
Object |
getInstance(String className,
ObjectName loader,
Object[] params,
String[] signature)
Gets an instance of a named class using a specified class loader. |
protected static Class |
getPrimitiveClass(String type)
Gets the class of a primitive type. |
int |
getSize(String className)
Gets the current size of the pool for a named class. |
boolean |
isLoaderSupported(String className)
Checks if specified class loaders are supported for a named class. |
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
boolean |
putInstance(Object object)
Puts a used object back to the pool. |
void |
setCapacity(int capacity)
Sets the default capacity of the pool. |
void |
setCapacity(String className,
int capacity)
Sets the capacity of the pool for a named class. |
void |
setFactoryName(ObjectName executor)
Sets the factory of this pool. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultPool()
| Method Detail |
|---|
protected static Class getPrimitiveClass(String type)
type - a primitive type.
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class Adaptee
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.
public Object getInstance(String className)
throws ConstructionException
ObjectFactory
getInstance in interface ObjectFactoryclassName - the name of the class.
ConstructionException - if construction fails.
public Object getInstance(String className,
ObjectName loader)
throws ConstructionException
ObjectFactoryClass loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
getInstance in interface ObjectFactoryclassName - the name of the class.loader - the class loader.
ConstructionException - if construction fails.
public Object getInstance(String className,
Object[] params,
String[] signature)
throws ConstructionException
ObjectFactory
getInstance in interface ObjectFactoryclassName - the name of the class.params - an array containing the parameters of the constructor.signature - an array containing the signature of the constructor.
ConstructionException - if construction fails.
public Object getInstance(String className,
ObjectName loader,
Object[] params,
String[] signature)
throws ConstructionException
ObjectFactoryClass loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
getInstance in interface ObjectFactoryclassName - the name of the class.loader - the class loader.params - an array containing the parameters of the constructor.signature - an array containing the signature of the constructor.
ConstructionException - if construction fails.public boolean isLoaderSupported(String className)
ObjectFactory
isLoaderSupported in interface ObjectFactoryclassName - the name of the class.
public Object getInstance(Class clazz)
throws ConstructionException
Pool
getInstance in interface Poolclazz - the class.
ConstructionException - if recycling fails.
public Object getInstance(Class clazz,
Object[] params,
String[] signature)
throws ConstructionException
Pool
getInstance in interface Poolclazz - the class.params - an array containing the parameters of the constructor.signature - an array containing the signature of the constructor.
ConstructionException - if recycling fails.public boolean putInstance(Object object)
Pool
putInstance in interface Poolobject - the object instance to recycle.
public int getCapacity()
Pool
getCapacity in interface Poolpublic void setCapacity(int capacity)
Pool
setCapacity in interface Poolcapacity - the new capacity.public int getCapacity(String className)
Pool
getCapacity in interface PoolclassName - the name of the class.
public void setCapacity(String className,
int capacity)
Pool
setCapacity in interface PoolclassName - the name of the class.capacity - the new capacity.public int getSize(String className)
Pool
getSize in interface PoolclassName - the name of the class.
public void clearPool(String className)
Pool
clearPool in interface PoolclassName - the name of the class.public void clearPool()
Pool
clearPool in interface Poolpublic ObjectName getFactoryName()
Pool
getFactoryName in interface Poolpublic void setFactoryName(ObjectName executor)
Pool
setFactoryName in interface Poolexecutor - the object name of the factory or a query.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||