public class CallSequentializer<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Tuple3<java.lang.String,java.lang.Object[],Future<T>>> |
calls
The list of waiting calls with future and args.
|
protected java.util.Map<java.lang.String,IResultCommand<IFuture<T>,java.lang.Object[]>> |
commands
The command to execute a call.
|
protected IFuture<T> |
currentcall
The current call.
|
Constructor and Description |
---|
CallSequentializer()
Create a new sequentializer.
|
CallSequentializer(IResultCommand<IFuture<T>,java.lang.Object[]> call)
Create a new sequentializer.
|
Modifier and Type | Method and Description |
---|---|
void |
addCommand(java.lang.String method,
IResultCommand<IFuture<T>,java.lang.Object[]> call)
Add a command by (method) name.
|
IFuture<T> |
call(java.lang.Object[] args)
Handles a call.
|
IFuture<T> |
call(java.lang.String method,
java.lang.Object[] args) |
protected void |
proceed()
Called when a command returns.
|
protected java.util.List<Tuple3<java.lang.String,java.lang.Object[],Future<T>>> calls
protected java.util.Map<java.lang.String,IResultCommand<IFuture<T>,java.lang.Object[]>> commands
public CallSequentializer()
public CallSequentializer(IResultCommand<IFuture<T>,java.lang.Object[]> call)
call
- The command to execute on an invocation.public void addCommand(java.lang.String method, IResultCommand<IFuture<T>,java.lang.Object[]> call)
method
- The method name (or just a name).public IFuture<T> call(java.lang.Object[] args)
args
- The call args.protected void proceed()