Interface | Description |
---|---|
Initable |
Classes that implement this interface need initialization before
they can work.
|
InitableBroker |
Classes that implement this interface can act as a broker for
Initable classes. |
Service |
Services are Initables that have a name,
and a set of properties. |
ServiceBroker |
Classes that implement this interface can act as a broker for
Service classes. |
ServiceManager |
Classes that implement this interface can act as a manager for
Service classes. |
TurbineServiceProvider |
Interface for telling Turbine that the implementation class
is an external service provider therefore can be used for looking
up services not found by the Turbine implementation.
|
Class | Description |
---|---|
BaseInitable |
This class provides a generic implementation of
Initable . |
BaseInitableBroker |
A generic implementation of
InitableBroker . |
BaseService |
This class is a generic implementation of
Service . |
BaseServiceBroker |
A generic implementation of a
ServiceBroker which
provides:
Maintaining service name to class name mapping, allowing
pluggable service implementations. |
BaseUnicastRemoteService |
A base implementation of an
UnicastRemoteObject
as a Turbine Service . |
TurbineBaseService |
This class provides a
Service implementation that
Services used in Turbine are required to extend. |
TurbineServices |
This is a singleton utility class that acts as a Services broker.
|
Exception | Description |
---|---|
InitializationException |
Thrown by
Initable class in case of initialization
problems. |
InstantiationException |
Thrown by
InitableBroker and
ServiceBroker classes to indicate problems with
instatiation of requested objects. |
Services are singletons that have pluggable implementation and can participate in Turbine startup and shutdown.
What is a service?
The life cycle of a ServiceA Service (or any other Initable, if we had any) is not supposed to do much in it's constructor. Especialy it should not allocate any costly resources like large memory structures, DB or network connections and the like. It may well happen that the Service is sitting in the config file, but the application does not need it, so allocating all resources at system startup might be a loss. Early initialization is similar to the constructor. It is used to pass some information that the Service will need in it's future operation. UniqueId Service uses the HttpRequest object from the first Turbine invocation to determine URL this instance is runnign under, to generate instance ID. Early initialization method should process the configuration, store some values, but NOT allocate resources. There is still a chance that the Service will not be used. If the Service is ready to work (i.e. does not need any more objects being sent to it), and does not to allocate any resources during late initialization, the internal state can be changed so that getInit() returns true. Late initialization happens when the Service is requested by the application for the first time. It should allocate any resources needed and chnge the state so that getInit() returns true. If getInit() returns false after init() is executed, the Service has malfunctioned. After late initialization, the Service is ready to perform actions on behalf of the application. When the Service is no longer needed (this usually happens when system is shutting down), the shutdown() method is called. shutdown() should deallocate all resources. If any error conditions occur they are ignored. Initialization of services outside of the Turbine servlet
In the case where specific Turbine services are desired outside the
context of the
|
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.