public abstract class Service
extends java.lang.Object
init()
and destroy()
, both
of which are optional to override by a service. However, it is
recommended to implement at least init()
. The
destroy()
method only serves as a hook to release any
resources that the service may have cached or opened for its life-time.
To be more precise, this class prototypes three different
init()
methods. Only one of them should be overriden.
The are different with respect to the arguments they take, but
are otherwise identical.
ServiceManager
Modifier | Constructor and Description |
---|---|
protected |
Service()
Constructs the service.
|
Modifier and Type | Method and Description |
---|---|
protected void |
destroy()
Destroys the services.
|
protected void |
destroy(javax.servlet.ServletConfig aConfig)
Destroys the services.
|
protected void |
init(Properties aProperties)
Initializes the service using the service properties.
|
protected void |
init(javax.servlet.ServletConfig aConfig,
Properties aProperties)
Initializes the service using the servlet configuration
and the service properties.
|
protected void |
init(javax.servlet.ServletContext aContext,
Properties aProperties)
Initializes the service using the servlet context
and the service properties.
|
protected void |
postInit()
This methods can be used to setup things after the services has
been initialized via init.
|
protected void |
postInit(javax.servlet.ServletConfig aConfig)
This methods can be used to setup things after the services has
been initialized via init.
|
protected void init(javax.servlet.ServletConfig aConfig, Properties aProperties) throws java.lang.Exception
aConfig
- the servlet configurationaProperties
- the service propertiesjava.lang.Exception
- if the initialization failsprotected void init(javax.servlet.ServletContext aContext, Properties aProperties) throws java.lang.Exception
aContext
- the servlet contextaProperties
- the service propertiesjava.lang.Exception
- if the initialization failsprotected void init(Properties aProperties) throws java.lang.Exception
aProperties
- the service propertiesjava.lang.Exception
- if the initialization failsprotected void postInit(javax.servlet.ServletConfig aConfig) throws java.lang.Exception
java.lang.Exception
- if the postInit fails for any reasonprotected void postInit() throws java.lang.Exception
java.lang.Exception
- if the postInit fails for any reasonprotected void destroy(javax.servlet.ServletConfig aConfig) throws java.lang.Exception
aConfig
- the servlet configurationjava.lang.Exception
- if the destruction failsprotected void destroy() throws java.lang.Exception
java.lang.Exception
- if the destruction failsCopyright © 2003-2013 . All Rights Reserved.