use of aQute.bnd.annotation.component.Deactivate in project predix-machine-template-adapter-edison by PredixDev.
the class IntelBoardSubscriptionMachineAdapter method deactivate.
/**
* OSGi component lifecycle deactivation method
*
* @param ctx
* component context
*/
@Deactivate
public void deactivate(ComponentContext ctx) {
// Put your clean up code here when container is shutting down
if (_logger.isDebugEnabled()) {
//$NON-NLS-1$
_logger.debug("Stopped sample for " + ctx.getBundleContext().getBundle().getSymbolicName());
}
Collection<WorkshopDataSubscription> values = this.dataSubscriptions.values();
// Stop random data generation thread.
for (WorkshopDataSubscription sub : values) {
sub.stop();
}
this.adapterState = MachineAdapterState.Stopped;
}
Aggregations