|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectmandala.rami.impl.ListAsynchronousPolicy
Abstract implementation of the SingleThreadedSemantic backed by a
List which stores asynchronous methods invocation
request.
A List is used to store method invocation requests. A
thread sleeps continuously waiting for some requests. When such a request is
made, it is inserted in the methods list and the invoker
thread is awaken. This thread removes the request from the
methods list, runs the request using an instance of the MethodInvoker class and returns to sleep if no more requests are in the
methods list.
The selection of the next request to be served by the invoker
thread must be customized by subclasses in the select()
method.
SingleThreadedSemantic,
AsynchronousPolicy,
MethodInvoker,
List,
Serialized Form| Field Summary | |
protected static int |
DELTA_PRIORITY
The invoker thread is given priority equals to NORM_PRIORITY + DELTA_PRIORITY. |
protected MethodInvoker |
invoker
The thread which is responsible of methods invocation. |
protected ThreadOp |
invokerThread
The invoker thread instance used to invoke methods. |
protected List |
methods
The list of methods to be invoked by the invokerThread. |
protected static int |
threadPriority
Priority of the invoker thread. |
| Constructor Summary | |
ListAsynchronousPolicy(String name,
List list)
Creates a new ListAsynchronousPolicy instance. |
|
| Method Summary | |
Cancelable |
call(Object object,
FutureServer futureServer)
Asynchronous implementation of a method invocation. |
int |
getCurrentSize()
Gets the current size methods. |
ThreadOp |
getInvokerThread()
Gets the thread which is responsible of methods invocation. |
protected abstract MethodInvoker |
select()
Returns the next MethodInvoker object to be runned into
the invoker thread<.p> |
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected List methods
The list of methods to be invoked by the
invokerThread.
getCurrentSize(),
invokerThreadprotected MethodInvoker invoker
The thread which is responsible of methods invocation.
getInvokerThread(),
methodsprotected static final int DELTA_PRIORITY
The invoker thread is given priority equals to NORM_PRIORITY + DELTA_PRIORITY.
ThreadOp,
Constant Field Valuesprotected static final int threadPriority
Priority of the invoker thread.
ThreadOp,
Constant Field Valuesprotected transient ThreadOp invokerThread
The invoker thread instance used to invoke methods.
| Constructor Detail |
public ListAsynchronousPolicy(String name,
List list)
Creates a new ListAsynchronousPolicy instance.
name - the name of the invoker threadlist - the implementation of the List interface to useinvokerThread,
getInvokerThread()| Method Detail |
protected abstract MethodInvoker select()
Returns the next MethodInvoker object to be runned into
the invoker thread<.p>
MethodInvoker to be runned into the
invoker threadinvokerThread,
getInvokerThread()
public final Cancelable call(Object object,
FutureServer futureServer)
Asynchronous implementation of a method invocation.
This implementation enqueue the method into the methods
list. The method will be dequeued by the invokerThread
through the invocation of select().
call in interface AsynchronousPolicyobject - the object on which the method is to be invoked.futureServer - a FutureServer value
MethodInvoker,
FutureServer,
methods,
invokerThread,
select()public ThreadOp getInvokerThread()
Gets the thread which is responsible of methods invocation.
ThreadOp valuepublic int getCurrentSize()
Gets the current size methods.
Warning: the information gathered with this method is by nature ephemeral: when this method returns, the current size may already have changed.
public String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||