public interface ClassDeactivator extends Serializable
DeltaSpike allows you to deactivate pre-configured parts (like Extensions, event-broadcasters,...).
Therefore DeltaSpike offers ClassDeactivator
and Deactivatable
.
A ClassDeactivator
allows to specify deactivated classes (if they implement Deactivatable
)
which can't be deactivated/customized via std. CDI mechanisms
(like the veto-method or alternative/specialized CDI-beans).
This might be the case e.g. for CDI Extensions because CDI mechanisms are not available at startup time.
Use it mainly to deactivate specific parts explicitly (blacklist approach), if there is an issue with such parts (and waiting for the next release isn't an option).
A class-deactivator will be resolved from the environment via the default resolvers or via a custom resolver which
allows to use any type of configuration-format. See ConfigResolver
for more information about how to configure it. The configuration key is
org.apache.deltaspike.core.spi.activation.ClassDeactivator
All ClassDeactivators will get picked up in order of their ordinal and might explicitly activate or
deactivate Deactivatable
classes. Returning a null
value means that the ClassDeactivator
doesn't care about the Deactivatable class.
An implementation has to be stateless.
Modifier and Type | Method and Description |
---|---|
Boolean |
isActivated(Class<? extends Deactivatable> targetClass)
Provides classes which should be deactivated.
|
Boolean isActivated(Class<? extends Deactivatable> targetClass)
targetClass
- class which should be checkedBoolean.FALSE
if class should get activated, Boolean.FALSE
if class must be available
and null
to let it as is (defined by default or otherCopyright © 2020 The Apache Software Foundation. All rights reserved.