| java.lang.Object java.util.EventObject org.ofbiz.minerva.pool.PoolEvent
PoolEvent | public class PoolEvent extends EventObject (Code) | | An event caused by an object in a pool. The event indicates that the
object was used, closed, or had an error occur. The typical response is
to update the last used time in the pool for used events, and return the
object to the pool for closed or error events.
author: Aaron Mulder (ammulder@alumni.princeton.edu) |
Field Summary | |
final public static int | OBJECT_CLOSED The object has been closed and should be returned to the pool. | final public static int | OBJECT_ERROR Indicates that an error occured with the object. | final public static int | OBJECT_USED Indicates that the object was used, and its timestamp should be updated
accordingly (if the pool tracks timestamps). |
Constructor Summary | |
public | PoolEvent(Object source, int type) Create a new event. |
Method Summary | |
public int | getType() Gets the event type. | public boolean | isCatastrophic() Gets whether an object error was so bad that the object should not
be reused by the pool. | public void | setCatastrophic() Marks this as an error so severe that the object should not be reused by
the pool. |
OBJECT_CLOSED | final public static int OBJECT_CLOSED(Code) | | The object has been closed and should be returned to the pool. Note this
is not a final sort of closing - the object must still be able to be
returned to the pool and reused.
|
OBJECT_ERROR | final public static int OBJECT_ERROR(Code) | | Indicates that an error occured with the object. The object will be
returned to the pool, since there will presumably be an exception
thrown that precludes the client from closing it or returning it
normally. This should not be used for final or destructive errors - the
object must stil be able to be returned to the pool and reused.
|
OBJECT_USED | final public static int OBJECT_USED(Code) | | Indicates that the object was used, and its timestamp should be updated
accordingly (if the pool tracks timestamps).
|
PoolEvent | public PoolEvent(Object source, int type)(Code) | | Create a new event.
Parameters: source - The source must be the object that was returned from thegetObject method of the pool - the pool will use the source forsome purpose depending on the type, so it cannot be an arbitraryobject. Parameters: type - The event type. |
isCatastrophic | public boolean isCatastrophic()(Code) | | Gets whether an object error was so bad that the object should not
be reused by the pool. This is meaningful for error events only.
|
setCatastrophic | public void setCatastrophic()(Code) | | Marks this as an error so severe that the object should not be reused by
the pool.
|
|
|