|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectguarana.util.observer.smart.SmartObservable
guarana.framework.task.Task
public abstract class Task
A generic implementation of task in Guaranį DSL.
Field Summary | |
---|---|
Gateway[] |
input
Stores all input gateways of this task. |
Gateway[] |
output
Stores all output gateways of this task. |
Constructor Summary | |
---|---|
Task(String name)
Constructs a new task with the specified name. |
|
Task(String name,
int numberOfInputs,
int numberOfOutputs)
Creates a task with the specified name and number of input and output gateways. |
Method Summary | |
---|---|
void |
doWork(Exchange exchange)
This method implements the business logic of this task. |
void |
execute()
This method executes the business logic of this task. |
String |
getName()
Returns the name of this source. |
long |
getTriggerInterval()
Returns the trigger interval for this task. |
boolean |
isTriggerTask()
Checks if this task is a trigger task. |
void |
setName(String name)
Sets the name of this source. |
void |
setTriggerInterval(long triggerInterval)
Sets a trigger interval to this task. |
void |
update(guarana.util.observer.smart.SmartObservable slot,
Object arg)
This method is automatically called by the observable slot to notify the slot has received a message. |
Methods inherited from class guarana.util.observer.smart.SmartObservable |
---|
addSmartObserver, containsSmartObserver, containsSmartObserver, countSmartObservers, deleteSmartObserver, deleteSmartObservers, hasChanged, notifySmartObservers, notifySmartObservers |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Gateway[] input
public Gateway[] output
Constructor Detail |
---|
public Task(String name)
name
- The name of the task.public Task(String name, int numberOfInputs, int numberOfOutputs)
name
- The name of this task.numberOfInputs
- The number of input gateways this task must have.numberOfOutputs
- The number of output gateways this task must have.Method Detail |
---|
public void execute() throws TaskExecutionException
TaskExecutionException
- to report any exception that has occurred during the execution of this method.TaskExecutionException
public void doWork(Exchange exchange) throws TaskExecutionException
exchange
- An exchange object that holds the inbound messages of this task.
TaskExecutionException
- to report any exception that has occurred during the execution of this method.public boolean isTriggerTask()
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 void setTriggerInterval(long triggerInterval)
triggerInterval
- The interval in milliseconds that this task must be executed.public long getTriggerInterval()
public void update(guarana.util.observer.smart.SmartObservable slot, Object arg)
update
in interface guarana.util.observer.smart.ISmartObserver
slot
- The Slot
associated with this task.arg
- THIS PARAMETHER IS NOT USED.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |