org.apache.xbean.kernel.standard
Class AsyncServiceMonitor

java.lang.Object
  extended by org.apache.xbean.kernel.standard.AsyncServiceMonitor
All Implemented Interfaces:
ServiceMonitor

public class AsyncServiceMonitor
extends Object
implements ServiceMonitor

The AsyncServiceMonitor delivers service events to a delegate ServiceMonitor asynchronously using an executor.

Since:
2.0
Author:
Dain Sundstrom

Constructor Summary
AsyncServiceMonitor(ServiceMonitor delegate, Executor executor)
          Creates a AsyncServiceMonitor which asynchronously delivers service events to specified delegate ServiceMonitor using the specified executor.
 
Method Summary
 void serviceRegistered(ServiceEvent serviceEvent)
          A new service has been registered with the kernel.
 void serviceRunning(ServiceEvent serviceEvent)
          A service has entered the RUNNING state.
 void serviceStartError(ServiceEvent serviceEvent)
          An error occured while calling creating the service.
 void serviceStarting(ServiceEvent serviceEvent)
          A service has entered the STARTING state.
 void serviceStopError(ServiceEvent serviceEvent)
          An error occured while calling destroying the service.
 void serviceStopped(ServiceEvent serviceEvent)
          A service has entered the STOPPED state.
 void serviceStopping(ServiceEvent serviceEvent)
          A service has entered the RUNNING state.
 void serviceUnregistered(ServiceEvent serviceEvent)
          A service has been unregistered from the kernel.
 void serviceWaitingToStart(ServiceEvent serviceEvent)
          A service is waiting to start because some start conditions are unsatified.
 void serviceWaitingToStop(ServiceEvent serviceEvent)
          A service is waiting to stop because some stop condition is unsatified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncServiceMonitor

public AsyncServiceMonitor(ServiceMonitor delegate,
                           Executor executor)
Creates a AsyncServiceMonitor which asynchronously delivers service events to specified delegate ServiceMonitor using the specified executor.

Parameters:
delegate - the service monitor that should recieve the asynchronous events
executor - the executor used to asynchronously deliver the events
Method Detail

serviceRegistered

public void serviceRegistered(ServiceEvent serviceEvent)
A new service has been registered with the kernel.

Specified by:
serviceRegistered in interface ServiceMonitor
Parameters:
serviceEvent - the event information

serviceStarting

public void serviceStarting(ServiceEvent serviceEvent)
A service has entered the STARTING state.

Specified by:
serviceStarting in interface ServiceMonitor
Parameters:
serviceEvent - the event information

serviceWaitingToStart

public void serviceWaitingToStart(ServiceEvent serviceEvent)
A service is waiting to start because some start conditions are unsatified.

Specified by:
serviceWaitingToStart in interface ServiceMonitor
Parameters:
serviceEvent - the event information
See Also:
ServiceEvent.getUnsatisfiedConditions()

serviceStartError

public void serviceStartError(ServiceEvent serviceEvent)
An error occured while calling creating the service.

Specified by:
serviceStartError in interface ServiceMonitor
Parameters:
serviceEvent - the event information
See Also:
ServiceEvent.getCause()

serviceRunning

public void serviceRunning(ServiceEvent serviceEvent)
A service has entered the RUNNING state.

Specified by:
serviceRunning in interface ServiceMonitor
Parameters:
serviceEvent - the event information

serviceStopping

public void serviceStopping(ServiceEvent serviceEvent)
A service has entered the RUNNING state.

Specified by:
serviceStopping in interface ServiceMonitor
Parameters:
serviceEvent - the event information

serviceWaitingToStop

public void serviceWaitingToStop(ServiceEvent serviceEvent)
A service is waiting to stop because some stop condition is unsatified.

Specified by:
serviceWaitingToStop in interface ServiceMonitor
Parameters:
serviceEvent - the event information
See Also:
ServiceEvent.getUnsatisfiedConditions()

serviceStopError

public void serviceStopError(ServiceEvent serviceEvent)
An error occured while calling destroying the service.

Specified by:
serviceStopError in interface ServiceMonitor
Parameters:
serviceEvent - the event information
See Also:
ServiceEvent.getCause()

serviceStopped

public void serviceStopped(ServiceEvent serviceEvent)
A service has entered the STOPPED state.

Specified by:
serviceStopped in interface ServiceMonitor
Parameters:
serviceEvent - the event information

serviceUnregistered

public void serviceUnregistered(ServiceEvent serviceEvent)
A service has been unregistered from the kernel.

Specified by:
serviceUnregistered in interface ServiceMonitor
Parameters:
serviceEvent - the event information


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.