public final class MethodThread extends SingleMethodExecutor implements java.lang.Runnable
arguments, method, object, returnedValue
Modifier | Constructor and Description |
---|---|
protected |
MethodThread(java.lang.reflect.Method method,
java.lang.Object object,
java.lang.Object[] arguments)
Create new instance of MethodThread
The constructor can't be called directly, use backgroundExecute "factory" member of MethodExecutor
|
protected |
MethodThread(java.lang.reflect.Method method,
java.lang.Object object,
java.lang.Object[] arguments,
Executable executeBefore,
Executable executeAfter)
Create new instance of MethodThread
The constructor can't be called directly, use backgroundExecute "factory" member of MethodExecutor
|
protected |
MethodThread(java.lang.reflect.Method method,
java.lang.Object object,
java.lang.Object[] arguments,
java.util.List<Executable> executeBefore,
java.util.List<Executable> executeAfter)
Create new instance of MethodThread
The constructor can't be called directly, use backgroundExecute "factory" member of MethodExecutor
|
Modifier and Type | Method and Description |
---|---|
java.lang.Exception |
getException()
Returns the exception thrown while executing or null
if the execution finished with no exception.
|
java.lang.Thread |
getRunningThread()
Returns the thread that is processing this method.
|
boolean |
isRunning()
Returns true if the method is still being executed, otherwise false is returned.
|
boolean |
isSuccess()
This method waits for the end of execution.
|
void |
run()
Execute the method inside the thread
|
void |
waitExecutionEnd()
Wait for the end of the operation execution in specified thread (returned by backgroundExecute)
This method will block until the background operation finishes its processing.
|
execute, getArgument, getArgument, getArgumentCount, getArguments, getDeclaredMethod, getReturnedValue, chooseExecutionObject
protected MethodThread(java.lang.reflect.Method method, java.lang.Object object, java.lang.Object[] arguments)
method
- method to call on the specified objectobject
- the executor object, that is used for invocation of methodsarguments
- the arguments of the executed methodprotected MethodThread(java.lang.reflect.Method method, java.lang.Object object, java.lang.Object[] arguments, java.util.List<Executable> executeBefore, java.util.List<Executable> executeAfter)
method
- method to call on the specified objectobject
- the executor object, that is used for invocation of methodsarguments
- the arguments of the executed methodexecuteBefore
- list of methods to call before the execution of the method (can be null if no pre/post execution is required)executeAfter
- list of methods to call after the successful execution of the method (can be null if no pre/post execution is required)protected MethodThread(java.lang.reflect.Method method, java.lang.Object object, java.lang.Object[] arguments, Executable executeBefore, Executable executeAfter)
method
- method to call on the specified objectobject
- the executor object, that is used for invocation of methodsarguments
- the arguments of the executed methodexecuteBefore
- a method to call before the execution of the method (can be null if no pre/post execution is required)executeAfter
- a method to call after the successful execution of the method (can be null if no pre/post execution is required)public boolean isRunning()
public java.lang.Thread getRunningThread()
public boolean isSuccess() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the waiting was interruptedpublic java.lang.Exception getException()
public void waitExecutionEnd() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the waiting was interruptedpublic void run()
run
in interface java.lang.Runnable