|
||||||||||
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
public abstract class BaseService
A service whose Spring beans are loaded into a service specific ApplicationContext
that is a child of the
context provided in setApplicationContext(ApplicationContext)
.
Services derived from this base class may not be re-initialized after they have been destroyed.
Constructor Summary | |
---|---|
BaseService()
Constructor. |
Method Summary | |
---|---|
void |
destroy()
Destroys a service, freeing any resources it may currently be using. |
org.springframework.context.ApplicationContext |
getApplicationContext()
Gets the application context that is the parent to this service's context. |
String |
getId()
Gets the ID of this service. |
protected ReadWriteLock |
getReadWriteLock()
Gets the read-write lock guarding the service context. |
List<org.opensaml.util.resource.Resource> |
getServiceConfigurations()
Gets an unmodifiable list of configurations for this service. |
org.springframework.context.ApplicationContext |
getServiceContext()
Gets this service's context. |
void |
initialize()
Initializes this service. |
boolean |
isDestroyed()
Gets whether the service has been destroyed. |
boolean |
isInitialized()
Gets whether the service is initialized and ready for use. |
protected void |
loadContext()
Loads the service context. |
protected abstract void |
onNewContextCreated(org.springframework.context.ApplicationContext newServiceContext)
Called after a new context has been created but before it set as the service's context. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Sets the application context that is the parent to this service's context. |
void |
setBeanName(String name)
|
protected void |
setInitialized(boolean initialized)
Sets whether this service has been initialized. |
void |
setServiceConfigurations(List<org.opensaml.util.resource.Resource> configurations)
Sets the service's configuration resources. |
protected void |
setServiceContext(org.springframework.context.support.GenericApplicationContext context)
Sets this service's context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseService()
Method Detail |
---|
public void destroy() throws ServiceException
destroy
in interface Service
ServiceException
- thrown if there is a problem destroying the servicepublic org.springframework.context.ApplicationContext getApplicationContext()
public String getId()
getId
in interface Service
protected ReadWriteLock getReadWriteLock()
public List<org.opensaml.util.resource.Resource> getServiceConfigurations()
public org.springframework.context.ApplicationContext getServiceContext()
public void initialize() throws ServiceException
initialize
in interface Service
ServiceException
- thrown if there is a problem initializing the servicepublic boolean isInitialized()
isInitialized
in interface Service
public boolean isDestroyed()
isDestroyed
in interface Service
protected void loadContext() throws ServiceException
ServiceException
- thrown if the configuration for this service could not be loadedprotected abstract void onNewContextCreated(org.springframework.context.ApplicationContext newServiceContext) throws ServiceException
newServiceContext
- the newly created context for the service
ServiceException
- thrown if there is a problem with the given service contextpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
public void setBeanName(String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
protected void setInitialized(boolean initialized)
initialized
- whether this service has been initializedpublic void setServiceConfigurations(List<org.opensaml.util.resource.Resource> configurations)
configurations
- configuration resources for the service
IllegalStateException
- thrown if the service has already been initializedprotected void setServiceContext(org.springframework.context.support.GenericApplicationContext context)
context
- this service's context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |