|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.barracuda.core.event.DefaultEventPool
This class acts as a pool for Events. Should significantly improve performance by allowing us to reuse event objects.
Field Summary | |
protected long |
cleanupInterval
|
protected java.util.Map |
eventMap
|
protected long |
lastCleanup
|
protected long |
lastUpdate
|
protected static org.apache.log4j.Logger |
logger
|
protected int |
maxRetries
|
protected int |
poolSize
|
protected long |
retryInterval
|
protected java.lang.Object |
sync
|
protected long |
timeout
|
Constructor Summary | |
DefaultEventPool()
Default constructor. |
|
DefaultEventPool(int ipoolSize,
long itimeout,
long iretryInterval,
int imaxRetries,
long icleanupInterval)
Public constructor. |
Method Summary | |
BaseEvent |
checkoutEvent(java.lang.Class event)
check out an event from the EventPool. |
void |
cleanupLockedEvents()
Cleanup any locked events which weren't released (they should all be). |
void |
releaseEvent(BaseEvent event)
check the event back in, allowing someone else to have access to it. |
void |
shutdown()
Shutdown the event pool |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.log4j.Logger logger
protected java.util.Map eventMap
protected int poolSize
protected long timeout
protected long retryInterval
protected int maxRetries
protected long cleanupInterval
protected long lastUpdate
protected long lastCleanup
protected java.lang.Object sync
Constructor Detail |
public DefaultEventPool()
public DefaultEventPool(int ipoolSize, long itimeout, long iretryInterval, int imaxRetries, long icleanupInterval)
Method Detail |
public BaseEvent checkoutEvent(java.lang.Class event) throws NoAvailableEventsException, InvalidClassException
checkoutEvent
in interface EventPool
event
- the class of event we are interested in checking out
NoAvailableEventsException
- if there are no available events in the queue
InvalidClassException
- if the event class is not validpublic void releaseEvent(BaseEvent event)
releaseEvent
in interface EventPool
event
- the event we're releasing our lock onpublic void cleanupLockedEvents()
cleanupLockedEvents
in interface EventPool
public void shutdown()
shutdown
in interface EventPool
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |