net.larsan.norna.base
Interface Service


public interface Service

All services in the Norna framework must implement this interface. A service in the norna framework has three properties. It has a status which tell its environment and other services what state it is in, it has a software information object with runtime information about the service software, and it has a public handle which will be used by other services and should contain the service public contract.

The Status must be reported through a StatusCallback interface provided by the framework. A service is not available to the rest of the framework until it reports its status as ready.

Version:
Alpha-0.2 / 2002-10-06 21:37
Author:
Lars J. Nilsson
See Also:
StatusCallback

Method Summary
 ServiceHandle getServiceHandle()
          Get a reference to the ServiceHandle interface for this service.
 SoftwareInfo getServiceInfo()
          Get service information.
 void setStatusCallback(StatusCallback callback)
          Set the status callback this service should use to signal status changes to the framework.
 

Method Detail

setStatusCallback

public void setStatusCallback(StatusCallback callback)
Set the status callback this service should use to signal status changes to the framework. It is vital that the callback received by this method is used since a service is not available to the rest of the framework until it reports its status as ready.

Parameters:
callback - Status callback handle

getServiceInfo

public SoftwareInfo getServiceInfo()
Get service information. This method must never return null. This method is duplicated in the ServiceHandle interface.

Returns:
A SoftwareInfo object, must never return null

getServiceHandle

public ServiceHandle getServiceHandle()
Get a reference to the ServiceHandle interface for this service. The service handle is the public contract used by other services. This method is guarrantied by the framework never to be called unless the service returns its status as being ready.

Returns:
A Service handle object, may return null if the service status is not ready