com.boylesoftware.cb2
Interface StatusProvider

All Known Implementing Classes:
ApplicationContext, BLManager, CB2Application, DAO

public interface StatusProvider

Interface for objects that provide information about their internal status, environment, and operation statistics. This interface is implemented by some key internal CB2 objects that represent various subsystems, such as the BL Manager, the Application Context and others, so important information about their operation can be retrieved at runtime by some internal monitoring subsystem.

Version:
$Id: StatusProvider.java,v 1.6 2004/04/30 18:54:08 levahim Exp $
Author:
Lev Himmelfarb

Field Summary
static java.text.DateFormat TIMESTAMP_FORMAT
          Date format, which should be used by status provider implementators for formating timestamps in the generated by the getStats method XMLs.
 
Method Summary
 EventStatistics getEventStats(java.lang.String eventName)
          Gets statistics for the specified event.
 byte[] getStats()
          Gets status/statistics report as an XML text.
 

Field Detail

TIMESTAMP_FORMAT

public static final java.text.DateFormat TIMESTAMP_FORMAT
Date format, which should be used by status provider implementators for formating timestamps in the generated by the getStats method XMLs.

Method Detail

getStats

public byte[] getStats()
                throws java.lang.Exception
Gets status/statistics report as an XML text. The structure of the XML is specific to the implementator, but it is recommended to have one top-level XML element and all other elements nested in it. The generated XML should not contain the <?xml ...?> descriptor. The idea is that it can be used by the caller as a fragment of a bigger XML document, and the caller is responsible for such "finishing touches" as adding an appropriate <?xml ...?> descriptor including document encoding.

This method returns XML as a byte array. The characters in the byte array must be in UTF-8 encoding.

Returns:
XML with status and statistics information.
Throws:
java.lang.Exception - if an unexpected error happens.

getEventStats

public EventStatistics getEventStats(java.lang.String eventName)
Gets statistics for the specified event. The object, implementing this interface, may gather statistics for various internal events. This method allows to access gathered data for a specified event, identified by event name. Event names are free-form and are specific to the particular status provider implementation. If the implementation does not recognize the specified event name, it may return null.

Parameters:
eventName - implementation specific event name, for which current statistics are requested.
Returns:
statistics information for the specified event or null if the event is unknown.


Copyright © 2002,2003,2004 - Boyle Software, Inc.