|
|||||||||||
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 FormField Summary | |
protected static int |
DELTA_PRIORITY
The invoker thread is given priority equals to NORM_PRIORITY + DELTA_PRIORITY. |
protected mandala.rami.impl.ListAsynchronousPolicy.InvokerThread |
invokerThread
The invoker thread instance used to invoke methods. |
protected java.util.List |
methods
The list of methods to be invoked by the invokerThread . |
protected static int |
threadPriority
Priority of the invoker thread. |
Constructor Summary | |
ListAsynchronousPolicy(java.lang.String name,
java.util.List list)
Creates a new ListAsynchronousPolicy instance. |
Method Summary | |
Cancelable |
call(java.lang.Object object,
FutureServer futureServer)
Asynchronous implementation of a method invocation. |
protected void |
finalize()
|
int |
getCurrentSize()
Gets the current size methods . |
java.lang.Thread |
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> |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected transient java.util.List methods
The list of methods to be invoked by the
invokerThread
.
getCurrentSize()
,
invokerThread
protected 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 mandala.rami.impl.ListAsynchronousPolicy.InvokerThread invokerThread
The invoker thread instance used to invoke methods.
Constructor Detail |
public ListAsynchronousPolicy(java.lang.String name, java.util.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()
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
public final Cancelable call(java.lang.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 AsynchronousPolicy
object
- the object on which the method is to be invoked.futureServer
- a FutureServer
value
MethodInvoker
,
FutureServer
,
methods
,
invokerThread
,
select()
public java.lang.Thread 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 java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |