public class ObjectPool extends Object implements Serializable
Constructor and Description |
---|
ObjectPool()
Constructor ObjectPool
|
ObjectPool(Class type)
Constructor ObjectPool
|
ObjectPool(Class type,
int size)
Constructor ObjectPool
|
ObjectPool(String className)
Constructor ObjectPool
|
Modifier and Type | Method and Description |
---|---|
void |
freeInstance(Object obj)
Add an instance of the given object to the pool
|
Object |
getInstance()
Get an instance of the given object in this pool
|
Object |
getInstanceIfFree()
Get an instance of the given object in this pool if available
|
public ObjectPool(Class type)
type
- Type of objects for this poolpublic ObjectPool(String className)
className
- Fully qualified name of the type of objects for this pool.public ObjectPool(Class type, int size)
type
- Type of objects for this poolsize
- Size of vector to allocatepublic ObjectPool()
public Object getInstanceIfFree()
public Object getInstance()
public void freeInstance(Object obj)
obj
- Object to add.Copyright © 2016 JBoss by Red Hat. All rights reserved.