Package spin
Class Invocation
- java.lang.Object
-
- spin.Invocation
-
public class Invocation extends java.lang.ObjectA single invocation on a Spin proxy handled byEvaluators.
-
-
Constructor Summary
Constructors Constructor Description Invocation(java.lang.Object object, java.lang.reflect.Method method, java.lang.Object[] args)Create an invocation of the given method on the given object with the given arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidevaluate()Evaluate the return value (or a possibly thrownThrowable) by invoking to method with the arguments on the wrapped object.java.lang.Object[]getArguments()Get the arguments for the invoked method.java.lang.reflect.MethodgetMethod()Get the invoked method.java.lang.ObjectgetObject()Get the object this invocation is evaluated on.java.lang.ObjectgetResult()Get the result of evaluationjava.lang.ThrowablegetThrowable()Get the throwable thrown on evaluation.booleanisEvaluated()Test if this invocation is already evaluated.java.lang.ObjectresultOrThrow()Get the result or throwable of this invocation's evaluation.voidsetArguments(java.lang.Object[] args)Set the arguments for the invoked method.voidsetMethod(java.lang.reflect.Method method)Set the method to invoke.voidsetObject(java.lang.Object object)Set the object this invocation is evaluated on.voidsetResult(java.lang.Object result)Set the result of evaluationvoidsetThrowable(java.lang.Throwable throwable)Set the throwable thrown on evaluation.
-
-
-
Constructor Detail
-
Invocation
public Invocation(java.lang.Object object, java.lang.reflect.Method method, java.lang.Object[] args)Create an invocation of the given method on the given object with the given arguments.- Parameters:
object- object to invoke method onmethod- method to invokeargs- arguments for the method invocation
-
-
Method Detail
-
setObject
public void setObject(java.lang.Object object)
Set the object this invocation is evaluated on.- Parameters:
object- object to evaluate on
-
getObject
public java.lang.Object getObject()
Get the object this invocation is evaluated on.- Returns:
- the object this invocation is evaluated on
-
setMethod
public void setMethod(java.lang.reflect.Method method)
Set the method to invoke.- Parameters:
method- method to invoke
-
getMethod
public java.lang.reflect.Method getMethod()
Get the invoked method.- Returns:
- the invoked method
-
setArguments
public void setArguments(java.lang.Object[] args)
Set the arguments for the invoked method.- Parameters:
args- the arguments for the invoked method
-
getArguments
public java.lang.Object[] getArguments()
Get the arguments for the invoked method.- Returns:
- the arguments for the invoked method
-
getResult
public java.lang.Object getResult()
Get the result of evaluation- Returns:
- the result
-
setResult
public void setResult(java.lang.Object result)
Set the result of evaluation- Parameters:
result- the result
-
getThrowable
public java.lang.Throwable getThrowable()
Get the throwable thrown on evaluation.- Returns:
- the throwable
-
setThrowable
public void setThrowable(java.lang.Throwable throwable)
Set the throwable thrown on evaluation.- Parameters:
throwable- the throwable
-
evaluate
public void evaluate()
Evaluate the return value (or a possibly thrownThrowable) by invoking to method with the arguments on the wrapped object.
-
isEvaluated
public boolean isEvaluated()
Test if this invocation is already evaluated.- Returns:
trueif evaluation has finished
-
resultOrThrow
public java.lang.Object resultOrThrow() throws java.lang.ThrowableGet the result or throwable of this invocation's evaluation.- Returns:
- result result of evaluation
- Throws:
java.lang.Throwable- throwable of evaluation
-
-