Class ComponentSupport
java.lang.Object
net.shibboleth.utilities.java.support.component.ComponentSupport
Support class for working with
Component objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidIf the given object is not null and an instance ofDestructableComponent, then this method calls the given object'sDestructableComponent.destroy()method.static voidChecks if a component is destroyed and, if so, throws aDestroyedComponentException.static voidChecks if a component has been initialized and, if so, throws aUnmodifiableComponentException.static voidChecks if a component has not been initialized and, if so, throw)s aUninitializedComponentException.static voidinitialize(Object obj) If the given object is not null and an instance ofInitializableComponent, then this method calls the given object'sInitializableComponent.initialize()method.
-
Constructor Details
-
ComponentSupport
private ComponentSupport()Constructor.
-
-
Method Details
-
destroy
If the given object is not null and an instance ofDestructableComponent, then this method calls the given object'sDestructableComponent.destroy()method.- Parameters:
obj- object to destroy, may be null
-
initialize
If the given object is not null and an instance ofInitializableComponent, then this method calls the given object'sInitializableComponent.initialize()method.- Parameters:
obj- object to initialize, may be null- Throws:
ComponentInitializationException- thrown if there is a problem initializing the object
-
ifDestroyedThrowDestroyedComponentException
public static void ifDestroyedThrowDestroyedComponentException(@Nonnull DestructableComponent component) Checks if a component is destroyed and, if so, throws aDestroyedComponentException. If the component is also an instance ofIdentifiedComponent, the component's ID is included in the error message.- Parameters:
component- component to check
-
ifNotInitializedThrowUninitializedComponentException
public static void ifNotInitializedThrowUninitializedComponentException(@Nonnull InitializableComponent component) Checks if a component has not been initialized and, if so, throw)s aUninitializedComponentException. If the component is also an instance ofIdentifiedComponent, the component's ID is included in the error message.- Parameters:
component- component to check
-
ifInitializedThrowUnmodifiabledComponentException
public static void ifInitializedThrowUnmodifiabledComponentException(@Nonnull InitializableComponent component) Checks if a component has been initialized and, if so, throws aUnmodifiableComponentException. If the component is also an instance ofIdentifiedComponent, the component's ID is included in the error message.- Parameters:
component- component to check
-