protected void activate ( final ComponentContext context ) throws InvalidSyntaxException { log . info ( "activate" ) ; bundleContext = context . getBundleContext ( ) ; sl = new ServiceListener ( ) { public void serviceChanged ( ServiceEvent event ) { if ( event . getType ( ) == ServiceEvent . UNREGISTERING ) { cache . unregisterComponentBindingsProvider ( event . getServiceReference ( ) ) ; } else if ( event . getType ( ) == ServiceEvent . REGISTERED ) { cache . registerComponentBindingsProvider ( event . getServiceReference ( ) ) ; } } } ; bundleContext . addServiceListener ( sl , "(" + Constants . OBJECTCLASS + "=" + ComponentBindingsProvider . class . getName ( ) + ")" ) ; reloadCache ( ) ; log . info ( "Activation successful" ) ; }
Executed when the service is activated .