com.thoughtworks.proxy.toys.decorate
Class Decorating<U,T>

java.lang.Object
  extended by com.thoughtworks.proxy.toys.decorate.Decorating<U,T>

public class Decorating<U,T>
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 exception or when an exception occurs, calling the method of the decorated object.

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

Nested Class Summary
static class Decorating.DecoratingBuild<U,T>
           
static class Decorating.DecoratingVisitor<U,T>
           
static class Decorating.DecoratingWith<T>
           
 
Method Summary
static
<T> Decorating.DecoratingWith<T>
proxy(Class<T> type)
          Creates a factory for proxy instances that allow decoration.
static
<T> Decorating.DecoratingWith<T>
proxy(Class<T> primaryType, Class<?>... types)
          Creates a factory for proxy instances that allow decoration.
static
<U> Decorating.DecoratingVisitor<U,U>
proxy(U delegate)
          Creates a factory for proxy instances that allow decoration.
static
<U,T> Decorating.DecoratingVisitor<U,T>
proxy(U delegate, Class<T> type)
          Creates a factory for proxy instances that allow decoration.
static
<U,T> Decorating.DecoratingVisitor<U,T>
proxy(U delegate, Class<T> primaryType, Class<?>... types)
          Creates a factory for proxy instances that allow decoration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

proxy

public static <T> Decorating.DecoratingWith<T> proxy(Class<T> type)
Creates a factory for proxy instances that allow decoration.

Returns:
a factory that will proxy instances of the supplied type.
Since:
1.0

proxy

public static <T> Decorating.DecoratingWith<T> proxy(Class<T> primaryType,
                                                     Class<?>... types)
Creates a factory for proxy instances that allow decoration.

Parameters:
primaryType - the primary type implemented by the proxy
types - other types that are implemented by the proxy
Returns:
a factory that will proxy instances of the supplied type.
Since:
1.0

proxy

public static <U> Decorating.DecoratingVisitor<U,U> proxy(U delegate)
Creates a factory for proxy instances that allow decoration.

Parameters:
delegate - the delegate
Returns:
a factory that will proxy instances of the supplied type.
Since:
1.0

proxy

public static <U,T> Decorating.DecoratingVisitor<U,T> proxy(U delegate,
                                                            Class<T> type)
Creates a factory for proxy instances that allow decoration.

Parameters:
delegate - the delegate
type - the type of the proxy when it is finally created.
Returns:
a factory that will proxy instances of the supplied type.
Since:
1.0

proxy

public static <U,T> Decorating.DecoratingVisitor<U,T> proxy(U delegate,
                                                            Class<T> primaryType,
                                                            Class<?>... types)
Creates a factory for proxy instances that allow decoration.

Parameters:
delegate - the delegate
primaryType - the primary type implemented by the proxy
types - other types that are implemented by the proxy
Returns:
a factory that will proxy instances of the supplied type.
Since:
1.0


Copyright © 2005-2010 Codehaus. All Rights Reserved.