com.thoughtworks.proxy.kit
Class SimpleInvoker

java.lang.Object
  extended by com.thoughtworks.proxy.kit.SimpleInvoker
All Implemented Interfaces:
Invoker, Serializable
Direct Known Subclasses:
PrivateInvoker

public class SimpleInvoker
extends Object
implements Invoker

A simple Invoker implementation, that routes any call to a target object. A null value as target can be handled, the invocation result will always be null.

Since:
0.2
Author:
Aslak Hellesøy
See Also:
Serialized Form

Constructor Summary
SimpleInvoker(Object target)
          Construct a SimpleInvoker.
 
Method Summary
protected  Object getTarget()
          Retrieve the target of the invocations.
 Object invoke(Object proxy, Method method, Object[] args)
          Invocation of a method of the proxied object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleInvoker

public SimpleInvoker(Object target)
Construct a SimpleInvoker.

Parameters:
target - the invocation target.
Since:
0.2
Method Detail

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Description copied from interface: Invoker
Invocation of a method of the proxied object.

Specified by:
invoke in interface Invoker
Parameters:
proxy - the proxy instance.
method - the method to invoke.
args - the arguments of the method.
Returns:
the result of the invoked method.
Throws:
Throwable - if the invoked method has thrown.

getTarget

protected Object getTarget()
Retrieve the target of the invocations.

Returns:
the target object
Since:
0.2


Copyright © 2005-2010 Codehaus. All Rights Reserved.