Initialize the portlet service. This method is invoked for every
instance of the portlet service created by the container before the
service is passed to the first requestor. It is guaranteed that
this method will be invoked exactly once for every instance of a
portlet service provider.
There is no corresponding destroy method in the lifecycle
of the portlet service, because there is nothing that a portlet service
could reasonably do in this method. It is not appropriate to free up
resources only in such a method, because portlet service providers will
typically live until the portal is shut down, therefore resources would
be consumed for the entire lifetime of the portal.
If a portlet service needs to acquire resources that it keeps for longer
than a single method call, then it is recommended to use
resource pools managed by the application server, like data sources,
or to have explicit release methods in the service API
so that the client using the portlet service can manage the resource
consumption.
- Parameters:
- servicePreferences - The configuration information for the portlet service.
This object is read-only; all modifying operations throw a
BackendStoreException if such an exception is declared and do
nothing otherwise.
- Throws:
- PortletServiceUnavailableException - Service providers may throw
an exception of this type if they encounter a problem during intialization
(e.g a missing configuration parameter) that prevents the service from operating.