|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
zeus.actors.ZeusTask
Tasks are generated in the form of 'stub' files, skeleton implementations
that need to be realised by application specific program code - this code
is linked to the agents through the methods of this interface. This approach
enables new domain-specific functionality to be integrated with the
automated created agent-specific code, without needing to modify the latter. < p>
The class variables include several arrays of Fact
objects, one of which passes information from agent to task, and another which
stores the result of performing the task (which can then be read back by the
agent when the task has completed running.
This is a crucially important class for developers who want to add their own application-specific functionality, and so should be studied carefully. Instructions and an example of how to write a task body are provided in Section 6 of Zeus Application Realisation Guide. TaskExternals have been available since Zeus 1.1 and allow customisation without editing the stubs - which is useful in terms of preserving your edited code in a separate file.
| Field Summary | |
protected AgentContext |
context
|
protected java.lang.String |
desired_by
|
protected Fact[] |
expInputArgs
The information the task expects to receive, (as specified when the task was defined) this can be used to validate the inputArgs |
protected Fact[] |
expOutputArgs
The information the task expects to return, (as specified when the task was defined) this can be used to validate the outputArgs |
protected Fact[][] |
inputArgs
The information passed from the agent to the task, (a 2D array is used to enable multiple fact instances) |
private boolean |
isAborted
|
private boolean |
isFinished
|
private boolean |
isRunning
|
protected java.lang.String[] |
media
|
protected Fact[][] |
outputArgs
The information returned from the task to the agent |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
protected |
ZeusTask()
|
| Method Summary | |
void |
abort()
Call this method in cases where the task terminates abnormally |
protected abstract void |
exec()
This is the interface between the agent and the task; hence the body of the task should implement this method |
java.lang.String |
getDescription()
This is the method called to get the string that describes this task in the service registration The concrete implementation is included to promote the smooth running of legacy agents |
java.lang.String |
getDesiredBy()
|
Fact[] |
getExpectedInputArgs()
|
Fact[] |
getExpectedOutputArgs()
|
Fact[][] |
getInputArgs()
|
java.lang.String |
getInstanceDetails()
Get the instance details from the task. |
Fact[][] |
getOutputArgs()
|
boolean |
isAborted()
|
boolean |
isFinished()
|
boolean |
isRunning()
|
void |
run()
Used internally by the ExecutionMonitor to start the task,
users should not call this themselves |
void |
setContext(AgentContext context)
|
void |
setDesiredBy(java.lang.String desired_by)
|
void |
setExpectedInputArgs(Fact[] f)
|
void |
setExpectedOutputArgs(Fact[] f)
|
void |
setInputArgs(Fact[][] t)
|
void |
setMedia(java.lang.String[] media)
|
void |
setOutputArgs(Fact[] f)
|
void |
setOutputArgs(Fact[][] f)
|
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Fact[][] inputArgs
protected Fact[][] outputArgs
protected Fact[] expInputArgs
protected Fact[] expOutputArgs
protected java.lang.String[] media
private boolean isFinished
private boolean isRunning
private boolean isAborted
protected java.lang.String desired_by
protected AgentContext context
| Constructor Detail |
protected ZeusTask()
| Method Detail |
public void setMedia(java.lang.String[] media)
public void run()
ExecutionMonitor to start the task,
users should not call this themselves
public boolean isRunning()
public boolean isFinished()
public boolean isAborted()
public void abort()
public void setContext(AgentContext context)
public void setInputArgs(Fact[][] t)
public void setExpectedOutputArgs(Fact[] f)
public void setExpectedInputArgs(Fact[] f)
public void setOutputArgs(Fact[] f)
public void setOutputArgs(Fact[][] f)
public Fact[][] getInputArgs()
public Fact[] getExpectedOutputArgs()
public Fact[] getExpectedInputArgs()
public Fact[][] getOutputArgs()
public void setDesiredBy(java.lang.String desired_by)
public java.lang.String getDesiredBy()
protected abstract void exec()
public java.lang.String getDescription()
public java.lang.String getInstanceDetails()
null
if not implemented by the sub class.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||