com.thoughtworks.proxy.toys.decorate
Class Decorating

java.lang.Object
  extended by com.thoughtworks.proxy.toys.decorate.Decorating

public class Decorating
extends Object

Toy factory to create proxies decorating an object in an AOP style.

An InvocationDecorator is used for the additional functionality. It is called before the original method is called, after the original method was called, after the original method has thrown an exceptionor when an exception occurs, calling the method of the decorated object.

Since:
0.1
Author:
Dan North, Aslak Hellesøy, Jörg Schaible
See Also:
com.thoughtworks.proxy.toys.decorate

Method Summary
static Object object(Class[] types, Object delegate, InvocationDecorator decorator)
          Create a decorating proxy implementing specific types.
static Object object(Class[] types, Object delegate, InvocationDecorator decorator, ProxyFactory factory)
          Create a decorating proxy implementing specific types using a provided ProxyFactory.
static Object object(Class type, Object delegate, InvocationDecorator decorator)
          Create a decorating proxy implementing a specific type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

object

public static Object object(Class type,
                            Object delegate,
                            InvocationDecorator decorator)
Create a decorating proxy implementing a specific type.

Parameters:
type - the type of the created proxy.
delegate - the decorated object.
decorator - the decorator instance.
Returns:
a decorating proxy.
Since:
0.1

object

public static Object object(Class[] types,
                            Object delegate,
                            InvocationDecorator decorator)
Create a decorating proxy implementing specific types.

Parameters:
types - the types of the created proxy.
delegate - the decorated object.
decorator - the decorator instance.
Returns:
a decorating proxy.
Since:
0.1

object

public static Object object(Class[] types,
                            Object delegate,
                            InvocationDecorator decorator,
                            ProxyFactory factory)
Create a decorating proxy implementing specific types using a provided ProxyFactory.

Parameters:
types - the types of the created proxy.
delegate - the decorated object.
decorator - the decorator instance.
factory - the ProxyFactory to use for the proxy generation.
Returns:
a decorating proxy.
Since:
0.1