com.resilientedge.util.workerPool
Class WorkerPoolEvent
java.lang.Object
|
+--java.util.EventObject
|
+--com.resilientedge.util.workerPool.WorkerPoolEvent
- All Implemented Interfaces:
- java.io.Serializable
- public class WorkerPoolEvent
- extends java.util.EventObject
WorkerPool event. These events are generated for a listener on a thread
(worker) pool.
- Author:
- jgardner
- See Also:
- Serialized Form
Fields inherited from class java.util.EventObject |
source |
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ADD_EVENT
public static final int ADD_EVENT
- thread added to pool
REMOVE_EVENT
public static final int REMOVE_EVENT
- thread removed from pool
WORK_COMPLETED_EVENT
public static final int WORK_COMPLETED_EVENT
- a thread completed work
WorkerPoolEvent
public WorkerPoolEvent(WorkerPool source,
int id,
int curr,
int min,
int max)
- Constructor.
- Parameters:
source
- the thread pool where the event originatedid
- the event idcurr
- the current number of pool entriesmin
- the minimum number of pool entriesmax
- the maximum number of pool entries, if less than minimum,
minimum is used
WorkerPoolEvent
public WorkerPoolEvent(WorkerPool source,
int id,
int curr,
int min,
int max,
java.lang.Object obj)
- Constructor.
- Parameters:
source
- the worker (thread) pool where the event originatedid
- the event idcurr
- the current number of pool entriesmin
- the minimum number of pool entriesmax
- the maximum number of pool entries, if less than minimum,
minimum is usedobj
- an optional object whose meaning is event dependent
getEventSource
public WorkerPool getEventSource()
- Returns:
- the worker (thread) pool that generated the event
getEventId
public int getEventId()
- Returns:
- the event identifier
getCurrentSize
public int getCurrentSize()
- Returns:
- the current pool size when the event was generated
getMinSize
public int getMinSize()
- Returns:
- the minimum pool size when the event was generated
getMaxSize
public int getMaxSize()
- Returns:
- the maximum pool size when the event was generated
getWorkResult
public java.lang.Object getWorkResult()
- If this is a work completion event, the work result is the object that
was returned when a request completed on a worker in the pool.
- Returns:
- the object that was generated by the completion of a request,
may be null
toString
public java.lang.String toString()
- Overrides:
toString
in class java.util.EventObject
- Returns:
- the event identifier
Copyright © 2001 Resilient Edge, Inc. All Rights Reserved.