Tuscany Common

org.apache.tuscany.common.monitor.impl
Class JavaLoggingMonitorFactory

java.lang.Object
  extended by org.apache.tuscany.common.monitor.impl.JavaLoggingMonitorFactory
All Implemented Interfaces:
MonitorFactory

public class JavaLoggingMonitorFactory
extends java.lang.Object
implements MonitorFactory

A factory for monitors that forwards events to a Java Logging (JSR47) Logger.

Version:
$Rev: 392626 $ $Date: 2006-04-08 19:01:03 -0400 (Sat, 08 Apr 2006) $
See Also:
java.util.logging

Constructor Summary
JavaLoggingMonitorFactory(java.util.Properties levels, java.util.logging.Level defaultLevel, java.lang.String bundleName)
          Construct a MonitorFactory that will monitor the specified methods at the specified levels and generate messages using java.util.logging.
 
Method Summary
<T> T
getMonitor(java.lang.Class<T> monitorInterface)
          Return a monitor for a component's monitor interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaLoggingMonitorFactory

public JavaLoggingMonitorFactory(java.util.Properties levels,
                                 java.util.logging.Level defaultLevel,
                                 java.lang.String bundleName)
Construct a MonitorFactory that will monitor the specified methods at the specified levels and generate messages using java.util.logging.

The supplied Properties can be used to specify custom log levels for specific monitor methods. The key should be the method name in form returned by Class.getName() + '#' + Method.getName() and the value the log level to use as defined by Level.

Parameters:
levels - definition of custom levels for specific monitored methods
defaultLevel - the default log level to use
bundleName - the name of a resource bundle that will be passed to the logger
See Also:
Logger
Method Detail

getMonitor

public <T> T getMonitor(java.lang.Class<T> monitorInterface)
Description copied from interface: MonitorFactory
Return a monitor for a component's monitor interface.

Specified by:
getMonitor in interface MonitorFactory
Parameters:
monitorInterface - the component's monitoring interface
Returns:
an implementation of the monitoring interface; will not be null

Tuscany Common

-