net.larsan.norna
Class Status

java.lang.Object
  |
  +--net.larsan.norna.Status

public class Status
extends java.lang.Object

Status objects used by the Norna framework. This class contains static identifiers for different states of a service. Service in the Norna framework follows the following pattern where states in brackets are optional:

     creation
     [initialization]
     [starting]
     [ready]
     [stopping]
     [stopped]
     [unloaded]
     [destroyed]

Every status have strict rules on what can legally follow it. Apart from the states above this class also defines a failed status for service failures.

A service is not availiable to the rest of the framework until it reports it status as being ready through the StatusCallback interface.

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

Field Summary
static Status CREATED
          Created status.
static Status DESTROYED
          Destroyed status.
static Status FAILED
          Failed status.
static Status INITIALIZED
          Initialized status.
static Status LOADED
          Loaded status.
static Status READY
          This service is redy for use.
static Status STARTING
          Starting status.
static Status STOPPED
          Stopped status.
static Status STOPPING
          Stopping status.
static Status UNLOADED
          Unloaded status.
 
Method Summary
 boolean equals(java.lang.Object o)
          Check equality
static Status parse(java.lang.String str)
          Parse a string status into a status object, returns nulll if the status is not recognized.
 java.lang.String toString()
          To string, returns the status name in lowercase
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATED

public static final Status CREATED
Created status. This status is the initial status for any service in the framework. The class is created nu its lifetime have not yet started. May be followed by initializing, loading starting or ready statuses.


INITIALIZED

public static final Status INITIALIZED
Initialized status. A module in this state is initialized and but not loaded or started. This status may legaly be followed by loading or starting only.


LOADED

public static final Status LOADED
Loaded status. A module in this state may be initialized but is not started. This status may legaly be followed starting or unloading only.


STARTING

public static final Status STARTING
Starting status. This status is intermediate and should be used by services that startup on multiple threads or wait for outside resources before being ready. This status may legally be followed by ready, stopping, stopped or failed status only.


READY

public static final Status READY
This service is redy for use. A module in this state may be loaded and initialized and is started. In this status the service handle becomes available to other services in the framework.


STOPPING

public static final Status STOPPING
Stopping status. This status should be used by services that uses multiple threads for its shutdown or wait on outside resources while doing so. At this point the service is no longer available to the rest of the framework. This status may be followed by stopped or failed status only.


STOPPED

public static final Status STOPPED
Stopped status. The service have stopped running. May be followed by starting or ready only if a restart is requested by the framework.


UNLOADED

public static final Status UNLOADED
Unloaded status. A module in this state is stopped and unloaded. This status can only be followed by a destroyed status.


DESTROYED

public static final Status DESTROYED
Destroyed status. A module in this state is destroyed. This status is never followed by any status and is thus the last status of a modules lifetime.


FAILED

public static final Status FAILED
Failed status. The service have failed during its lifetime and is not availiable to the rest of the framework. This status may only be followed by destruction of the service.

Method Detail

parse

public static Status parse(java.lang.String str)
Parse a string status into a status object, returns nulll if the status is not recognized.


toString

public java.lang.String toString()
To string, returns the status name in lowercase

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Check equality

Overrides:
equals in class java.lang.Object