Package org.jppf.client.event
Class ClientQueueEvent
java.lang.Object
java.util.EventObject
org.jppf.client.event.ClientQueueEvent
- All Implemented Interfaces:
Serializable
Instances of this class represent events emitted by the JPPF client job queue whenever a job is added to or removed from the queue.
- Since:
- 4.1
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionClientQueueEvent(JPPFClient client, JPPFJob job, JPPFPriorityQueue queue) Initialize this event with the specified source JPPF client and Job. -
Method Summary
Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
ClientQueueEvent
Initialize this event with the specified source JPPF client and Job.- Parameters:
client- the client whose queue emitted the event.job- the job this event is for.queue- the job queue which emitted this event.
-
-
Method Details
-
getClient
Get the JPPF client source of this event.- Returns:
- a
JPPFClientinstance.
-
getJob
Get the job that was added or removed.- Returns:
- a
JPPFJobinstance.
-
getQueuedJobs
Get all theJPPFJobs currently in the queue.This method should be used with caution, as its cost is in O(n), with n being the number of jobs in the queue.
- Returns:
- a list of
JPPFJobinstances ordered by their priority.
-
getQueueSize
public int getQueueSize()Get the size of this job queue.This method should be used with caution, as its cost is in O(n), with n being the number of jobs in the queue.
- Returns:
- the number of jobs currently in the queue.
-