T
- type of object being pooledpublic abstract class AbstractPool<T> extends Object
Modifier and Type | Field and Description |
---|---|
private Activator<T> |
activator
For activating pooled objects.
|
protected Logger |
logger
Logger for this class.
|
private String |
name
Pool name.
|
private Passivator<T> |
passivator
For passivating pooled objects.
|
private PoolConfig |
poolConfig
Pool config.
|
private PruneStrategy |
pruneStrategy
For removing pooled objects.
|
private Validator<T> |
validator
For validating pooled objects.
|
Constructor and Description |
---|
AbstractPool() |
Modifier and Type | Method and Description |
---|---|
boolean |
activate(T t)
Prepare the object to exit the pool for use.
|
Activator<T> |
getActivator()
Returns the activator for this pool.
|
String |
getName()
Returns the name for this pool.
|
Passivator<T> |
getPassivator()
Returns the passivator for this pool.
|
PoolConfig |
getPoolConfig()
Returns the configuration for this pool.
|
PruneStrategy |
getPruneStrategy()
Returns the prune strategy for this pool.
|
Validator<T> |
getValidator()
Returns the validator for this pool.
|
boolean |
passivate(T t)
Prepare the object to enter the pool after use.
|
void |
setActivator(Activator<T> a)
Sets the activator for this pool.
|
void |
setName(String s)
Sets the name for this pool.
|
void |
setPassivator(Passivator<T> p)
Sets the passivator for this pool.
|
void |
setPoolConfig(PoolConfig pc)
Sets the configuration for this pool.
|
void |
setPruneStrategy(PruneStrategy ps)
Sets the prune strategy for this pool.
|
void |
setValidator(Validator<T> v)
Sets the validator for this pool.
|
boolean |
validate(T t)
Verify the object is still viable for use in the pool.
|
protected final Logger logger
private String name
private PoolConfig poolConfig
private Passivator<T> passivator
private PruneStrategy pruneStrategy
public String getName()
public void setName(String s)
s
- pool namepublic PoolConfig getPoolConfig()
public void setPoolConfig(PoolConfig pc)
pc
- pool configpublic Activator<T> getActivator()
public void setActivator(Activator<T> a)
a
- activatorpublic boolean activate(T t)
t
- pooled objectpublic Passivator<T> getPassivator()
public void setPassivator(Passivator<T> p)
p
- passivatorpublic boolean passivate(T t)
t
- pooled objectpublic Validator<T> getValidator()
public void setValidator(Validator<T> v)
v
- validatorpublic boolean validate(T t)
t
- pooled objectpublic PruneStrategy getPruneStrategy()
public void setPruneStrategy(PruneStrategy ps)
ps
- prune strategyCopyright © 2003-2019 Virginia Tech. All Rights Reserved.