Interface Job

  • All Known Implementing Classes:
    BackupJob, DeleteDurableJob, MessageSenderJob, MultiQueuePurgerJob, QueueCleanupDLQJob, QueueCleanupJob, QueueMoverJob, QueuePurgerJob, QueueResetJob, RoutingConnectorJob, ShrinkJob, StreamsJob

    public interface Job
    A Job is created from a JobFactory and performs a task.

    After creation and parameter verification, the start method is called. Parameter values are passed as String objects. It will be checked from the Scheduler Swiftlet whether all mandatory parameters have been set before the start method is called. These parameters can also be verified by an optional JobParameterVerifier. In any case, the Properties object passed contains all mandatory parameter values. The second parameter is a JobTerminationListener to be called when the Job terminates.

    A Job should be interruptable, that is, it should terminate if the stop method is called from the Scheduler Swiftlet. This method is called either when the Job reaches its maximum runtime, configured by the user, or when it should terminate for Scheduler internal reasons, e.g. a re-schedule, or during shutdown of the router. The stop method is called asynchronously.

    A Job is marked as running by calling its start method. The start method might block until the Job has been finished or it might return immediately, e.g. if the task is performed by another thread.

    A Job is marked as finished after the JobTerminationListener has been called or after the Scheduler Swiftlet has called the stop method of the Job, respectively. From the perspective of the Job instance that means it has to call the JobTerminationListener after it has finished his work, except the stop method has been called in the meantime.

    A finished Job will be re-scheduled.

    A JobException can be thrown by the start and stop method and it can be passed to the JobTerminationListener. A JobException has an attribute which states whether further schedules are allowed or not. If not, the Job is marked as errorneous and a user intervention is acquired. Otherwise, the Job is re-scheduled.
    IIT GmbH, Bremen/Germany, Copyright (c) 2000-2003, All Rights Reserved
    • Method Detail

      • start

        void start​(java.util.Properties parameters,
                   JobTerminationListener listener)
            throws JobException
        Starts a Job. This method might block until the Job finished or it might return immediately. The Job is marked as running until the Job calls the JobTerminationListener or the Scheduler Swiftlet calles the stop method.
        parameters - parameter values
        listener - JobTerminationListener
        JobException - on error
      • stop

        void stop()
           throws JobException
        Stops a Job asynchronously. The Job is marked as terminated thereafter. This method must not block. The stop method is called when the maximum runtime for the Job is reached or for Scheduler Swiftlet internal reasons, e.g. a re-schedule or a router shutdown.
        JobException - on error