|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Service
This is the base interface used for all services. Services support
specific funcationality and work in a transactional context.
See TransactionParticipant for details on when interaction
between Services is allowed.
On startup of an application, services are constructed (see details
below). This provides access to the non-transactional core components
of the system as well as the other Services that have already
been created. Services are created in a known order based
on dependencies: DataService, WatchdogService,
NodeMappingService, TaskService,
ClientSessionService, and the ChannelManager,
finishing with any custom Services ordered based on the
application's configuration.
All implementations of Service must have a constructor with
parameters of types Properties, ComponentRegistry, and
TransactionProxy. This is how the Service is created
on startup. The Properties parameter provides application and
service-specific properties. The ComponentRegistry provides
access to non-transactional kernel and system components like the
TransactionScheduler. The TransactionProxy provides
access to transactional state (when active) and the other available
Services. If any error occurs in creating a Service,
the constructor may throw any Exception, causing the application
to shutdown.
Note that Services are not created in the context of a
transaction. If a given constructor needs to do any work transactionally,
it may do so by calling TransactionScheduler.runTask.
| Method Summary | |
|---|---|
String |
getName()
Returns the name used to identify this service. |
void |
ready()
Notifies this Service that the application is fully
configured and ready to start running. |
void |
shutdown()
Shuts down this service. |
| Method Detail |
|---|
String getName()
void ready()
throws Exception
Service that the application is fully
configured and ready to start running. This means that all other Services associated with this application have been successfully
created. If the method throws an exception, then the application will be
shutdown.
Exception - if an error occursvoid shutdown()
This method does not require a transaction, and should not be called from one because this method will typically not succeed if there are outstanding transactions.
When this method returns, it is assumed that the service has been shutdown.
Callers should assume that, in a worst case, this method may block
indefinitely, and so should arrange to take other action (for example,
calling System.exit) if the call fails to complete
successfully in a certain amount of time.
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||