Class ComponentSupport
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.ComponentSupport
-
-
Constructor Summary
Constructors Modifier Constructor Description privateComponentSupport()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddestroy(Object obj)If the given object is not null and an instance ofDestructableComponent, then this method calls the given object'sDestructableComponent.destroy()method.static voidifDestroyedThrowDestroyedComponentException(DestructableComponent component)Checks if a component is destroyed and, if so, throws aDestroyedComponentException.static voidifInitializedThrowUnmodifiabledComponentException(InitializableComponent component)Checks if a component has been initialized and, if so, throws aUnmodifiableComponentException.static voidifNotInitializedThrowUninitializedComponentException(InitializableComponent component)Checks 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.
-
-
-
Method Detail
-
destroy
public static void destroy(@Nullable Object obj)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
public static void initialize(@Nullable Object obj) throws ComponentInitializationExceptionIf 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
-
-