public class Decorating
extends java.lang.Object
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.
com.thoughtworks.proxy.toys.decorate
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
object(java.lang.Class[] types,
java.lang.Object delegate,
InvocationDecorator decorator)
Create a decorating proxy implementing specific types.
|
static java.lang.Object |
object(java.lang.Class[] types,
java.lang.Object delegate,
InvocationDecorator decorator,
ProxyFactory factory)
Create a decorating proxy implementing specific types using a provided
ProxyFactory . |
static java.lang.Object |
object(java.lang.Class type,
java.lang.Object delegate,
InvocationDecorator decorator)
Create a decorating proxy implementing a specific type.
|
public static java.lang.Object object(java.lang.Class type, java.lang.Object delegate, InvocationDecorator decorator)
type
- the type of the created proxy.delegate
- the decorated object.decorator
- the decorator instance.public static java.lang.Object object(java.lang.Class[] types, java.lang.Object delegate, InvocationDecorator decorator)
types
- the types of the created proxy.delegate
- the decorated object.decorator
- the decorator instance.public static java.lang.Object object(java.lang.Class[] types, java.lang.Object delegate, InvocationDecorator decorator, ProxyFactory factory)
ProxyFactory
.types
- the types of the created proxy.delegate
- the decorated object.decorator
- the decorator instance.factory
- the ProxyFactory to use for the proxy generation.