|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.shibboleth.common.config.BaseService
edu.internet2.middleware.shibboleth.common.config.BaseReloadableService
public abstract class BaseReloadableService
An extension to BaseService
that allows the service's context to be reloaded if the underlying configuration
resources are changed.
If, at construction time, polling frequency and retry attempt are given then the configuration resources will be
watched for changes. If a change is detected then the current service's context will be dropped and a new one created
from all resource files. If there is a problem loading a configuration resource during this process the existing
service context is kept and an error is logged. The result of this occuring during the initial configuration load is
implementation dependent.
NOTE: Service implementations must take out a read lock, through BaseService.getReadWriteLock()
,
whenever reading or operating on information controlled by the service context. This will ensure that if a
configuration change occurs the service context will not be replaced until after all current reads have completed.
Nested Class Summary | |
---|---|
protected class |
BaseReloadableService.ConfigurationResourceListener
A listener for policy resource changes that triggers a reloading of the AFP context. |
Constructor Summary | |
---|---|
BaseReloadableService()
Constructor. |
Method Summary | |
---|---|
void |
destroy()
Destroys a service, freeing any resources it may currently be using. Whether a service can be re-initialized after being destroyed is implementation dependent. |
long |
getPollingFrequency()
Gets the frequency, in millseconds, that the configuration resources are polled. |
int |
getPollingRetryAttempts()
Gets the number of times a resource may error out before it is considered permanently invalid. |
Timer |
getPollingTimer()
Gets the timer used to resource polling jobs. |
void |
initialize()
Initializes this service. Calling this on an initialized service should return immediately without affecting any service state. |
void |
reload()
Reloads the configuration of the service. |
void |
setPollingFrequency(long frequency)
Sets the frequency, in millseconds, that the configuration resources are polled. |
void |
setPollingRetryAttempts(int attempts)
Sets the number of times a resource may error out before it is considered permanently invalid. |
void |
setPollingTimer(Timer timer)
Sets the timer used to resource polling jobs. |
Methods inherited from class edu.internet2.middleware.shibboleth.common.config.BaseService |
---|
getApplicationContext, getId, getReadWriteLock, getServiceConfigurations, getServiceContext, isDestroyed, isInitialized, loadContext, onNewContextCreated, setApplicationContext, setBeanName, setInitialized, setServiceConfigurations, setServiceContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.internet2.middleware.shibboleth.common.service.Service |
---|
getId, isDestroyed, isInitialized |
Constructor Detail |
---|
public BaseReloadableService()
Method Detail |
---|
public Timer getPollingTimer()
public void setPollingTimer(Timer timer)
timer
- timer used to resource polling jobspublic long getPollingFrequency()
public void setPollingFrequency(long frequency)
frequency
- the frequency, in millseconds, that the configuration resources are polledpublic int getPollingRetryAttempts()
public void setPollingRetryAttempts(int attempts)
attempts
- number of times a resource may error out before it is considered permanently invalidpublic void initialize() throws ServiceException
initialize
in interface Service
initialize
in class BaseService
ServiceException
- thrown if there is a problem initializing the servicepublic void reload() throws ServiceException
reload
in interface ReloadableService
ServiceException
- thrown if there is a problem reloading the servicepublic void destroy() throws ServiceException
destroy
in interface Service
destroy
in class BaseService
ServiceException
- thrown if there is a problem destroying the service
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |