use of org.osgi.service.component.annotations.Deactivate in project sling by apache.
the class PostOperationProxyProvider method deactivate.
/**
* Deactivates the proxy provide component:
* <ol>
* <li>Unregister as a service listener</li>
* <li>Unregister all proxies</li>
* <li>Drop BundleContext reference</li>
* </ol>
*/
@SuppressWarnings("unused")
@Deactivate
private void deactivate() {
this.bundleContext.removeServiceListener(this);
final ServiceReference[] serviceReferences;
synchronized (this.proxies) {
serviceReferences = this.proxies.keySet().toArray(new ServiceReference[this.proxies.size()]);
}
for (ServiceReference serviceReference : serviceReferences) {
unregister(serviceReference);
}
this.bundleContext = null;
}
use of org.osgi.service.component.annotations.Deactivate in project sling by apache.
the class QueueManager method deactivate.
/**
* Deactivate this component.
*/
@Deactivate
protected void deactivate() {
logger.debug("Apache Sling Queue Manager stopping on instance {}", Environment.APPLICATION_ID);
this.configuration.removeListener(this);
final Iterator<JobQueueImpl> i = this.queues.values().iterator();
while (i.hasNext()) {
final JobQueueImpl jbq = i.next();
jbq.close();
// update mbeans
((QueuesMBeanImpl) queuesMBean).sendEvent(new QueueStatusEvent(null, jbq));
}
this.queues.clear();
this.queueServices = null;
logger.info("Apache Sling Queue Manager stopped on instance {}", Environment.APPLICATION_ID);
}
use of org.osgi.service.component.annotations.Deactivate in project sling by apache.
the class MetricsServiceImpl method deactivate.
@Deactivate
private void deactivate() throws IOException {
for (ServiceRegistration reg : regs) {
reg.unregister();
}
regs.clear();
gaugeManager.close();
metrics.clear();
if (reporter != null) {
reporter.close();
}
}
Aggregations