org.apache.pluto.portalImpl.services
Class Service

java.lang.Object
  extended by org.apache.pluto.portalImpl.services.Service
Direct Known Subclasses:
ConfigService, FactoryManagerService, LogService, PageRegistryService, PortletDefinitionRegistryService, PortletEntityRegistryService

public abstract class Service
extends java.lang.Object

This is the base class for all services of the system. It prototypes only two methods: 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.

See Also:
ServiceManager

Constructor Summary
protected Service()
          Constructs the service.
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Service

protected Service()
Constructs the service.

Method Detail

init

protected void init(javax.servlet.ServletConfig aConfig,
                    Properties aProperties)
             throws java.lang.Exception
Initializes the service using the servlet configuration and the service properties.

Parameters:
aConfig - the servlet configuration
aProperties - the service properties
Throws:
java.lang.Exception - if the initialization fails

init

protected void init(javax.servlet.ServletContext aContext,
                    Properties aProperties)
             throws java.lang.Exception
Initializes the service using the servlet context and the service properties.

Parameters:
aContext - the servlet context
aProperties - the service properties
Throws:
java.lang.Exception - if the initialization fails

init

protected void init(Properties aProperties)
             throws java.lang.Exception
Initializes the service using the service properties.

Parameters:
aProperties - the service properties
Throws:
java.lang.Exception - if the initialization fails

postInit

protected void postInit(javax.servlet.ServletConfig aConfig)
                 throws java.lang.Exception
This methods can be used to setup things after the services has been initialized via init.

Throws:
java.lang.Exception - if the postInit fails for any reason

postInit

protected void postInit()
                 throws java.lang.Exception
This methods can be used to setup things after the services has been initialized via init.

Throws:
java.lang.Exception - if the postInit fails for any reason

destroy

protected void destroy(javax.servlet.ServletConfig aConfig)
                throws java.lang.Exception
Destroys the services. This method allows the service to cleanup any resources.

Parameters:
aConfig - the servlet configuration
Throws:
java.lang.Exception - if the destruction fails

destroy

protected void destroy()
                throws java.lang.Exception
Destroys the services. This method allows the service to cleanup any resources.

Throws:
java.lang.Exception - if the destruction fails


Copyright © 2003-2009 . All Rights Reserved.