org.exolab.jmscts.core.service
Class ExecutionMonitorService

java.lang.Object
  |
  +--org.exolab.core.service.Service
        |
        +--org.exolab.jmscts.core.service.ExecutionMonitorService
All Implemented Interfaces:
java.io.Serializable, org.exolab.core.service.Serviceable

public class ExecutionMonitorService
extends org.exolab.core.service.Service

This service enables the state of a running compliance suite to be captured.

This service is dependent on the RmiRegistryService. This must be initialised prior to starting this service

Version:
$Revision: 1.2 $ $Date: 2004/02/02 03:49:20 $
Author:
Tim Anderson
See Also:
Serialized Form

Field Summary
static java.lang.String NAME
          The service name
 
Constructor Summary
protected ExecutionMonitorService(int port)
          Construct a new ExecutionMonitorService
 
Method Summary
 void addListener(java.lang.String id, ExecutionListener listener)
          Add a listener for an application
 java.lang.String allocateId()
          Allocate a unique identifier to an application
 void error(java.lang.String id, java.lang.Throwable throwable)
          Notifies all registered listeners for an application that the application has thrown an exception just prior to termination
 void failed(java.lang.String id, java.lang.Throwable throwable)
          Notifies all registered listeners for an application that the application failed to start
static ExecutionMonitorService initialise(int port)
          Initialise the ExecutionMonitorService
static ExecutionMonitorService instance()
          Returns the singleton instance of the ExecutionMonitorService
 void removeListener(java.lang.String id, ExecutionListener listener)
          Remove a listener for an application
 void start()
          Start the service
 void started(java.lang.String id)
          Notifies all registered listeners for an application that the application has started
 void stop()
          Stop the service
 void stopped(java.lang.String id, int status)
          Notifies all registered listeners for an application that the application has stopped
 
Methods inherited from class org.exolab.core.service.Service
getName, getState, restart, setState, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
The service name
Constructor Detail

ExecutionMonitorService

protected ExecutionMonitorService(int port)
Construct a new ExecutionMonitorService
Parameters:
port - the RMI registry port
Method Detail

initialise

public static ExecutionMonitorService initialise(int port)
Initialise the ExecutionMonitorService
Parameters:
port - the RMI registry port
Returns:
the singleton instance of the service

instance

public static ExecutionMonitorService instance()
Returns the singleton instance of the ExecutionMonitorService
Returns:
the singleton instance of the ExecutionMonitorService, or null, if it hasn't been initialised

addListener

public void addListener(java.lang.String id,
                        ExecutionListener listener)
Add a listener for an application
Parameters:
id - the application id
listener - the listener

removeListener

public void removeListener(java.lang.String id,
                           ExecutionListener listener)
Remove a listener for an application
Parameters:
id - the application id
listener - the listener

failed

public void failed(java.lang.String id,
                   java.lang.Throwable throwable)
Notifies all registered listeners for an application that the application failed to start
Parameters:
id - the application id
throwable - the reason for the failure

started

public void started(java.lang.String id)
Notifies all registered listeners for an application that the application has started
Parameters:
id - the application id

stopped

public void stopped(java.lang.String id,
                    int status)
Notifies all registered listeners for an application that the application has stopped
Parameters:
id - the application id
status - the exit status of the application

error

public void error(java.lang.String id,
                  java.lang.Throwable throwable)
Notifies all registered listeners for an application that the application has thrown an exception just prior to termination
Parameters:
id - the application id
throwable - the exception thrown by the application

allocateId

public java.lang.String allocateId()
Allocate a unique identifier to an application
Returns:
a unique identifier for an application

start

public void start()
           throws org.exolab.core.service.ServiceException
Start the service
Overrides:
start in class org.exolab.core.service.Service
Throws:
org.exolab.core.service.ServiceException - if the service can't be started

stop

public void stop()
          throws org.exolab.core.service.ServiceException
Stop the service
Overrides:
stop in class org.exolab.core.service.Service
Throws:
org.exolab.core.service.ServiceException - if the service can't be stopped


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.