org.apache.geronimo.kernel.config
Interface LifecycleMonitor

All Known Implementing Classes:
DebugLoggingLifecycleMonitor, NullLifecycleMonitor, RecordingLifecycleMonitor

public interface LifecycleMonitor

This interface can be used to monitor the progress of an operation on the configuration manager. Typically, the monitor will receive a number of calls to addConfiguration as the configuration manager decides which configurations will be effected by the operations. This is followed by a call to loading, starting, stopping or unloading and then a call to succeeded or failed for each configuration added. The one notable exception to this is the load operation which calls addConfiguration and and immediately follows it with a reading and then succeeded or failed. This is because the load operation needs to read each configuration to determine which additional configurations will need to be loaded. When an operation fails, the failed method is called with the cause. The configuration manager normally will follow the failure with compensating actions to bring the server back to the original state. For example, if it loaded a configuration, it will unload it. Each of the compensating actions will cause events to be fired. When the, operation is completed, the finished method will be called. This should be called event if the operation ultimately fails and throws an exception. It is recommended that you do not rely the finished method to be called in the case of an Exception as there are cases that will cause the configuration manager to immediately return without notification (such as an AssertionError).


Method Summary
 void addConfiguration(Artifact configurationId)
          Adds a configuration to be monitored.
 void failed(Artifact configurationId, Throwable cause)
          The previous operation on the specified configuration has failed due to the specified exception.
 void finished()
          The operation on the configuration manager has finished.
 void loading(Artifact configurationId)
          The configuration manager has begun loading the specified configuration.
 void reading(Artifact configurationId)
          The configuration manager has started reading the specified configuration.
 void resolving(Artifact configurationId)
          The configuration manager has started resolving the dependencies of the specified configuration.
 void starting(Artifact configurationId)
          The configuration manager has begun starting the specified configuration.
 void stopping(Artifact configurationId)
          The configuration manager has begun stopping the specified configuration.
 void succeeded(Artifact configurationId)
          The previous operation on the specified configuration has completed successfully.
 void unloading(Artifact configurationId)
          The configuration manager has begun unloading the specified configuration.
 

Method Detail

addConfiguration

void addConfiguration(Artifact configurationId)
Adds a configuration to be monitored.

Parameters:
configurationId - the configuration identifier

resolving

void resolving(Artifact configurationId)
The configuration manager has started resolving the dependencies of the specified configuration.

Parameters:
configurationId - the configuration identifier

reading

void reading(Artifact configurationId)
The configuration manager has started reading the specified configuration.

Parameters:
configurationId - the configuration identifier

loading

void loading(Artifact configurationId)
The configuration manager has begun loading the specified configuration.

Parameters:
configurationId - the configuration identifier

starting

void starting(Artifact configurationId)
The configuration manager has begun starting the specified configuration.

Parameters:
configurationId - the configuration identifier

stopping

void stopping(Artifact configurationId)
The configuration manager has begun stopping the specified configuration.

Parameters:
configurationId - the configuration identifier

unloading

void unloading(Artifact configurationId)
The configuration manager has begun unloading the specified configuration.

Parameters:
configurationId - the configuration identifier

succeeded

void succeeded(Artifact configurationId)
The previous operation on the specified configuration has completed successfully.

Parameters:
configurationId - the configuration identifier

failed

void failed(Artifact configurationId,
            Throwable cause)
The previous operation on the specified configuration has failed due to the specified exception.

Parameters:
configurationId - the configuration identifier

finished

void finished()
The operation on the configuration manager has finished.



Copyright © 2003-2008 The Apache Geronimo development community. All Rights Reserved.