private abstract static class Agent.AgentCommand
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
connectionId
The connection ID on which this command is executed.
|
private java.lang.Throwable |
error
Any error caught during the command execution.
|
private boolean |
finished
Flag indicating if this command has finished or not.
|
private int |
requestId
The ID of the request.
|
private long |
timeout
The maximum allowed time for this invocation to complete.
|
Constructor and Description |
---|
AgentCommand(java.lang.String id)
Initialize this command for no explicit request (an internal request).
|
AgentCommand(java.lang.String id,
int requestId)
Initialize this command for an explicit request.
|
AgentCommand(java.lang.String id,
int requestId,
long timeout)
Initialize this command for an explicit request.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
execute()
Override this to define the command body.
|
void |
finished()
Notify that this command has finished.
|
java.lang.String |
getConnectionId()
Get the
connection ID where this command is executed. |
java.lang.Throwable |
getError()
Get the error caught during this command execution.
|
int |
getRequestId()
Get the request ID of this command.
|
long |
getTimeout()
Get the
timeout of execution for this command. |
boolean |
isFinished()
Check the
finished flag. |
void |
setError(java.lang.Throwable t)
Set the error caught during this command execution.
|
private final int requestId
private final java.lang.String connectionId
null
if this
command must terminate execution always (i.e. a procedure proxy initialization, procedure
deletion, etc).private final long timeout
0
to disable the timeout.private java.lang.Throwable error
private boolean finished
public AgentCommand(java.lang.String id)
id
- The connection ID on which this command is executed.public AgentCommand(java.lang.String id, int requestId)
id
- The connection ID on which this command is executed.requestId
- The ID of the request.public AgentCommand(java.lang.String id, int requestId, long timeout)
id
- The connection ID on which this command is executed.requestId
- The ID of the request.timeout
- The maximum allowed time for this invocation to complete. In milliseconds.
Use 0
to disable the timeout.public abstract void execute()
public int getRequestId()
public java.lang.String getConnectionId()
connection ID
where this command is executed.public long getTimeout()
timeout
of execution for this command.public boolean isFinished()
finished
flag.public void finished()
public void setError(java.lang.Throwable t)
t
- The caught error.public java.lang.Throwable getError()