LoggingProxy (fawkeZ - Developer's Documentation)

org.jcoderz.commons.util
Class LoggingProxy

  extended by org.jcoderz.commons.util.LoggingProxy
All Implemented Interfaces:

public final class LoggingProxy
extends
implements

This class can be used to proxy any object, providing entering and exiting logging for all interfaces of the object.

Note: Java Dynamic Proxies only work on interfaces. The object returned by the getProxy(Object) can be cast to any interface implemented by the argument or one of its ancestors. It can't, however, be cast to an implementation class.

Author:
Albrecht Messner

Method Summary
static  getProxy( obj)
          Static factory that wraps an object into a proxy depending on the log level for that object.
  invoke( proxy,  method, [] args)
          Log the entering, exiting and throwing events of the proxied object.
 
Methods inherited from class java.lang.
, , , , , , , , , ,
 

Method Detail

getProxy

public static  getProxy( obj)
Static factory that wraps an object into a proxy depending on the log level for that object.

Parameters:
obj - an object for which a proxy should be created
Returns:
a logging proxy for the obj, if the log level for that object is FINER or finest, the object itself otherwise

invoke

public  invoke( proxy,
                      method,
                     [] args)
              throws 
Log the entering, exiting and throwing events of the proxied object.

Specified by:
in interface
Throws:
See Also:


Copyright 2007 The jCoderZ Project.