org.apache.qpid.server.util
Class LoggingProxy

java.lang.Object
  extended by org.apache.qpid.server.util.LoggingProxy
All Implemented Interfaces:
InvocationHandler

public class LoggingProxy
extends Object
implements InvocationHandler

Dynamic proxy that records invocations in a fixed size circular buffer, dumping details on hitting an exception.

Useful in debugging.


Constructor Summary
LoggingProxy(Object target, int size)
           
 
Method Summary
(package private)  void dump()
           
(package private)  CircularBuffer getBuffer()
           
 int getBufferSize()
           
 Object getProxy(Class... c)
           
 Object invoke(Object proxy, Method method, Object[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingProxy

public LoggingProxy(Object target,
                    int size)
Method Detail

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

dump

void dump()

getBuffer

CircularBuffer getBuffer()

getProxy

public Object getProxy(Class... c)

getBufferSize

public int getBufferSize()


Licensed to the Apache Software Foundation