|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectguarana.toolkit.engine.Scheduler
public class Scheduler
A system agent that can execute tasks that are reported to it. Monitoring log file formats:
Constructor Summary | |
---|---|
Scheduler(String name)
Constructs a new scheduler with the given name and number of workers. |
Method Summary | |
---|---|
Collection<String> |
getListenedContainers()
Returns a unmodifiable collection with the names of all listened task containers to this scheduler. |
String |
getName()
Returns the name of this source. |
int |
getNumberOfWorkers()
Returns the number of current workers defined for this scheduler. |
long |
getNumberOfWorkUnitsProcessed()
Returns the number of Work Units processed. |
String |
getStats()
|
void |
registerProcess(Process process)
Registers a process which will notify this scheduler about tasks ready to be executed. |
void |
setName(String name)
Sets the name of this source. |
void |
start()
Starts ALL workers (threads) to process work units. |
void |
stop()
Stops ALL workers (threads) which are processing work units. |
void |
update(guarana.util.observer.smart.SmartObservable obj,
Object task)
This method is automatically called by the observable task to notify the task is ready to be executed. |
int |
workQueueSize()
Returns the number of elements in the work queue. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Scheduler(String name)
name
- The name of this scheduler.Method Detail |
---|
public void registerProcess(Process process) throws InvalidParameterException
process
- The observable process.
InvalidParameterException
- if the process is null
.public int getNumberOfWorkers()
public int workQueueSize()
public void update(guarana.util.observer.smart.SmartObservable obj, Object task)
update
in interface guarana.util.observer.smart.ISmartObserver
obj
- THIS PARAMETHER IS NOT USED.task
- The Task
which can be executed.public void start()
public void stop()
public String getStats()
public void setName(String name)
setName
in interface ISource
setName
in interface guarana.util.observer.smart.ISmartObserver
name
- The name of this source.public String getName()
getName
in interface ISource
getName
in interface guarana.util.observer.smart.ISmartObserver
public long getNumberOfWorkUnitsProcessed()
public Collection<String> getListenedContainers()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |