|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jbbres.lib.actions.tools.elements.variables.VariableActionService
public class VariableActionService
The ActionService
for VariableAction
.
Constructor Summary | |
---|---|
VariableActionService(VariableAction parent)
Instantiates a new variable action model. |
Method Summary | |
---|---|
void |
addExecutionListener(ActionExecutionListener l)
Adds a listener to the execution. |
void |
addServiceListener(VariableActionServiceListener l)
Adds a model listener. |
java.lang.Object |
execute(java.lang.Object input,
Parameters parameters)
Executes the action. |
void |
fireActionExecutionEnd(int status,
java.lang.Object input,
Parameters parameters,
java.lang.Object result)
Calls the actionExecutionEnds() method of all the action
listeners. |
void |
fireActionExecutionEnd(int status,
java.lang.Object input,
Parameters parameters,
java.lang.Object result,
java.lang.Throwable exception)
Calls the actionExecutionEnds() method of all the action
listeners. |
void |
fireActionExecutionStart(java.lang.Object input,
Parameters parameters)
Calls the actionExecutionStarts() method of all the action
listeners. |
void |
fireAssignValueChange()
Calls the assignValueChange method of all the model
listeners. |
void |
fireVariableChange()
Calls the variableChange method of all the model listeners. |
Variable |
getVariable()
Returns the variable. |
boolean |
isAssignValue()
Returns true if the assign value functionality is on. |
boolean |
isValidInputClass(java.lang.Class<? extends java.lang.Object> clazz)
Returns true if an instance of the given class is an
acceptable input. |
java.lang.Class<? extends java.lang.Object> |
outputClass(java.lang.Class<? extends java.lang.Object> inputClazz)
Returns the class of the object returned by the execute
method, depending on the class of the object received as an input. |
void |
removeExecutionListener(ActionExecutionListener l)
Removes a listener to the execution. |
void |
removeServiceListener(VariableActionServiceListener l)
Removes a execution listener. |
void |
setAssignValue(boolean assignValue)
Sets if the assign value functionality is on. |
void |
setVariable(Variable variable)
Sets the variable. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VariableActionService(VariableAction parent)
parent
- - the parent actionMethod Detail |
---|
public final java.lang.Object execute(java.lang.Object input, Parameters parameters) throws ActionExecutionException
ActionService
The method receives as an input the result of the previous action in the
workflow, casted in the input type of the action. As it might appends
that the action is the first one of the workflow, or that the previous
one did not generate an output compatible with the expected input of this
one, the value received as a parameter might be null
. The
method should handle this case in order to avoid workflow execution
errors.
This method returns the result of the execution, which will be used as
input of the next action. Action(s) considers that the execution
of the action is successful if no exception is raised during its
execution. If the result of this function is null
, it will
be considered as successful and the workflow will continue its execution.
An ActionExecutionException
means that the action failed during
its execution. Such an exception (and any other exception) will result in
ending the workflow execution.
If the action is not supposed to return any output (result of the
ActionService.outputClass(Class)
method is Void
), it returns a
null
object.
execute
in interface ActionService
input
- - the result of the previous actionparameters
- - the settings related to this action, to apply for this
execution.
ActionExecutionException
- - if the execution failedpublic void setVariable(Variable variable)
variable
- the new variablepublic Variable getVariable()
public void setAssignValue(boolean assignValue)
assignValue
- the assignValue to setpublic boolean isAssignValue()
true
if the assign value functionality is on.
true
if the assign value functionality is on.
false
otherwise.public java.lang.Class<? extends java.lang.Object> outputClass(java.lang.Class<? extends java.lang.Object> inputClazz)
ActionService
execute
method, depending on the class of the object received as an input.
outputClass
in interface ActionService
inputClazz
- - the class of the object that will be received as an input
execute
methodActionService.isValidInputClass(Class)
public boolean isValidInputClass(java.lang.Class<? extends java.lang.Object> clazz)
ActionService
true
if an instance of the given class is an
acceptable input.
isValidInputClass
in interface ActionService
clazz
- - the tentative class
true
if an instance of the given class is an
acceptable input. false
otherwise.ActionService.outputClass(Class)
public void addExecutionListener(ActionExecutionListener l)
ActionService
addExecutionListener
in interface ActionService
l
- - new listener.ActionService.removeExecutionListener(ActionExecutionListener)
public void removeExecutionListener(ActionExecutionListener l)
ActionService
removeExecutionListener
in interface ActionService
l
- - listener to removeActionService.addExecutionListener(ActionExecutionListener)
public void addServiceListener(VariableActionServiceListener l)
l
- - the listenerpublic void removeServiceListener(VariableActionServiceListener l)
l
- - the listenerpublic void fireAssignValueChange()
assignValueChange
method of all the model
listeners.
public void fireVariableChange()
variableChange
method of all the model listeners.
public void fireActionExecutionStart(java.lang.Object input, Parameters parameters) throws ActionExecutionException
actionExecutionStarts()
method of all the action
listeners.
input
- the inputparameters
- the parameters
ActionExecutionException
- the action exceptionpublic void fireActionExecutionEnd(int status, java.lang.Object input, Parameters parameters, java.lang.Object result) throws ActionExecutionException
actionExecutionEnds()
method of all the action
listeners.
status
- - the status of the action (SUCCEED or FAILED)input
- - the input objectparameters
- - the parametersresult
- - the result object
ActionExecutionException
- the action exceptionpublic void fireActionExecutionEnd(int status, java.lang.Object input, Parameters parameters, java.lang.Object result, java.lang.Throwable exception) throws ActionExecutionException
actionExecutionEnds()
method of all the action
listeners.
status
- - the status of the action (SUCCEED or FAILED)input
- - the input objectparameters
- - the parametersresult
- - the result objectexception
- - the exception that occurs during the execution
ActionExecutionException
- the action exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |