org.apache.hivemind.management.impl
Class PerformanceMonitorFactory

java.lang.Object
  extended by org.apache.hivemind.management.impl.PerformanceMonitorFactory
All Implemented Interfaces:
org.apache.hivemind.ServiceInterceptorFactory

public class PerformanceMonitorFactory
extends java.lang.Object
implements org.apache.hivemind.ServiceInterceptorFactory

Interceptor factory that adds a MBean based performance monitor to a service. The interceptor collects the number of calls, and the duration for each intercepted method. The results are delegated to an MBean that is created and registered in the MBeanServer. Which methods are intercepted can be defined like in the logging interceptor

Since:
1.1
Author:
Achim Huegen

Constructor Summary
PerformanceMonitorFactory(MBeanRegistry mbeanRegistry, ObjectNameBuilder objectNameBuilder)
           
 
Method Summary
 void createInterceptor(org.apache.hivemind.InterceptorStack stack, org.apache.hivemind.internal.Module invokingModule, java.util.List parameters)
           
 PerformanceCollector createMBean(org.apache.hivemind.internal.ServicePoint servicePoint, java.util.Set methods)
          Creates and registers the MBean that holds the performance data.
protected  java.util.Set getInterceptedMethods(org.apache.hivemind.InterceptorStack stack, java.util.List parameters)
          Returns the methods that must be intercepted.
 void setServiceId(java.lang.String string)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerformanceMonitorFactory

public PerformanceMonitorFactory(MBeanRegistry mbeanRegistry,
                                 ObjectNameBuilder objectNameBuilder)
Method Detail

setServiceId

public void setServiceId(java.lang.String string)

createInterceptor

public void createInterceptor(org.apache.hivemind.InterceptorStack stack,
                              org.apache.hivemind.internal.Module invokingModule,
                              java.util.List parameters)
Specified by:
createInterceptor in interface org.apache.hivemind.ServiceInterceptorFactory

createMBean

public PerformanceCollector createMBean(org.apache.hivemind.internal.ServicePoint servicePoint,
                                        java.util.Set methods)
                                 throws javax.management.JMException
Creates and registers the MBean that holds the performance data.

Throws:
javax.management.JMException

getInterceptedMethods

protected java.util.Set getInterceptedMethods(org.apache.hivemind.InterceptorStack stack,
                                              java.util.List parameters)
Returns the methods that must be intercepted. Which methods are intercepted is controled by the interceptor parameters via include and exclude mechanism