Package org.jolokia.server.core.util
Class DebugStore
java.lang.Object
org.jolokia.server.core.service.api.AbstractJolokiaService<JolokiaService.Init>
org.jolokia.server.core.util.DebugStore
- All Implemented Interfaces:
Comparable<JolokiaService.Init>,JolokiaService<JolokiaService.Init>
Simple store for remembering debug info and returning it via a JMX operation
(exposed in ConfigMBean)
- Since:
- Jun 15, 2009
- Author:
- roland
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jolokia.server.core.service.api.JolokiaService
JolokiaService.Init -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet back all previously logged and stored debug messagesvoiddestroy()Override for hooking into the lifecycleintGet the number of max debugging entries which can be storedvoidinit(JolokiaContext pJolokiaContext) Override if access to the JolokiaContext is required.booleanisDebug()Returntruewhen debugging is switched onvoidStore the given message in this store if debug is switched onvoidStore the given message in this store if debug is switched onvoidReset debug infovoidsetDebug(boolean pSwitch) Switch on/off debugvoidsetMaxDebugEntries(int pNumber) Set the number of maximum debuggin entries and trim the list of debug entriesMethods inherited from class org.jolokia.server.core.service.api.AbstractJolokiaService
compareTo, getJolokiaContext, getOrder, getType, registerJolokiaMBean, unregisterJolokiaMBean
-
Constructor Details
-
DebugStore
public DebugStore() -
DebugStore
public DebugStore(int maxDebugEntries, boolean isDebug)
-
-
Method Details
-
init
Description copied from class:AbstractJolokiaServiceOverride if access to the JolokiaContext is required.- Specified by:
initin interfaceJolokiaService<JolokiaService.Init>- Overrides:
initin classAbstractJolokiaService<JolokiaService.Init>- Parameters:
pJolokiaContext- JolokiaContext used
-
destroy
Description copied from class:AbstractJolokiaServiceOverride for hooking into the lifecycle- Specified by:
destroyin interfaceJolokiaService<JolokiaService.Init>- Overrides:
destroyin classAbstractJolokiaService<JolokiaService.Init>- Throws:
Exception
-
log
Store the given message in this store if debug is switched on- Parameters:
pMessage- message to store
-
log
Store the given message in this store if debug is switched on- Parameters:
pMessage- message to storepThrowable- exception to store
-
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- iftrueswitch on debug
-
isDebug
public boolean isDebug()Returntruewhen 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
-