Package net.shibboleth.shared.component
Class AbstractInitializableComponent
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent
- Direct Known Subclasses:
AbstractIdentifiedInitializableComponent,BasicHttpServletRequestContentTypeValidator,BasicHttpServletRequestMethodValidator,BasicHttpServletRequestParametersValidator,BasicKeystoreKeyStrategy,BasicParserPool,ChainingHttpServletRequestValidator,CookieManager,DataSealer,EncryptedCookieManager,EvaluableScript,IdentifiedComponentManager,ReloadableServiceGaugeSet,ScriptedKeyStrategy
@ThreadSafe
public abstract class AbstractInitializableComponent
extends Object
implements DestructableComponent, InitializableComponent
Base class for things that implement
DestructableComponent and InitializableComponent.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether this component has been destroyed.private booleanWhether this component has been initialized.private static org.slf4j.LoggerUsed for "user after teardown" warnings only -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidHelper for any method to throw appropriate exceptions if we are either not initialized, or have been destroyed.protected final voidHelper for a setter method to check the standard preconditions.final voiddestroy()Deprecated, for removal: This API element is subject to removal in a future version.protected voidDeprecated, for removal: This API element is subject to removal in a future version.protected voidPerforms the initialization of the component.private static org.slf4j.LoggergetLog()Lazy init a logger.protected voidDeprecated, for removal: This API element is subject to removal in a future version.protected voidChecks if a component has been initialized and, if so, throws aUnmodifiableComponentException.protected voidChecks if a component has not been initialized and, if so, throws aUninitializedComponentException.final voidInitializes the component.final booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanGets whether this component is initialized.
-
Field Details
-
isDestroyed
private boolean isDestroyedWhether this component has been destroyed. -
isInitialized
private boolean isInitializedWhether this component has been initialized. -
theLog
private static org.slf4j.Logger theLogUsed for "user after teardown" warnings only
-
-
Constructor Details
-
AbstractInitializableComponent
public AbstractInitializableComponent()
-
-
Method Details
-
isDestroyed
Deprecated, for removal: This API element is subject to removal in a future version.Gets whether this component has been destroyed. Normally, once a component has been destroyed it cannot be used.- Specified by:
isDestroyedin interfaceDestructableComponent- Returns:
- true iff the component has been destroyed
-
isInitialized
public boolean isInitialized()Gets whether this component is initialized.- Specified by:
isInitializedin interfaceInitializableComponent- Returns:
- true iff this component is initialized
-
destroy
Deprecated, for removal: This API element is subject to removal in a future version.Destroys the component.- Specified by:
destroyin interfaceDestructableComponent
-
initialize
Initializes the component.- Specified by:
initializein interfaceInitializableComponent- Throws:
ComponentInitializationException- thrown if there is a problem initializing the component
-
ifDestroyedThrowDestroyedComponentException
@Deprecated(forRemoval=true, since="9.3") protected void ifDestroyedThrowDestroyedComponentException()Deprecated, for removal: This API element is subject to removal in a future version.Checks if the component is destroyed and, if so, throws aDestroyedComponentException.This will be removed in V6.0.
-
ifNotInitializedThrowUninitializedComponentException
protected void ifNotInitializedThrowUninitializedComponentException()Checks if a component has not been initialized and, if so, throws aUninitializedComponentException. -
ifInitializedThrowUnmodifiabledComponentException
protected void ifInitializedThrowUnmodifiabledComponentException()Checks if a component has been initialized and, if so, throws aUnmodifiableComponentException. -
checkSetterPreconditions
protected final void checkSetterPreconditions()Helper for a setter method to check the standard preconditions. -
checkComponentActive
protected final void checkComponentActive()Helper for any method to throw appropriate exceptions if we are either not initialized, or have been destroyed. -
doDestroy
Deprecated, for removal: This API element is subject to removal in a future version.Performs component specific destruction logic. This method is executed within the lock on the object being destroyed. The default implementation of this method is a no-op.This will be removed in V6.0. Replacement is The
OnTeardownannotation. -
doInitialize
Performs the initialization of the component. This method is executed within the lock on the object being initialized. The default implementation of this method is a no-op.- Throws:
ComponentInitializationException- thrown if there is a problem initializing the component
-
getLog
private static org.slf4j.Logger getLog()Lazy init a logger.- Returns:
- the logger.
-