Package play
Class Invoker
- java.lang.Object
-
- play.Invoker
-
public class Invoker extends java.lang.ObjectRun some code in a Play! context
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInvoker.DirectInvocationA direct invocation (in the same thread than caller)static classInvoker.InvocationAn Invocation in something to run in a Play! contextstatic classInvoker.InvocationContextThe class/method that will be invoked by the current operationstatic classInvoker.SuspendThrowable to indicate that the request must be suspended
-
Field Summary
Fields Modifier and Type Field Description static java.util.concurrent.ScheduledThreadPoolExecutorexecutorMain executor for requests invocations.
-
Constructor Summary
Constructors Constructor Description Invoker()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.concurrent.Future<?>invoke(Invoker.Invocation invocation)Run the code in a new thread took from a thread pool.static java.util.concurrent.Future<?>invoke(Invoker.Invocation invocation, long millis)Run the code in a new thread after a delaystatic voidinvokeInThread(Invoker.DirectInvocation invocation)Run the code in the same thread than caller.
-
-
-
Method Detail
-
invoke
public static java.util.concurrent.Future<?> invoke(Invoker.Invocation invocation)
Run the code in a new thread took from a thread pool.- Parameters:
invocation- The code to run- Returns:
- The future object, to know when the task is completed
-
invoke
public static java.util.concurrent.Future<?> invoke(Invoker.Invocation invocation, long millis)
Run the code in a new thread after a delay- Parameters:
invocation- The code to runmillis- The time to wait before, in milliseconds- Returns:
- The future object, to know when the task is completed
-
invokeInThread
public static void invokeInThread(Invoker.DirectInvocation invocation)
Run the code in the same thread than caller.- Parameters:
invocation- The code to run
-
-