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 java.lang.Object[] |
requestInfo
The OERequestInfo details for this command.
|
private AppServerInvocationResult |
result
The result for this command.
|
private long |
timeout
The maximum allowed time for this invocation to complete.
|
private java.lang.String |
token
When not null, it represents the token of a FWD context created for an authenticated and authorized
web service call.
|
Constructor and Description |
---|
AgentCommand(AppServerInvocationResult result,
java.lang.String id)
Initialize this command for no explicit request (an internal request).
|
AgentCommand(AppServerInvocationResult result,
java.lang.String id,
int requestId)
Initialize this command for an explicit request.
|
AgentCommand(AppServerInvocationResult result,
java.lang.String id,
int requestId,
long timeout)
Initialize this command for an explicit request.
|
AgentCommand(java.lang.Object[] requestInfo,
AppServerInvocationResult result,
java.lang.String id)
Initialize this command for no explicit request (an internal request).
|
Modifier and Type | Method and Description |
---|---|
void |
doExecute()
Perform the actual command.
|
private void |
doExecuteImpl() |
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
private AppServerInvocationResult result
private java.lang.Object[] requestInfo
private java.lang.String token
public AgentCommand(AppServerInvocationResult result, java.lang.String id)
result
- The result to be sent back to the remote side.id
- The connection ID on which this command is executed.public AgentCommand(java.lang.Object[] requestInfo, AppServerInvocationResult result, java.lang.String id)
requestInfo
- The remote OerequestInfo
details, as set by
OerequestInfo.toArray()
.result
- The result to be sent back to the remote side.id
- The connection ID on which this command is executed.public AgentCommand(AppServerInvocationResult result, java.lang.String id, int requestId)
result
- The result to be sent back to the remote side.id
- The connection ID on which this command is executed.requestId
- The ID of the request.public AgentCommand(AppServerInvocationResult result, java.lang.String id, int requestId, long timeout)
result
- The result to be sent back to the remote side.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 final void doExecute()
requestInfo
, if set.private void doExecuteImpl()
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()