Package net.shibboleth.shared.testing
Class MockReloadableService<T>
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.shared.service.AbstractReloadableService<T>
net.shibboleth.shared.testing.MockReloadableService<T>
- Type Parameters:
T- type of component
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,ReloadableService<T>
Utility class for wrapping a serviceable component in a dummy reloadable service.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.shibboleth.shared.service.AbstractReloadableService
AbstractReloadableService.ServiceReloadTask -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SpringServiceableComponent<T>The component we are presenting to provide. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the serviceable component that this service supports.protected booleanCalled by theAbstractReloadableService<T>.ServiceReloadTaskto determine if the service should be reloaded.Methods inherited from class net.shibboleth.shared.service.AbstractReloadableService
doDestroy, doInitialize, doReload, getLastReloadAttemptInstant, getLastSuccessfulReloadInstant, getLogPrefix, getReloadCheckDelay, getReloadFailureCause, getReloadTaskTimer, isFailFast, reload, setFailFast, setReloadCheckDelay, setReloadTaskTimerMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
component
The component we are presenting to provide.
-
-
Constructor Details
-
MockReloadableService
Constructor.- Parameters:
what- component
-
-
Method Details
-
getServiceableComponent
Get the serviceable component that this service supports. If the component hasn't been successfully loaded yet or if this service does not support a ServiceableComponent, aServiceExceptionis raised.On a non-null value, the returned component will be pinned and MUST be closed. This can be done by exploiting the fact that a ServiceableComponent implements
AutoCloseable- Returns:
- the component, if appropriate.
-
shouldReload
protected boolean shouldReload()Called by theAbstractReloadableService<T>.ServiceReloadTaskto determine if the service should be reloaded.No lock is held when this method is called, so any locking needed should be handled internally.
- Specified by:
shouldReloadin classAbstractReloadableService<T>- Returns:
- true iff the service should be reloaded
-