mandala.rami.impl
Class MethodInvoker

java.lang.Object
  extended bymandala.rami.impl.MethodInvoker
All Implemented Interfaces:
java.lang.Runnable

public class MethodInvoker
extends java.lang.Object
implements java.lang.Runnable

Implements the reflexive method invocation mechanism.

Version:
1.0
Author:
eipi
See Also:
Runnable, FutureServer

Field Summary
protected  ThreadOp callee
          The callee thread which runs the method invocation.
protected  FutureServer future
          The FutureServer to use for the invocation.
protected  java.lang.Object object
          The object to invoke a method on.
protected  java.lang.Object result
          The result of the method invocation.
protected  java.lang.Throwable throwable
          The exception thrown by the method invocation.
 
Constructor Summary
MethodInvoker(java.lang.Object object, FutureServer future)
          Creates a new MethodInvoker instance.
 
Method Summary
 FutureServer getFuture()
          Returns the future given at instanciation.
 java.lang.Object getObject()
          Returns the object on which method is to be invoked.
static Syslog getSyslog()
          Returns the Syslog object facility.
 void run()
          Invoke the method future.getMethod() on the object getObject() with arguments future.getArgs() Call a method.
static void setSyslog(Syslog log)
          Sets the Syslog object facility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

protected final java.lang.Object object

The object to invoke a method on.


future

protected final FutureServer future

The FutureServer to use for the invocation.

See Also:
FutureServer

result

protected java.lang.Object result

The result of the method invocation.


throwable

protected java.lang.Throwable throwable

The exception thrown by the method invocation.


callee

protected ThreadOp callee

The callee thread which runs the method invocation.

Constructor Detail

MethodInvoker

public MethodInvoker(java.lang.Object object,
                     FutureServer future)
Creates a new MethodInvoker instance.

Parameters:
object - the object to invoke the method to
future - the FutureServer object which handle the returned result
Method Detail

getFuture

public FutureServer getFuture()

Returns the future given at instanciation.

Returns:
in the constructor

getObject

public java.lang.Object getObject()

Returns the object on which method is to be invoked.

Returns:
an Object value

run

public void run()

Invoke the method future.getMethod() on the object getObject() with arguments future.getArgs() Call a method.

The invocation of the method future.getMethod() on the object getObject() with arguments future.getArgs() is considered terminated when either it returns normally or when an exception is thrown by it.

In both case, the future object specified is then used as follow :

Specified by:
run in interface java.lang.Runnable
See Also:
FutureServer, InvocationInfo.getMethod(), InvocationInfo.getArgs(), ResultUpdater.setResult(Object, Throwable), MethodOp.invoke(Object, Object[]), ThreadOp, ThreadOp.interrupt()

getSyslog

public static Syslog getSyslog()

Returns the Syslog object facility.

Each message (debug, log, warning, error, ...) are wrote to this message logger.

Returns:
the Syslog object
See Also:
Syslog

setSyslog

public static void setSyslog(Syslog log)

Sets the Syslog object facility.

Each message (debug, log, warning, error, ...) are wrote to this message logger.

See Also:
Syslog


Mandala help mailing list