sleep.engine

Class ProxyInterface

public class ProxyInterface extends Object implements InvocationHandler

This class is used to mock an instance of a class that implements a specified Java interface using a Sleep function.
Field Summary
protected Functionfunc
protected ScriptInstancescript
Constructor Summary
ProxyInterface(Function _method, ScriptInstance _script)
Method Summary
static ObjectBuildInterface(Class className, Function subroutine, ScriptInstance script)
Constructs a new instance of the specified class that uses the passed Sleep function to respond to all method calls on this instance.
static ObjectBuildInterface(Class[] classes, Function subroutine, ScriptInstance script)
Constructs a new instance of the specified class that uses the passed Sleep function to respond to all method calls on this instance.
static ObjectBuildInterface(Class className, Block block, ScriptInstance script)
Constructs a new instance of the specified class that uses the passed block to respond to all method calls on this instance.
static ObjectBuildInterface(Class[] classes, Block block, ScriptInstance script)
Constructs a new instance of the specified class that uses the passed block to respond to all method calls on this instance.
ScriptInstancegetOwner()
Returns the script associated with this proxy interface.
Objectinvoke(Object proxy, Method method, Object[] args)
This function invokes the contained Sleep closure with the specified arguments

Field Detail

func

protected Function func

script

protected ScriptInstance script

Constructor Detail

ProxyInterface

public ProxyInterface(Function _method, ScriptInstance _script)

Method Detail

BuildInterface

public static Object BuildInterface(Class className, Function subroutine, ScriptInstance script)
Constructs a new instance of the specified class that uses the passed Sleep function to respond to all method calls on this instance.

BuildInterface

public static Object BuildInterface(Class[] classes, Function subroutine, ScriptInstance script)
Constructs a new instance of the specified class that uses the passed Sleep function to respond to all method calls on this instance.

BuildInterface

public static Object BuildInterface(Class className, Block block, ScriptInstance script)
Constructs a new instance of the specified class that uses the passed block to respond to all method calls on this instance.

BuildInterface

public static Object BuildInterface(Class[] classes, Block block, ScriptInstance script)
Constructs a new instance of the specified class that uses the passed block to respond to all method calls on this instance.

getOwner

public ScriptInstance getOwner()
Returns the script associated with this proxy interface.

invoke

public Object invoke(Object proxy, Method method, Object[] args)
This function invokes the contained Sleep closure with the specified arguments