com.thoughtworks.proxy.kit
Class PrivateInvoker

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

public class PrivateInvoker
extends SimpleInvoker

An Invoker that is able to call protected and private methods. If the proxies type is an abstract class, it might be necessary to use an PrivateInvoker instead of a SimpleInvoker. Otherwise the method implementations may not call the protected or private methods of the own type.

Since:
0.2
Author:
Jörg Schaible
See Also:
Serialized Form

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

Constructor Detail

PrivateInvoker

public PrivateInvoker(Object target)
Construct a PrivateInvoker.

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
Overrides:
invoke in class SimpleInvoker
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.


Copyright © 2005-2010 Codehaus. All Rights Reserved.