org.apache.tuscany.common.monitor.impl
Class JavaLoggingMonitorFactory
java.lang.Object
org.apache.tuscany.common.monitor.impl.JavaLoggingMonitorFactory
- All Implemented Interfaces:
- MonitorFactory
public class JavaLoggingMonitorFactory
- extends Object
- implements MonitorFactory
A factory for monitors that forwards events to a Java Logging (JSR47) Logger
.
- Version:
- $Rev: 408581 $ $Date: 2006-05-21 23:34:24 -0700 (Sun, 21 May 2006) $
- See Also:
java.util.logging
Constructor Summary |
JavaLoggingMonitorFactory(Properties levels,
Level defaultLevel,
String bundleName)
Construct a MonitorFactory that will monitor the specified methods at the specified levels
and generate messages using java.util.logging. |
Method Summary |
|
getMonitor(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 |
JavaLoggingMonitorFactory
public JavaLoggingMonitorFactory(Properties levels,
Level defaultLevel,
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 methodsdefaultLevel
- the default log level to usebundleName
- the name of a resource bundle that will be passed to the logger- See Also:
Logger
getMonitor
public <T> T getMonitor(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
-