public abstract class AbstractTucsonAgent extends java.lang.Object implements TucsonOperationCompletionListener
go()
gets TuCSoN Default ACC
(the most comprehensive at the moment) and trigger Agent's main execution
cyle, that is the method main
.Modifier and Type | Field and Description |
---|---|
protected java.util.List<TucsonOpCompletionEvent> |
completionEvents |
Constructor and Description |
---|
AbstractTucsonAgent(java.lang.String id)
Same as before, this time using the passed String to create the
TucsonAgentId from scratch
|
AbstractTucsonAgent(java.lang.String id,
java.lang.String netid)
Again we assume default port (which is 20504), so we skip that parameter
(String aid version).
|
AbstractTucsonAgent(java.lang.String id,
java.lang.String netid,
int p)
Same as first one, but takes a String in place of a TucsonAgentId that is
created from scratch using such string.
|
Modifier and Type | Method and Description |
---|---|
protected EnhancedACC |
getContext()
Getter for the ACC.
|
TucsonAgentId |
getTucsonAgentId()
Getter for the TucsonAgent identifier
|
void |
go()
Starts main execution cycle
main |
protected abstract void |
main()
Main execution cycle, user-defined.
|
java.lang.String |
myName()
Returns local agent name
|
java.lang.String |
myNode()
Returns agent default node.
|
int |
myport()
Returns agent default port
|
abstract void |
operationCompleted(AbstractTupleCentreOperation op) |
abstract void |
operationCompleted(ITucsonOperation op) |
protected void |
say(java.lang.String msg)
Utility method to print on standard output the user agent activity.
|
protected void |
setContext(EnhancedACC ctx)
Setter for the ACC.
|
protected java.util.List<TucsonOpCompletionEvent> completionEvents
public AbstractTucsonAgent(java.lang.String id) throws TucsonInvalidAgentIdException
id
- The String to use to build the TucsonAgentIdentifierTucsonInvalidAgentIdException
- if the String given is not a valid representation of a TuCSoN
agent identifierpublic AbstractTucsonAgent(java.lang.String id, java.lang.String netid) throws TucsonInvalidAgentIdException
id
- The String to use to build the TucsonAgentIdentifiernetid
- The ip address of the TuCSoN Node to contactTucsonInvalidAgentIdException
- if the String given is not a valid representation of a TuCSoN
agent identifierpublic AbstractTucsonAgent(java.lang.String id, java.lang.String netid, int p) throws TucsonInvalidAgentIdException
id
- The String to use to build the TucsonAgentIdentifiernetid
- The ip address of the TuCSoN Node to contactp
- The listening port of the TuCSoN Node to contactTucsonInvalidAgentIdException
- if the String given is not a valid representation of a TuCSoN
agent identifierpublic final TucsonAgentId getTucsonAgentId()
public final void go()
main
public final java.lang.String myName()
public final java.lang.String myNode()
public final int myport()
public abstract void operationCompleted(AbstractTupleCentreOperation op)
operationCompleted
in interface OperationCompletionListener
op
- the operation completedpublic abstract void operationCompleted(ITucsonOperation op)
operationCompleted
in interface TucsonOperationCompletionListener
op
- the TuCSoN operation just completedprotected EnhancedACC getContext()
protected abstract void main()
protected void say(java.lang.String msg)
msg
- The message to printprotected void setContext(EnhancedACC ctx)
ctx
- The ACC to use