public abstract class BaseService extends Object implements Service, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware
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.コンストラクタと説明 |
---|
BaseService()
Constructor.
|
修飾子とタイプ | メソッドと説明 |
---|---|
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<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<Resource> configurations)
Sets the service's configuration resources.
|
protected void |
setServiceContext(org.springframework.context.support.GenericApplicationContext context)
Sets this service's context.
|
public void destroy() throws ServiceException
destroy
インタフェース内 Service
ServiceException
- thrown if there is a problem destroying the servicepublic org.springframework.context.ApplicationContext getApplicationContext()
public String getId()
protected ReadWriteLock getReadWriteLock()
public List<Resource> getServiceConfigurations()
public org.springframework.context.ApplicationContext getServiceContext()
public void initialize() throws ServiceException
initialize
インタフェース内 Service
ServiceException
- thrown if there is a problem initializing the servicepublic boolean isInitialized()
isInitialized
インタフェース内 Service
public boolean isDestroyed()
isDestroyed
インタフェース内 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 serviceServiceException
- thrown if there is a problem with the given service contextpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
インタフェース内 org.springframework.context.ApplicationContextAware
public void setBeanName(String name)
setBeanName
インタフェース内 org.springframework.beans.factory.BeanNameAware
protected void setInitialized(boolean initialized)
initialized
- whether this service has been initializedpublic void setServiceConfigurations(List<Resource> configurations)
configurations
- configuration resources for the serviceprotected void setServiceContext(org.springframework.context.support.GenericApplicationContext context)
context
- this service's contextCopyright © 2012. All Rights Reserved.