P
- the type of ResourcePool
implemented by the subclassT
- the type of ResourceType
related to the resource poolpublic abstract class AbstractResourcePool<P extends ResourcePool,T extends ResourceType<P>> extends java.lang.Object implements ResourcePool
ResourcePool
implementations.Modifier | Constructor and Description |
---|---|
protected |
AbstractResourcePool(T type,
boolean persistent)
Creates a
AbstractResourcePool instance. |
Modifier and Type | Method and Description |
---|---|
T |
getType()
Get the
ResourceType . |
boolean |
isPersistent()
Indicates whether the underlying resource is persistent.
|
void |
validateUpdate(ResourcePool newPool)
|
protected AbstractResourcePool(T type, boolean persistent)
AbstractResourcePool
instance.type
- the non-null
ResourceType
persistent
- whether or not this ResourcePool
is persistentpublic T getType()
ResourceType
.getType
in interface ResourcePool
public boolean isPersistent()
Persistence in this context means that data stored will survive a JVM restart, unless destroyed.
isPersistent
in interface ResourcePool
true
if persistent, false
otherwisepublic void validateUpdate(ResourcePool newPool)
validateUpdate
in interface ResourcePool
newPool
- the pool which is the candidate for replacing this ResourcePool
java.lang.IllegalArgumentException
- if newPool
is not a valid replacement for this ResourcePool