|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IlrPool<T>
IlrPool
represents a pool of objects.
Use implementations of this interface to pool resource adapter (JCA) connections.
The properties of a pool implementation are specified in
ra.xml
.
An pool object can have the following states:
used
- the object has been added by calling add(T)
and must not be returned by getFreeObjects()
until release(T)
is called.free
- the object can be returned by calling
getFreeObjects()
.An object is removed from the pool:
remove(T)
is called.IlrPoolListeners
must be notified.Implementations of this interface must be thread-safe.
After the instance is created, setLogger(java.util.logging.Logger)
then
initialize(Map)
is called.
Method Summary | |
---|---|
void |
add(T object)
Adds a free object to this pool. |
void |
addPoolEventListener(IlrPoolListener<T> listener)
Adds a listener. |
Set<T> |
getFreeObjects()
Returns all the free objects in this pool. |
void |
initialize(Map<String,String> properties)
Initializes this pool with a given set of properties. |
boolean |
isFull()
Checks if the pool is full. |
void |
release(T object)
Notifies the pool that an object is no longer used. |
boolean |
remove(T object)
Removes an object from this pool. |
void |
removePoolEventListener(IlrPoolListener<T> listener)
Removes a listener. |
void |
setLogger(Logger logger)
Sets the logger to be used by the pool implementation. |
void |
use(T object)
Notifies the pool that an object is used. |
void |
waitNotFull()
Waits until the pool is not full. |
Method Detail |
---|
void initialize(Map<String,String> properties)
properties
- A set of configuration properties.void add(T object)
object
- A free object.boolean remove(T object)
getFreeObjects()
.
object
- The object to remove.Set<T> getFreeObjects()
void use(T object)
object
- The object used.void release(T object)
object
- The object to release.boolean isFull()
true
is returned.void waitNotFull() throws IlrPoolException, UnsupportedOperationException
IlrPoolException
- indicates that it is not
possible to wait. The reason depends on the pool implementation.
For example, the maximum number of waiters or the timeout has been
reached.
UnsupportedOperationException
- indicates
that this method is not supported by the implementation.void setLogger(Logger logger)
logger
- The logger to be used by the pool implementation.void addPoolEventListener(IlrPoolListener<T> listener)
listener
- A pool event listener.void removePoolEventListener(IlrPoolListener<T> listener)
listener
- The pool event listener to remove.
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |