Rule Execution Server API

ilog.rules.res.xu.pool
Interface IlrPool<T>


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:

An object is removed from the pool:

Implementations of this interface must be thread-safe.

After the instance is created, setLogger(java.util.logging.Logger) then initialize(Map) is called.

Since:
7.0

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

initialize

void initialize(Map<String,String> properties)
Initializes this pool with a given set of properties.

Parameters:
properties - A set of configuration properties.

add

void add(T object)
Adds a free object to this pool.

Parameters:
object - A free object.

remove

boolean remove(T object)
Removes an object from this pool. This object should not be returned when you call getFreeObjects().

Parameters:
object - The object to remove.

getFreeObjects

Set<T> getFreeObjects()
Returns all the free objects in this pool.

Returns:
The free objects in this pool.

use

void use(T object)
Notifies the pool that an object is used.

Parameters:
object - The object used.

release

void release(T object)
Notifies the pool that an object is no longer used.

Parameters:
object - The object to release.

isFull

boolean isFull()
Checks if the pool is full. If the pool is full no more objects can be added.

Returns:
If the pool is full, true is returned.

waitNotFull

void waitNotFull()
                 throws IlrPoolException,
                        UnsupportedOperationException
Waits until the pool is not full.

Throws:
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.

setLogger

void setLogger(Logger logger)
Sets the logger to be used by the pool implementation.

Parameters:
logger - The logger to be used by the pool implementation.

addPoolEventListener

void addPoolEventListener(IlrPoolListener<T> listener)
Adds a listener. This listener is used by the XU to receive notification when objects are removed from the pool.

Parameters:
listener - A pool event listener.

removePoolEventListener

void removePoolEventListener(IlrPoolListener<T> listener)
Removes a listener.

Since:
7.0
Parameters:
listener - The pool event listener to remove.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013