Search in sources :

Example 1 with Deactivate

use of org.apache.felix.scr.annotations.Deactivate in project sling by apache.

the class AsyncHealthCheckExecutor method deactivate.

@Deactivate
protected final void deactivate(final ComponentContext componentContext) {
    this.bundleContext.removeServiceListener(this);
    this.bundleContext = null;
    LOG.debug("Unscheduling {} jobs for asynchronous health checks", registeredJobs.size());
    for (HealthCheckMetadata healthCheckDescriptor : new LinkedList<HealthCheckMetadata>(registeredJobs.keySet())) {
        unscheduleHealthCheck(healthCheckDescriptor);
    }
}
Also used : HealthCheckMetadata(org.apache.sling.hc.util.HealthCheckMetadata) LinkedList(java.util.LinkedList) Deactivate(org.apache.felix.scr.annotations.Deactivate)

Example 2 with Deactivate

use of org.apache.felix.scr.annotations.Deactivate in project sling by apache.

the class LogTracer method deactivate.

@Deactivate
private void deactivate() {
    if (logServlet != null) {
        logServlet.unregister();
    }
    if (slingFilterRegistration != null) {
        slingFilterRegistration.unregister();
        slingFilterRegistration = null;
    }
    if (filterRegistration != null) {
        filterRegistration.unregister();
        filterRegistration = null;
    }
    ServiceRegistration reg = logCollectorReg.getAndSet(null);
    if (reg != null) {
        reg.unregister();
    }
    requestContextHolder.remove();
}
Also used : ServiceRegistration(org.osgi.framework.ServiceRegistration) Deactivate(org.apache.felix.scr.annotations.Deactivate)

Example 3 with Deactivate

use of org.apache.felix.scr.annotations.Deactivate in project sling by apache.

the class WorkspaceCreator method deactivate.

@SuppressWarnings("unused")
@Deactivate
private void deactivate() {
    Session s = null;
    try {
        s = repo.loginAdministrative(null);
        Workspace w = s.getWorkspace();
        deleteWorkspace(w, "ws3");
        deleteWorkspace(w, "ws2");
        deleteWorkspace(w, "ws1");
    } catch (Exception e) {
    // ignore
    } finally {
        if (s != null) {
            s.logout();
        }
    }
}
Also used : Session(javax.jcr.Session) Workspace(javax.jcr.Workspace) Deactivate(org.apache.felix.scr.annotations.Deactivate)

Example 4 with Deactivate

use of org.apache.felix.scr.annotations.Deactivate in project jackrabbit-oak by apache.

the class LuceneIndexProviderService method deactivate.

@Deactivate
private void deactivate() throws InterruptedException, IOException {
    for (ServiceRegistration reg : regs) {
        reg.unregister();
    }
    for (Registration reg : oakRegs) {
        reg.unregister();
    }
    if (backgroundObserver != null) {
        backgroundObserver.close();
    }
    if (externalIndexObserver != null) {
        externalIndexObserver.close();
    }
    if (indexProvider != null) {
        indexProvider.close();
        indexProvider = null;
    }
    if (documentQueue != null) {
        documentQueue.close();
    }
    if (nrtIndexFactory != null) {
        nrtIndexFactory.close();
    }
    // Close the copier first i.e. before executorService
    if (indexCopier != null) {
        indexCopier.close();
    }
    if (executorService != null) {
        executorService.shutdown();
        executorService.awaitTermination(1, TimeUnit.MINUTES);
    }
    if (extractedTextCache != null) {
        extractedTextCache.close();
    }
    InfoStream.setDefault(InfoStream.NO_OUTPUT);
}
Also used : ServiceRegistration(org.osgi.framework.ServiceRegistration) Registration(org.apache.jackrabbit.oak.spi.whiteboard.Registration) ServiceRegistration(org.osgi.framework.ServiceRegistration) Deactivate(org.apache.felix.scr.annotations.Deactivate)

Example 5 with Deactivate

use of org.apache.felix.scr.annotations.Deactivate in project acs-aem-commons by Adobe-Consulting-Services.

the class AbstractDispatcherCacheHeaderFilter method deactivate.

@Deactivate
protected final void deactivate(ComponentContext context) {
    for (Iterator<ServiceRegistration> it = filterRegistrations.iterator(); it.hasNext(); ) {
        ServiceRegistration registration = it.next();
        registration.unregister();
        it.remove();
    }
}
Also used : ServiceRegistration(org.osgi.framework.ServiceRegistration) Deactivate(org.apache.felix.scr.annotations.Deactivate)

Aggregations

Deactivate (org.apache.felix.scr.annotations.Deactivate)10 ServiceRegistration (org.osgi.framework.ServiceRegistration)5 Session (javax.jcr.Session)2 LinkedList (java.util.LinkedList)1 Workspace (javax.jcr.Workspace)1 EventListener (javax.jcr.observation.EventListener)1 IRI (org.apache.clerezza.commons.rdf.IRI)1 Registration (org.apache.jackrabbit.oak.spi.whiteboard.Registration)1 LoginException (org.apache.sling.api.resource.LoginException)1 ModifiableValueMap (org.apache.sling.api.resource.ModifiableValueMap)1 PersistenceException (org.apache.sling.api.resource.PersistenceException)1 Resource (org.apache.sling.api.resource.Resource)1 ResourceResolver (org.apache.sling.api.resource.ResourceResolver)1 HealthCheckMetadata (org.apache.sling.hc.util.HealthCheckMetadata)1 NoSuchRecipeException (org.apache.stanbol.rules.base.api.NoSuchRecipeException)1 Recipe (org.apache.stanbol.rules.base.api.Recipe)1 RecipeConstructionException (org.apache.stanbol.rules.base.api.RecipeConstructionException)1 RecipeEliminationException (org.apache.stanbol.rules.base.api.RecipeEliminationException)1