...
- Strongly-typed monitoring interfaces and eventsEvent-based monitoring
- High performance logging (millions of events per second) with no garbage creation for latency-sensitive appications
- Dynamic event level adjustment
...
To use the monitoring framework in application code , do the following: defining entails two things, creating a monitor interface and injecting the monitor in a component.
Define a Monitoring Interface.
The monitoring monitor interface is used for sending monitoring events. The interface defines expected operations for publishing events and , monitoring levels using methods on the interfaceand optional event message templates:
Code Block | ||||
---|---|---|---|---|
| ||||
import org.fabric3.api.annotation.monitor.Severe; import org.fabric3.api.annotation.monitor.Debug; public inteface ComponentMonitor @Severe void error(String message, Throwable t); @Debug ("Received request {0}") void receivedRequest(String id); } |
...
Performance Considerations
By default, Fabric3 uses JDK proxies to implement monitor interfaces. For most code paths in an application, this should not introduce significant performance impact as there are optimizations to avoid object creation when events are discarded. However, for performance intensive code paths, JDK proxies may introduce too much overhead. As an alternative, Fabric3 provides the org.fabric3.api.MonitorChannel interface. A monitor can be typed with this interface, which bypasses JDK proxies and instead uses static method calls:
...
.
...