Search in sources :

Example 11 with Deactivate

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

the class EntityhubLinkingEngine method deactivate.

/**
     * Deactivates this components. 
     */
@Deactivate
protected void deactivate(ComponentContext context) {
    //TODO: 
    //* unregister service
    ServiceRegistration reg = engineRegistration;
    if (reg != null) {
        reg.unregister();
        engineRegistration = null;
    }
    //* reset engine
    entityLinkingEngine = null;
    engineMetadata = null;
    labelTokenizerTracker.close();
    labelTokenizerTracker = null;
    //close the tracking EntitySearcher
    entitySearcher.close();
    entitySearcher = null;
}
Also used : ServiceRegistration(org.osgi.framework.ServiceRegistration) Deactivate(org.apache.felix.scr.annotations.Deactivate)

Aggregations

Deactivate (org.apache.felix.scr.annotations.Deactivate)11 ServiceRegistration (org.osgi.framework.ServiceRegistration)6 Session (javax.jcr.Session)2 ExecutorCloser (org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser)2 Closeable (java.io.Closeable)1 LinkedList (java.util.LinkedList)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)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 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