Search in sources :

Example 1 with Deactivatable

use of org.apache.deltaspike.core.spi.activation.Deactivatable in project deltaspike by apache.

the class ClassDeactivationUtils method performProjectStageDependentCleanup.

private static void performProjectStageDependentCleanup() {
    ProjectStage currentProjectStage = ProjectStageProducer.getInstance().getProjectStage();
    if (previouslyDetectedProjectStage != currentProjectStage) {
        previouslyDetectedProjectStage = currentProjectStage;
        //don't use #clear to support parallel access to #isActivated (+ reset) without synchronization
        activationStatusCache = new ConcurrentHashMap<Class<? extends Deactivatable>, Boolean>();
        //#clear is ok here due to the handling in the synchronized method #initDeactivatableCacheFor
        classDeactivatorMap.clear();
    } else if (currentProjectStage == ProjectStage.UnitTest || currentProjectStage == ProjectStage.Development) {
        activationStatusCache = new ConcurrentHashMap<Class<? extends Deactivatable>, Boolean>();
    }
}
Also used : ProjectStage(org.apache.deltaspike.core.api.projectstage.ProjectStage) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Deactivatable(org.apache.deltaspike.core.spi.activation.Deactivatable)

Aggregations

ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ProjectStage (org.apache.deltaspike.core.api.projectstage.ProjectStage)1 Deactivatable (org.apache.deltaspike.core.spi.activation.Deactivatable)1