Class DebugStore

All Implemented Interfaces:
Comparable<JolokiaService.Init>, JolokiaService<JolokiaService.Init>

public class DebugStore extends AbstractJolokiaService<JolokiaService.Init>
Simple store for remembering debug info and returning it via a JMX operation (exposed in ConfigMBean)
Since:
Jun 15, 2009
Author:
roland
  • Constructor Details

    • DebugStore

      public DebugStore()
    • DebugStore

      public DebugStore(int maxDebugEntries, boolean isDebug)
  • Method Details

    • init

      public void init(JolokiaContext pJolokiaContext)
      Description copied from class: AbstractJolokiaService
      Override if access to the JolokiaContext is required.
      Specified by:
      init in interface JolokiaService<JolokiaService.Init>
      Overrides:
      init in class AbstractJolokiaService<JolokiaService.Init>
      Parameters:
      pJolokiaContext - JolokiaContext used
    • destroy

      public void destroy() throws Exception
      Description copied from class: AbstractJolokiaService
      Override for hooking into the lifecycle
      Specified by:
      destroy in interface JolokiaService<JolokiaService.Init>
      Overrides:
      destroy in class AbstractJolokiaService<JolokiaService.Init>
      Throws:
      Exception
    • log

      public void log(String pMessage)
      Store the given message in this store if debug is switched on
      Parameters:
      pMessage - message to store
    • log

      public void log(String pMessage, Throwable pThrowable)
      Store the given message in this store if debug is switched on
      Parameters:
      pMessage - message to store
      pThrowable - exception to store
    • debugInfo

      public String debugInfo()
      Get back all previously logged and stored debug messages
      Returns:
      debug string
    • resetDebugInfo

      public void resetDebugInfo()
      Reset debug info
    • setDebug

      public void setDebug(boolean pSwitch)
      Switch on/off debug
      Parameters:
      pSwitch - if true switch on debug
    • isDebug

      public boolean isDebug()
      Return true when debugging is switched on
      Returns:
      true if debugging is switched on
    • getMaxDebugEntries

      public int getMaxDebugEntries()
      Get the number of max debugging entries which can be stored
      Returns:
      number of maximum debug entries
    • setMaxDebugEntries

      public void setMaxDebugEntries(int pNumber)
      Set the number of maximum debuggin entries and trim the list of debug entries
      Parameters:
      pNumber - the maximal number of debug entries