org.osgi.service.component.annotations.Deactivate Java Examples

The following examples show how to use org.osgi.service.component.annotations.Deactivate. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MaoRoutingManager.java    From ONOS_LoadBalance_Routing_Forward with Apache License 2.0 6 votes vote down vote up
@Deactivate
protected void deactivate() {
    packetService.removeProcessor(packetProcessor);
    packetService.cancelPackets(DefaultTrafficSelector.builder()
                    .matchEthType(Ethernet.TYPE_IPV4).build(),
            PacketPriority.REACTIVE, appId);

    intentMap.values().forEach(intent -> {
        intentService.withdraw(intent);
        intentService.purge(intent);
    });
    intentMap.clear();

    log.info("Stopped");

}
 
Example #2
Source File: TasksDSComponent.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
@Deactivate
protected void deactivate(ComponentContext ctx) {

    ScheduledExecutorService executorService = dataHolder.getTaskScheduler();
    if (executorService != null) {
        log.info("Shutting down coordinated task scheduler.");
        executorService.shutdown();
    }
    if (TasksDSComponent.getScheduler() != null) {
        try {
            TasksDSComponent.getScheduler().shutdown();
        } catch (Exception e) {
            log.error(e);
        }
    }
    executor.shutdown();
    taskService = null;
}
 
Example #3
Source File: ServiceBusInitializer.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
@Deactivate
protected void deactivate(ComponentContext ctxt) {
    if (Objects.nonNull(transactionCountHandlerComponent)) {
        transactionCountHandlerComponent.cleanup();
    }
    if (Objects.nonNull(transactionCountExecutor)) {
        transactionCountExecutor.shutdownNow();
    }
    List handlers = serverManager.getServerContextInformation().getSynapseEnvironment().getSynapseHandlers();
    Iterator<SynapseHandler> iterator = handlers.iterator();
    while (iterator.hasNext()) {
        SynapseHandler handler = iterator.next();
        if ((handler instanceof AbstractExtendedSynapseHandler)) {
            AbstractExtendedSynapseHandler abstractExtendedSynapseHandler =
                    (AbstractExtendedSynapseHandler) handler;
            if (!abstractExtendedSynapseHandler.handleServerShutDown()) {
                log.warn("Server shut down not executed in the server shut down path of the " +
                        "AbstractExtendedSynapseHandler");
            }
        }
    }
    serverManager.stop();
    serverManager.shutdown();
}
 
Example #4
Source File: ModelAdapterFactory.java    From sling-org-apache-sling-models-impl with Apache License 2.0 6 votes vote down vote up
@Deactivate
protected void deactivate() {
    this.adapterCache = null;
    if (this.requestDisposalCallbacks != null) {
        for (final Disposable requestRegistries : this.requestDisposalCallbacks.values()) {
            requestRegistries.onDisposed();
        }
    }
    this.requestDisposalCallbacks = null;
    this.clearDisposalCallbackRegistryQueue();
    this.listener.unregisterAll();
    this.adapterImplementations.removeAll();
    if (jobRegistration != null) {
        jobRegistration.unregister();
        jobRegistration = null;
    }
    if (configPrinterRegistration != null) {
        configPrinterRegistration.unregister();
        configPrinterRegistration = null;
    }
}
 
Example #5
Source File: DossierGarbageCollectorScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #6
Source File: ClaimManagementServiceComponent.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
/**
 * @param ctxt
 */
@Deactivate
protected void deactivate(ComponentContext ctxt) {
    if (log.isDebugEnabled()) {
        log.debug("Claim Management bundle is deactivated");
    }
}
 
Example #7
Source File: EntitlementServiceComponent.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
/**
 * @param ctxt
 */
@Deactivate
protected void deactivate(ComponentContext ctxt) {
    if (log.isDebugEnabled()) {
        log.debug("Identity Entitlement bundle is deactivated");
    }
}
 
Example #8
Source File: CORSManagementServiceComponent.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
/**
 * Deactivate the CORSManagementServiceComponent.
 *
 * @param context
 */
