public abstract class AgentAction<C extends ClientContext,A extends AsyncAgent> extends ClientAction<C> implements CancellableTask
Blocking of the action depends on the async-timeout which is set in the agent. Shortly before the async-timeout expires on the server, the user is asked whether he wants to cancel the agent manually.
AgentCancelAction
,
Serialized FormConstructor and Description |
---|
AgentAction(C clientCtx,
NlsActionKey nls) |
AgentAction(C clientCtx,
NlsActionKey nls,
IconKey iconKey) |
Modifier and Type | Method and Description |
---|---|
protected void |
actionFired(java.awt.event.ActionEvent e)
Is called when the action is fired.
|
protected void |
agentFailed(A agent,
java.lang.Exception error)
Is called finally when the agent response contains an Exception.
|
protected void |
agentSucceeded(A agent)
Is called finally when the agent has succeeded.
|
void |
cancel() |
protected abstract A |
createInputAgent()
Creates the input agent to be sent to the server for execution.
|
protected void |
handleBlockingTimeout()
Prompts for canceling the agent.
|
void |
setBlockingTimeout(int seconds)
Defines the max blocking time for this action.
|
boolean |
wasCancelled()
Tells whether ever an attempt has been made to cancel this task.
|
actionFailed, checkEnableCondition, getClientContext, getSessionId, isConnectionSensitive, isLoggedIn, isOffline, isOnline, setConnectionSensitive
actionConfirmed, actionDenied, actionPerformed, actionPrepare, actionSucceeded, fire, getApplicationContext, getButtonText, getIcon, getLogChannel, getMenuText, getName, getPressedIcon, getTipText, isForced, isHandleError, isLogDebug, isLogVerbose, isPermitted, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, performAvailabilityCheck, setBusyAnimationEnabled, setHandleError, setIcon, setIcon, setLogChannel, setName, setPressedIcon, setPressedIcon, setText, setTipText, setValidator, showError, showError, showError, showInfo, showInfo, showWarning, showWarning, toString
public AgentAction(C clientCtx, NlsActionKey nls)
public AgentAction(C clientCtx, NlsActionKey nls, IconKey iconKey)
public final void setBlockingTimeout(int seconds)
When the blocking timeout occurs, then the method handleBlockingTimeout()
is called.
You may override this method to implement your special reaction.
protected final void actionFired(java.awt.event.ActionEvent e) throws java.lang.Exception
ZAction
actionFired
in class ZAction<C extends ClientContext>
java.lang.Exception
protected void agentFailed(A agent, java.lang.Exception error)
AgentErrorAdapter
.protected void agentSucceeded(A agent)
protected abstract A createInputAgent()
protected void handleBlockingTimeout()
public final void cancel()
public final boolean wasCancelled()
CancellableTask
wasCancelled
in interface CancellableTask
Copyright © 2014 EsprIT-Systems. All Rights Reserved.