T - The precise service being implemented.@ThreadSafe public class ReloadableSpringService<T> extends net.shibboleth.utilities.java.support.service.AbstractReloadableService<T> implements ApplicationContextAware, BeanNameAware, Lifecycle
ServiceableComponent via Spring.
This class extends Lifecycle. and thus
It acts as the bridge between this interface and
InitializableComponent and
DestructableComponent| Modifier and Type | Field and Description |
|---|---|
private String |
beanName
The bean name.
|
private net.shibboleth.utilities.java.support.service.ServiceableComponent<T> |
cachedComponent
The last known good component.
|
private List<BeanFactoryPostProcessor> |
factoryPostProcessors
List of bean factory post processors for this service's content.
|
private boolean |
lastLoadFailed
Did the last load fail? An optimization only.
|
private Logger |
log
Class logger.
|
private ApplicationContext |
parentContext
Application context owning this engine.
|
private List<BeanPostProcessor> |
postProcessors
List of bean post processors for this service's content.
|
private long[] |
resourceLastModifiedTimes
Time, in milliseconds, when the service configuration for the given index was last observed to have changed.
|
private List<Resource> |
serviceConfigurations
List of configuration resources for this service.
|
private Function<GenericApplicationContext,net.shibboleth.utilities.java.support.service.ServiceableComponent> |
serviceStrategy
How to summon up the
ServiceableComponent from the ApplicationContext. |
private Class<T> |
theClaz
The class we are looking for.
|
| Constructor and Description |
|---|
ReloadableSpringService(Class<T> claz)
Constructor.
|
ReloadableSpringService(Class<T> claz,
Function<GenericApplicationContext,net.shibboleth.utilities.java.support.service.ServiceableComponent> strategy)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDestroy() |
protected void |
doInitialize() |
protected void |
doReload() |
ApplicationContext |
getParentContext()
Gets the application context that is the parent to this service's context.
|
net.shibboleth.utilities.java.support.service.ServiceableComponent<T> |
getServiceableComponent()
Get the serviceable component.
|
List<Resource> |
getServiceConfigurations()
Gets an unmodifiable list of configurations for this service.
|
boolean |
isRunning()
.
|
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setBeanFactoryPostProcessors(List<BeanFactoryPostProcessor> processors)
Set the list of bean factory post processors for this service.
|
void |
setBeanName(String name) |
void |
setBeanPostProcessors(List<BeanPostProcessor> processors)
Set the list of bean post processors for this service.
|
void |
setParentContext(ApplicationContext context)
Sets the application context that is the parent to this service's context.
|
void |
setServiceConfigurations(List<Resource> configs)
Sets the list of configurations for this service.
|
void |
setServiceConfigurationStrategy(Function<?,List<Resource>> strategy)
Set the strategy by which the Service can locate the resources it needs to know about.
|
protected boolean |
shouldReload() |
void |
start() |
void |
stop() |
getLastReloadAttemptInstant, getLastSuccessfulReloadInstant, getLogPrefix, getReloadCheckDelay, getReloadFailureCause, getReloadTaskTimer, isFailFast, reload, setFailFast, setReloadCheckDelay, setReloadTaskTimersetIdgetIddestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait@Nullable @NonnullElements private List<Resource> serviceConfigurations
@Nonnull @NonnullElements private List<BeanFactoryPostProcessor> factoryPostProcessors
@Nonnull @NonnullElements private List<BeanPostProcessor> postProcessors
@Nonnull private final Function<GenericApplicationContext,net.shibboleth.utilities.java.support.service.ServiceableComponent> serviceStrategy
ServiceableComponent from the ApplicationContext.@Nullable private ApplicationContext parentContext
@Nullable private net.shibboleth.utilities.java.support.service.ServiceableComponent<T> cachedComponent
private boolean lastLoadFailed
@Nullable private long[] resourceLastModifiedTimes
public ReloadableSpringService(@Nonnull@ParameterName(name="claz") Class<T> claz)
claz - The interface being implemented.public ReloadableSpringService(@Nonnull@ParameterName(name="claz") Class<T> claz, @Nonnull@ParameterName(name="strategy") Function<GenericApplicationContext,net.shibboleth.utilities.java.support.service.ServiceableComponent> strategy)
claz - The interface being implemented.strategy - the strategy to use to look up servicable component to look for.@Nullable public ApplicationContext getParentContext()
public void setParentContext(@Nullable ApplicationContext context)
context - context that is the parent to this service's context, may be null@Nonnull public List<Resource> getServiceConfigurations()
public void setServiceConfigurations(@Nonnull@NonnullElements List<Resource> configs)
configs - list of configurations for this service, may be null or emptypublic void setServiceConfigurationStrategy(@Nonnull Function<?,List<Resource>> strategy)
strategy - the way to get the resources. Precise details are tbd.public void setBeanFactoryPostProcessors(@Nonnull@NonnullElements List<BeanFactoryPostProcessor> processors)
processors - bean factory post processors to applypublic void setBeanPostProcessors(@Nonnull@NonnullElements List<BeanPostProcessor> processors)
processors - bean post processors to applyprotected boolean shouldReload()
shouldReload in class net.shibboleth.utilities.java.support.service.AbstractReloadableService<T>protected void doReload()
doReload in class net.shibboleth.utilities.java.support.service.AbstractReloadableService<T>protected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.service.AbstractReloadableService<T>public net.shibboleth.utilities.java.support.service.ServiceableComponent<T> getServiceableComponent()
getServiceableComponent in interface net.shibboleth.utilities.java.support.service.ReloadableService<T>public void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext in interface ApplicationContextAwarepublic void setBeanName(@Nonnull@NotEmpty String name)
setBeanName in interface BeanNameAwareprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.service.AbstractReloadableService<T>net.shibboleth.utilities.java.support.component.ComponentInitializationExceptionCopyright © 1999–2016 Shibboleth Consortium. All rights reserved.