com.thoughtworks.proxy.toys.decorate
Class DecoratingInvoker<T>

java.lang.Object
  extended by com.thoughtworks.proxy.toys.decorate.DecoratingInvoker<T>
All Implemented Interfaces:
Invoker, Serializable

public class DecoratingInvoker<T>
extends Object
implements Invoker

Invoker implementation for the decorating proxy. The implementation may decorate an object or another Invoker.

Since:
0.1
Author:
Dan North, Aslak Hellesøy, Jörg Schaible
See Also:
Serialized Form

Constructor Summary
DecoratingInvoker(Invoker decorated, Decorator<T> decorator)
          Construct a DecoratingInvoker decorating another Invoker.
DecoratingInvoker(Object delegate, Decorator<T> decorator)
          Construct a DecoratingInvoker decorating another object.
 
Method Summary
 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

DecoratingInvoker

public DecoratingInvoker(Invoker decorated,
                         Decorator<T> decorator)
Construct a DecoratingInvoker decorating another Invoker.

Parameters:
decorated - the decorated Invoker.
decorator - the decorating instance.
Since:
1.0

DecoratingInvoker

public DecoratingInvoker(Object delegate,
                         Decorator<T> decorator)
Construct a DecoratingInvoker decorating another object.

Parameters:
delegate - the decorated object.
decorator - the decorating instance.
Since:
1.0
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.


Copyright © 2005-2010 Codehaus. All Rights Reserved.