com.sun.faban.harness.util
Class Invoker

java.lang.Object
  extended by com.sun.faban.harness.util.Invoker

public class Invoker
extends Object

Common invocation utilities used by wrappers.

Author:
Akara Sucharitakul

Constructor Summary
Invoker()
           
 
Method Summary
static String getContextLocation()
          Obtains the current context location.
static void invoke(Object o, Method m)
          Invokes a method with no context location.
static void invoke(Object o, Method m, String location)
          Invokes a method given a context location.
static boolean isVoidNoArg(Method m)
          Checks a method whether it is a void, no-argument public method.
static void setContextLocation(String newLocation)
          Sets a new context location.
static void throwCauseException(Exception e)
          Throws the cause of an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Invoker

public Invoker()
Method Detail

throwCauseException

public static void throwCauseException(Exception e)
                                throws Exception
Throws the cause of an exception.

Parameters:
e - The exception
Throws:
Exception - The cause

isVoidNoArg

public static boolean isVoidNoArg(Method m)
Checks a method whether it is a void, no-argument public method.

Parameters:
m - The method to be checked
Returns:
Whether the method conforms to invocation spec or not

invoke

public static void invoke(Object o,
                          Method m,
                          String location)
                   throws Exception
Invokes a method given a context location. Skips any methods that are null.

Parameters:
o - The object to invoke the method on
m - The method
location - The context location
Throws:
Exception - Exceptions, if any

invoke

public static void invoke(Object o,
                          Method m)
                   throws Exception
Invokes a method with no context location. Skips any methods that are null.

Parameters:
o - The object to invoke the method on
m - The method
Throws:
Exception - Exceptions, if any

setContextLocation

public static void setContextLocation(String newLocation)
Sets a new context location.

Parameters:
newLocation - The new context location

getContextLocation

public static String getContextLocation()
Obtains the current context location.

Returns:
The current context location