com.syncbuilder.service
Class ServiceStateEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.syncbuilder.service.ServiceStateEvent

public class ServiceStateEvent
extends java.util.EventObject

Events of this kind are used by a service to report its state.
They should be sent out when the state changes, or when the service is asked to report its state.
ServiceStateEvents are required to contain their source, and they may also contain a parent. The parent is used in a hierarchy of services, where a sub-service wants to express that it belongs to a super-service, by specifying the super-service as its parent.
This should make it easier to develop a hierarchical listing of service states.

Last but not least, ServiceStateEvents may contain a message, which describes the circumstances more closely.

As you can tell from the choice of available methods, ServiceStateEvents are immutable.

See Also:
Serialized Form

Field Summary
static int RUNNING
           
static int STOPPED
           
static int SUSPENDED
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ServiceStateEvent(java.lang.Object source, java.lang.Object parent, int state, ServiceMessage msg)
          Construct an event with the specified parent (super-service), and the specified ServiceMessage.
 
Method Summary
 ServiceMessage getMessage()
           
 java.lang.Object getParent()
           
 int getState()
           
 java.lang.String getStateName()
           
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RUNNING

public static final int RUNNING

STOPPED

public static final int STOPPED

SUSPENDED

public static final int SUSPENDED
Constructor Detail

ServiceStateEvent

public ServiceStateEvent(java.lang.Object source,
                         java.lang.Object parent,
                         int state,
                         ServiceMessage msg)
Construct an event with the specified parent (super-service), and the specified ServiceMessage.
Method Detail

getParent

public java.lang.Object getParent()

getState

public int getState()

getStateName

public java.lang.String getStateName()

getMessage

public ServiceMessage getMessage()

toString

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject


This material is Copyrighted (C) 1999 by Tilo Christ. All Rights Reserved.