org.ov4j.cache
Class MethodCaller

java.lang.Object
  extended by org.ov4j.cache.MethodCaller

public class MethodCaller
extends java.lang.Object

This class performs the method calls.

Author:
smolloy

Field Summary
protected  java.util.TimerTask theTimer
          Task setting timeout flag after the timeout period.
 
Constructor Summary
MethodCaller(java.lang.reflect.Method theMethod, java.lang.Object theObj, java.lang.Object... theArgs)
          Constructor.
 
Method Summary
 void call(long timeout)
          Start the threads to perform the call.
 java.lang.Exception getError()
           
 java.lang.Object getTheResult()
           
 boolean hasFailed()
           
 boolean hasTimedout()
           
 void invokeMethod()
          Invoke the method.
 void setTimedout(boolean timedout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theTimer

protected java.util.TimerTask theTimer
Task setting timeout flag after the timeout period.

Constructor Detail

MethodCaller

public MethodCaller(java.lang.reflect.Method theMethod,
                    java.lang.Object theObj,
                    java.lang.Object... theArgs)
Constructor.

Parameters:
theMethod - The method to call.
theObj - The object on which to call it.
theArgs - The arguments to pass to the method call.
Method Detail

call

public void call(long timeout)
Start the threads to perform the call.

Parameters:
timeout - Timeout period.

getError

public java.lang.Exception getError()
Returns:
Returns the error.

getTheResult

public java.lang.Object getTheResult()
Returns:
Returns the theResult.

hasFailed

public boolean hasFailed()
Returns:
Returns true if an error occured while trying to call the method.

hasTimedout

public boolean hasTimedout()
Returns:
Returns the timedout.

invokeMethod

public void invokeMethod()
Invoke the method.


setTimedout

public void setTimedout(boolean timedout)
Parameters:
timedout - The timedout to set.


Copyright © 2004-2007 Steve Molloy. All Rights Reserved.