T - The precise service being implemented.@ThreadSafe public class ReloadableSpringService<T> extends AbstractReloadableService implements ApplicationContextAware, BeanNameAware
AbstractReloadableService.ServiceReloadTask| Modifier and Type | Field and Description |
|---|---|
private String |
beanName
The bean name.
|
private ServiceableComponent<T> |
cachedComponent
The last known good component.
|
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 Class<T> |
theClaz
The class we are looking for.
|
private Class<? extends ServiceableComponent> |
theServiceClaz
The precise class to look for.
|
| Constructor and Description |
|---|
ReloadableSpringService(Class<T> claz)
Constructor.
|
ReloadableSpringService(Class<T> claz,
Class<? extends ServiceableComponent> servicableClaz)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDestroy() |
protected void |
doInitialize() |
protected void |
doReload()
Performs the actual reload.
|
ApplicationContext |
getParentContext()
Gets the application context that is the parent to this service's context.
|
ServiceableComponent<T> |
getServiceableComponent()
Get the serviceable component.
|
List<Resource> |
getServiceConfigurations()
Gets an unmodifiable list of configurations for this service.
|
void |
setApplicationContext(ApplicationContext applicationContext) |
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.
|
protected boolean |
shouldReload()
Called by the
AbstractReloadableService.ServiceReloadTask to determine if the service should be reloaded. |
getLastReloadAttemptInstant, getLastSuccessfulReloadInstant, getLogPrefix, getReloadCheckDelay, getReloadFailureCause, getReloadTaskTimer, isFailFast, isRunning, reload, setFailFast, setReloadCheckDelay, setReloadTaskTimer, start, stopsetIdgetIddestroy, initialize, isDestroyed, isInitializedprivate final Logger log
private List<Resource> serviceConfigurations
private List<BeanPostProcessor> postProcessors
private final Class<? extends ServiceableComponent> theServiceClaz
ServiceableComponent.private ApplicationContext parentContext
private String beanName
private ServiceableComponent<T> cachedComponent
private boolean lastLoadFailed
private long[] resourceLastModifiedTimes
public ReloadableSpringService(Class<T> claz)
claz - The interface being implemented.public ReloadableSpringService(Class<T> claz, Class<? extends ServiceableComponent> servicableClaz)
claz - The interface being implemented.servicableClaz - the service 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 setBeanPostProcessors(@Nonnull@NonnullElements List<BeanPostProcessor> processors)
processors - bean post processors to applyprotected boolean shouldReload()
AbstractReloadableService.ServiceReloadTask to determine if the service should be reloaded.
No lock is held when this method is called, so any locking needed should be handled internally.
shouldReload in class AbstractReloadableServiceprotected void doReload()
throws ServiceException
No lock is held when this method is called, so any locking needed should be handled internally.
doReload in class AbstractReloadableServiceServiceException - thrown if there is a problem reloading the serviceprotected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentpublic ServiceableComponent<T> getServiceableComponent()
getServiceableComponent in interface ReloadableServicepublic void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext in interface ApplicationContextAwarepublic void setBeanName(String name)
setBeanName in interface BeanNameAwareprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class AbstractReloadableServicenet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionCopyright © 1999–2014. All rights reserved.