|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.thoughtworks.proxy.toys.decorate.InvocationDecoratorSupport
com.thoughtworks.proxy.toys.echo.EchoDecorator
public class EchoDecorator
A InvocationDecoratorSupport implementation that echoes any invocation to a PrintWriter.
The implementation will try to create new proxies for every return value, that can be proxied by the
ProxyFactory in use.
| Constructor Summary | |
|---|---|
EchoDecorator(PrintWriter out,
ProxyFactory factory)
Construct an EchoingDecorator. |
|
| Method Summary | |
|---|---|
Object[] |
beforeMethodStarts(Object proxy,
Method method,
Object[] args)
Called before a method is invoked on an object, to possibly decorate the arguments being passed to the method invocation. |
Exception |
decorateInvocationException(Object proxy,
Method method,
Object[] args,
Exception cause)
Called when a method cannot be invoked, to possibly decorate the type of error. |
Object |
decorateResult(Object proxy,
Method method,
Object[] args,
Object result)
Called on the way back from a method invocation, to possibly decorate the result. |
Throwable |
decorateTargetException(Object proxy,
Method method,
Object[] args,
Throwable cause)
Called when a called method fails, to possibly decorate the type of error. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EchoDecorator(PrintWriter out,
ProxyFactory factory)
out - the PrintWriter receving the logsfactory - the ProxyFactory to use| Method Detail |
|---|
public Object[] beforeMethodStarts(Object proxy,
Method method,
Object[] args)
InvocationDecorator
beforeMethodStarts in interface InvocationDecoratorbeforeMethodStarts in class InvocationDecoratorSupportproxy - the proxy the method will be invoked onmethod - the method to be invokedargs - the arguments being passed to the method
public Object decorateResult(Object proxy,
Method method,
Object[] args,
Object result)
InvocationDecorator
decorateResult in interface InvocationDecoratordecorateResult in class InvocationDecoratorSupportproxy - the proxy the method was be invoked onmethod - the invoked methodargs - the arguments passed to the methodresult - the result of the method invocation
public Throwable decorateTargetException(Object proxy,
Method method,
Object[] args,
Throwable cause)
InvocationDecorator
decorateTargetException in interface InvocationDecoratordecorateTargetException in class InvocationDecoratorSupportproxy - the proxy the method was be invoked onmethod - the invoked methodargs - the arguments passed to the methodcause - the original exception thrown
public Exception decorateInvocationException(Object proxy,
Method method,
Object[] args,
Exception cause)
InvocationDecorator
decorateInvocationException in interface InvocationDecoratordecorateInvocationException in class InvocationDecoratorSupportproxy - the proxy the method was be invoked onmethod - the invoked methodargs - the arguments passed to the methodcause - the original exception thrown
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||