org.sadun.util.sis
Class StateInfoSupport

java.lang.Object
  extended byorg.sadun.util.sis.StateInfoSupport

public class StateInfoSupport
extends java.lang.Object

Plug-in class for adding state information support to an mbean.

The Mbean owning an instance can record state information entries related to a specific key and obtain a String to provide the console user with a log.

Author:
cris

Constructor Summary
StateInfoSupport()
           
 
Method Summary
 void addEntry(java.lang.String description)
          Add a entry for the same key as the last addEntry operation, containing a textual description.
 void addEntry(java.lang.String key, java.lang.String description)
          Add a entry for the given key, containing a textual description
 void addEntry(java.lang.String key, java.lang.String description, java.lang.Throwable e)
          Add a entry for the given key, containing a textual description and a given exception object
 void addEntry(java.lang.String description, java.lang.Throwable e)
          Add a entry for the same key as the last addEntry operation, containing a textual description anda given exception object.
 int getLevel()
          Returns the level.
 java.lang.String getStateDescription(java.lang.String key)
          Return a state log for the given key.
static void main(java.lang.String[] args)
           
 void setLevel(int level)
          Sets the level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateInfoSupport

public StateInfoSupport()
Method Detail

addEntry

public void addEntry(java.lang.String key,
                     java.lang.String description)
Add a entry for the given key, containing a textual description. * @param key * @param description


addEntry

public void addEntry(java.lang.String key,
                     java.lang.String description,
                     java.lang.Throwable e)
Add a entry for the given key, containing a textual description and a given exception object. * @param key * @param description * @param e


addEntry

public void addEntry(java.lang.String description)
Add a entry for the same key as the last addEntry operation, containing a textual description.

This method can be invoked only after one of the addEntry overloads with key parameters have been invoked. * @param description


addEntry

public void addEntry(java.lang.String description,
                     java.lang.Throwable e)
Add a entry for the same key as the last addEntry operation, containing a textual description anda given exception object.

This method can be invoked only after one of the addEntry overloads with key parameters have been invoked. * @param description * @param e


getStateDescription

public java.lang.String getStateDescription(java.lang.String key)
Return a state log for the given key. If key is null or the empty string, all entries are descripted.

If the key does not exist, null is returned. * @param key the key of interest. * @return a state log for the given key, or null. If key is null or the empty string, all entries are descripted.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getLevel

public int getLevel()
Returns the level.

Returns:
int

setLevel

public void setLevel(int level)
Sets the level.

Parameters:
level - The level to set