@Deactivate
protected void deactivate(ComponentContext context) {

    if (log.isDebugEnabled()) {
        log.debug("CORSManagementServiceComponent is deactivated.");
    }
}
 
Example #9
Source File: FrameworkServiceComponent.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
@Deactivate
protected void deactivate(ComponentContext ctxt) {

    if (log.isDebugEnabled()) {
        log.debug("Application Authentication Framework bundle is deactivated");
    }

    FrameworkServiceDataHolder.getInstance().setBundleContext(null);
    SessionDataStore.getInstance().stopService();
}
 
Example #10
Source File: RemoteResourceProviderFactory.java    From sling-whiteboard with Apache License 2.0 5 votes vote down vote up
@Deactivate
private void deactivate() {
    for (RegistrationMapping mapping : mappings.values()) {
        mapping.resourceProviderServiceRegistration.unregister();
    }
    mappings.clear();
}
 
Example #11
Source File: ApplicationMgtUIServiceComponent.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
@Deactivate
protected void deactivate(ComponentContext context) {

    if (log.isDebugEnabled()) {
        log.debug("Application Management UI bundle is deactivated");
    }
}
 
Example #12
Source File: Daily.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #13
Source File: DossierStatisticEngine.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #14
Source File: Hourly.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #15
Source File: PersonStatisticSheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #16
Source File: FifteenMinutes.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #17
Source File: FiveMinute.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #18
Source File: OneMinute.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #19
Source File: IdentityProvisionServiceComponent.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
/**
 * @param context
 */
@Deactivate
protected void deactivate(ComponentContext context) {
    if (log.isDebugEnabled()) {
        log.debug("Identity Provision bundle is de-activated");
    }
}
 
Example #20
Source File: StatisticsReportScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #21
Source File: RegistrationSyncScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #22
Source File: ActionOverdueScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #23
Source File: TemplateMgtUIServiceComponent.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
@Deactivate
protected void deactivate(ComponentContext context) {

    if (log.isDebugEnabled()) {
        log.debug("Template Management UI bundle is deactivated");
    }
}
 
Example #24
Source File: ThriftAuthenticationServiceComponent.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
@Deactivate
protected void deactivate(ComponentContext compCtx) {
    if (TCPThriftAuthenticationService != null) {
        TCPThriftAuthenticationService.stop();
    }
    compCtx.getBundleContext().ungetService(thriftAuthenticationService.getReference());
}
 
Example #25
Source File: GarbageGroupDossierScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #26
Source File: DossierSyncProcessingScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #27
Source File: TimerScheduler.java    From opencps-v2 with GNU Affero General Public License v3.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
	if (_initialized) {
		try {
			_schedulerEngineHelper.unschedule(_schedulerEntryImpl, getStorageType());
	    } catch (SchedulerException se) {
	        if (_log.isWarnEnabled()) {
	        	_log.warn("Unable to unschedule trigger", se);
	        }
	    }

	      _schedulerEngineHelper.unregister(this);
	}
	_initialized = false;
}
 
Example #28
Source File: UserStoreConfigComponent.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
/**
 * @param ctxt
 */
@Deactivate
protected void deactivate(ComponentContext ctxt) {
    if (log.isDebugEnabled()) {
        log.debug("Identity User Store-Config bundle is deactivated");
    }
}
 
Example #29
Source File: MainComponent.java    From onos-p4-tutorial with Apache License 2.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
    configRegistry.unregisterConfigFactory(srv6ConfigFactory);

    cleanUp();

    log.info("Stopped");
}
 
Example #30
Source File: Ipv6RoutingComponent.java    From onos-p4-tutorial with Apache License 2.0 5 votes vote down vote up
@Deactivate
protected void deactivate() {
    hostService.removeListener(hostListener);
    linkService.removeListener(linkListener);
    deviceService.removeListener(deviceListener);

    log.info("Stopped");
}