de.phleisch.app.itsucks.core
Interface Dispatcher

All Known Implementing Classes:
DispatcherImpl, DispatcherThread

public interface Dispatcher


Method Summary
 void addJob(Job pJob)
          Adds an single job to the dispatcher.
 void addJobFilter(JobFilter pJobFilter)
          Adds an additional job filter.
 void addJobFilter(java.util.List<JobFilter> pJobFilter)
          Adds an list of job filter.
 EventContext getContext()
          Returns the context for this dispatcher and all included jobs.
 int getDispatchDelay()
          Gets the waiting time between starting two jobs.
 EventDispatcher getEventManager()
          Returns the event manager instance.
 JobManager getJobManager()
          Returns the job manager instance.
 java.lang.String getName()
           
 WorkerPool getWorkerPool()
          Returns the worker pool instance.
 boolean isPaused()
           
 boolean isRunning()
           
 void pause()
          Pause assigning new jobs to working threads.
 void processJobs()
          Start processing the jobs in the job list and delegate it to free worker threads.
 void setDispatchDelay(int pDispatchDelay)
          Sets the waiting time between starting two jobs.
 void setName(java.lang.String pName)
          Sets a name for the dispatcher.
 void stop()
          Set the flag to stop the dispatcher
 void unpause()
          Resume assigning new jobs to working threads.
 

Method Detail

setName

void setName(java.lang.String pName)
Sets a name for the dispatcher.

Parameters:
pName -

getName

java.lang.String getName()
Returns:
The name of the dispatcher.

processJobs

void processJobs()
Start processing the jobs in the job list and delegate it to free worker threads. Returns when all jobs are done.

Throws:
java.lang.Exception

isRunning

boolean isRunning()
Returns:
true when the dispatcher is running.

stop

void stop()
Set the flag to stop the dispatcher


pause

void pause()
Pause assigning new jobs to working threads.


unpause

void unpause()
Resume assigning new jobs to working threads.


isPaused

boolean isPaused()
Returns:
true when the dispatcher is in paused.

getJobManager

JobManager getJobManager()
Returns the job manager instance.

Returns:

getWorkerPool

WorkerPool getWorkerPool()
Returns the worker pool instance.

Returns:

getEventManager

EventDispatcher getEventManager()
Returns the event manager instance.

Returns:

getContext

EventContext getContext()
Returns the context for this dispatcher and all included jobs.

Returns:

getDispatchDelay

int getDispatchDelay()
Gets the waiting time between starting two jobs.

Parameters:
pDispatchDelay -

setDispatchDelay

void setDispatchDelay(int pDispatchDelay)
Sets the waiting time between starting two jobs.

Parameters:
pDispatchDelay -

addJob

void addJob(Job pJob)
Adds an single job to the dispatcher. The job must be in state STATE_OPEN.

Parameters:
pJob -

addJobFilter

void addJobFilter(JobFilter pJobFilter)
Adds an additional job filter.

Parameters:
pJobFilter -

addJobFilter

void addJobFilter(java.util.List<JobFilter> pJobFilter)
Adds an list of job filter.

Parameters:
pJobFilter -


Copyright © 2010. All Rights Reserved.