net.larsan.norna.base
Interface ServiceHandle

All Known Subinterfaces:
LogHandle, PreferenceHandle, UserHandle

public interface ServiceHandle

A service handle is what the service publishes towards the servers and it's fellow services. This should not be confused with the Service interface which is what the framework sees and uses.

Services should usually subclass this interface with their service public contract. Doing so provides not only higher flexibility but also gives the service and the service registry to insert fine granied security check is necessary.

Services should use the ServicePermission object to grant access control on getStatus and optionally on execution methods. The code for doing so probably looks something like this:

   public Status getStatus() {
       String ID = // get Service id
       SecurityManager man = System.getSecurityManager();
       if(man != null) man.checkPermission(new ServicePermission(ID, "status"));
       ...
 

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

Method Summary
 Status getStatus()
          Get the status of the service.
 

Method Detail

getStatus

public Status getStatus()
Get the status of the service. The service is free to do a security check before returning the status, but must never return null.

Returns:
A status object, never null