@ Deactivate protected void deactivate ( ComponentContext componentContext ) { // Remove the framework event adapter bundleContext . removeFrameworkListener ( frameworkEventAdapter ) ; frameworkEventAdapter = null ; // Remove the bundle event adapter bundleContext . removeBundleListener ( bundleEventAdapter ) ; bundleEventAdapter = null ; // Remove the service event adapter bundleContext . removeServiceListener ( serviceEventAdapter ) ; serviceEventAdapter = null ; bundleContext = null ; this . componentContext = null ; }
Deactivate the EventAdmin service . This method will be called by the OSGi Declarative Services implementation when the component is deactivated . Deactivation will occur when the service configuration needs to be refreshed when the bundle is stopped or when the DS implementation is stopped .