Class ClientQueueEvent

java.lang.Object
java.util.EventObject
org.jppf.client.event.ClientQueueEvent
All Implemented Interfaces:
Serializable

public class ClientQueueEvent extends EventObject
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:
  • Constructor Details

    • ClientQueueEvent

      public ClientQueueEvent(JPPFClient client, JPPFJob job, JPPFPriorityQueue queue)
      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

      public JPPFClient getClient()
      Get the JPPF client source of this event.
      Returns:
      a JPPFClient instance.
    • getJob

      public JPPFJob getJob()
      Get the job that was added or removed.
      Returns:
      a JPPFJob instance.
    • getQueuedJobs

      public List<JPPFJob> getQueuedJobs()
      Get all the JPPFJobs 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 JPPFJob instances 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.