Package net.shibboleth.shared.component
Class AbstractIdentifiedInitializableComponent
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiedComponent,InitializableComponent
- Direct Known Subclasses:
AbstractIdentifiableInitializableComponent,ConditionalResource,HTTPResource
@ThreadSafe
public abstract class AbstractIdentifiedInitializableComponent
extends AbstractInitializableComponent
implements IdentifiedComponent
Simple implementation of
InitializableComponent and IdentifiedComponent.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis method checks to ensure that the component ID is not null.final StringensureId()Return the ID of this component, guaranteeing a non-nullresult.getId()Get the ID of this component.protected final voidChecks if the component is destroyed and, if so, throws aDestroyedComponentException.protected final voidChecks if a component has been initialized and, if so, throws aUnmodifiableComponentException.protected final voidChecks if a component has not been initialized and, if so, throws aUninitializedComponentException.protected voidSets the ID of this component.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitialized
-
Field Details
-
id
The unique identifier for this component.
-
-
Constructor Details
-
AbstractIdentifiedInitializableComponent
public AbstractIdentifiedInitializableComponent()
-
-
Method Details
-
getId
Get the ID of this component.- Specified by:
getIdin interfaceIdentifiedComponent- Returns:
- ID of this component or null
-
ensureId
Return the ID of this component, guaranteeing a non-nullresult.- Returns:
- the ID of this component, never
null - Throws:
IllegalStateException- if called before the ID has been set- Since:
- 9.0.0
- See Also:
-
ifDestroyedThrowDestroyedComponentException
protected final void ifDestroyedThrowDestroyedComponentException()Checks if the component is destroyed and, if so, throws aDestroyedComponentException.- Overrides:
ifDestroyedThrowDestroyedComponentExceptionin classAbstractInitializableComponent
-
ifNotInitializedThrowUninitializedComponentException
protected final void ifNotInitializedThrowUninitializedComponentException()Checks if a component has not been initialized and, if so, throws aUninitializedComponentException.- Overrides:
ifNotInitializedThrowUninitializedComponentExceptionin classAbstractInitializableComponent
-
ifInitializedThrowUnmodifiabledComponentException
protected final void ifInitializedThrowUnmodifiabledComponentException()Checks if a component has been initialized and, if so, throws aUnmodifiableComponentException.- Overrides:
ifInitializedThrowUnmodifiabledComponentExceptionin classAbstractInitializableComponent
-
setId
Sets the ID of this component. The component must not yet be initialized.- Parameters:
componentId- ID of the component
-
doInitialize
This method checks to ensure that the component ID is not null. 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.- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException- thrown if there is a problem initializing the component
-