synchronized void activate ( ComponentContext componentContext ) throws Exception { this . componentContext = componentContext ; this . classAvailableTransformer = new ClassAvailableTransformer ( this , instrumentation , includeBootstrap ) ; this . transformer = new ProbeClassFileTransformer ( this , instrumentation , includeBootstrap ) ; this . proxyActivator = new MonitoringProxyActivator ( componentContext . getBundleContext ( ) , this , this . instrumentation ) ; this . proxyActivator . activate ( ) ; // The class available transformer is registered as retransform incapable // to avoid having to keep track of which classes have been updated with // static initializers and serialVersionUID fields. The probe transformer // however, must run through the listener config every time a retransform // occurs to allow it to discover new probes and replace currently active // probes //RTCD 89497-Update the set with the classes for ( Class < ? > clazz : MonitoringUtility . loadMonitoringClasses ( componentContext . getBundleContext ( ) . getBundle ( ) ) ) { for ( int i = 0 ; i < clazz . getMethods ( ) . length ; i ++ ) { Annotation anno = ( ( clazz . getMethods ( ) [ i ] ) . getAnnotation ( ProbeSite . class ) ) ; if ( anno != null ) { String temp = ( ( ProbeSite ) anno ) . clazz ( ) ; probeMonitorSet . add ( temp ) ; } } } //Update to the set ended. //RTC D89497 adding instrumentors moved below as the MonitoringUtility.loadMonitoringClasses //was resulting in loading classes and in turn getting called during with transform process which //might cause hang in some situations this . instrumentation . addTransformer ( this . transformer , true ) ; this . instrumentation . addTransformer ( this . classAvailableTransformer ) ; // We're active so if we have any listeners, we can run down the loaded // classes. for ( Class < ? > clazz : this . instrumentation . getAllLoadedClasses ( ) ) { classAvailable ( clazz ) ; } }
Activation callback from the Declarative Services runtime where the component is ready for activation .