Package org.apache.camel.impl.debugger
Class DefaultBacklogDebugger
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.impl.debugger.DefaultBacklogDebugger
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.BacklogDebugger
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
public final class DefaultBacklogDebugger
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.BacklogDebugger
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
Fields inherited from interface org.apache.camel.spi.BacklogDebugger
BREAKPOINT_ALL_ROUTES, SUSPEND_MODE_ENV_VAR_NAME, SUSPEND_MODE_SYSTEM_PROP_NAME
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBreakpoint
(String nodeId) void
addConditionalBreakpoint
(String nodeId, String language, String predicate) void
afterProcess
(org.apache.camel.Exchange exchange, org.apache.camel.Processor processor, org.apache.camel.NamedNode definition, long timeTaken) void
attach()
org.apache.camel.util.StopWatch
beforeProcess
(org.apache.camel.Exchange exchange, org.apache.camel.Processor processor, org.apache.camel.NamedNode definition) static org.apache.camel.spi.BacklogDebugger
createDebugger
(org.apache.camel.CamelContext context) Creates a new backlog debugger.void
detach()
void
disableBreakpoint
(String nodeId) void
protected void
doStart()
protected void
doStop()
dumpTracedMessagesAsJSon
(String nodeId) dumpTracedMessagesAsXml
(String nodeId) void
enableBreakpoint
(String nodeId) void
static org.apache.camel.spi.BacklogDebugger
getBacklogDebugger
(org.apache.camel.CamelContext context) A helper method to return the BacklogDebugger instance if one is enabledint
long
long
org.apache.camel.spi.BacklogTracerEventMessage
org.apache.camel.Exchange
boolean
hasBreakpoint
(String nodeId) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
void
removeBreakpoint
(String nodeId) void
removeExchangePropertyOnBreakpoint
(String nodeId, String exchangePropertyName) void
removeMessageBodyOnBreakpoint
(String nodeId) void
removeMessageHeaderOnBreakpoint
(String nodeId, String headerName) void
void
void
resumeBreakpoint
(String nodeId) void
resumeBreakpoint
(String nodeId, boolean stepMode) void
setBodyIncludeFiles
(boolean bodyIncludeFiles) void
setBodyIncludeStreams
(boolean bodyIncludeStreams) void
setBodyMaxChars
(int bodyMaxChars) void
setExchangePropertyOnBreakpoint
(String nodeId, String exchangePropertyName, Object value) void
setExchangePropertyOnBreakpoint
(String nodeId, String exchangePropertyName, Object value, Class<?> type) void
setFallbackTimeout
(long fallbackTimeout) void
setIncludeException
(boolean includeException) void
setIncludeExchangeProperties
(boolean includeExchangeProperties) void
setInitialBreakpoints
(String initialBreakpoints) void
setLoggingLevel
(String level) void
setMessageBodyOnBreakpoint
(String nodeId, Object body) void
setMessageBodyOnBreakpoint
(String nodeId, Object body, Class<?> type) void
setMessageHeaderOnBreakpoint
(String nodeId, String headerName, Object value) void
setMessageHeaderOnBreakpoint
(String nodeId, String headerName, Object value, Class<?> type) void
setSingleStepIncludeStartEnd
(boolean singleStepIncludeStartEnd) void
setSuspendMode
(boolean suspendMode) void
step()
void
void
stepBreakpoint
(String nodeId) Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Method Details
-
createDebugger
public static org.apache.camel.spi.BacklogDebugger createDebugger(org.apache.camel.CamelContext context) Creates a new backlog debugger.In case the environment variable
BacklogDebugger.SUSPEND_MODE_ENV_VAR_NAME
or the system propertyBacklogDebugger.SUSPEND_MODE_SYSTEM_PROP_NAME
has been set totrue
, the message processing is directly suspended.- Parameters:
context
- Camel context- Returns:
- a new backlog debugger
-
getBacklogDebugger
public static org.apache.camel.spi.BacklogDebugger getBacklogDebugger(org.apache.camel.CamelContext context) A helper method to return the BacklogDebugger instance if one is enabled- Returns:
- the backlog debugger or null if none can be found
-
getInitialBreakpoints
- Specified by:
getInitialBreakpoints
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setInitialBreakpoints
- Specified by:
setInitialBreakpoints
in interfaceorg.apache.camel.spi.BacklogDebugger
-
getLoggingLevel
- Specified by:
getLoggingLevel
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setLoggingLevel
- Specified by:
setLoggingLevel
in interfaceorg.apache.camel.spi.BacklogDebugger
-
enableDebugger
public void enableDebugger()- Specified by:
enableDebugger
in interfaceorg.apache.camel.spi.BacklogDebugger
-
disableDebugger
public void disableDebugger()- Specified by:
disableDebugger
in interfaceorg.apache.camel.spi.BacklogDebugger
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceorg.apache.camel.spi.BacklogDebugger
-
hasBreakpoint
- Specified by:
hasBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setSuspendMode
public void setSuspendMode(boolean suspendMode) - Specified by:
setSuspendMode
in interfaceorg.apache.camel.spi.BacklogDebugger
-
isSuspendMode
public boolean isSuspendMode()- Specified by:
isSuspendMode
in interfaceorg.apache.camel.spi.BacklogDebugger
-
isSingleStepMode
public boolean isSingleStepMode()- Specified by:
isSingleStepMode
in interfaceorg.apache.camel.spi.BacklogDebugger
-
attach
public void attach()- Specified by:
attach
in interfaceorg.apache.camel.spi.BacklogDebugger
-
detach
public void detach()- Specified by:
detach
in interfaceorg.apache.camel.spi.BacklogDebugger
-
addBreakpoint
- Specified by:
addBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
addConditionalBreakpoint
- Specified by:
addConditionalBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
removeBreakpoint
- Specified by:
removeBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
removeAllBreakpoints
public void removeAllBreakpoints()- Specified by:
removeAllBreakpoints
in interfaceorg.apache.camel.spi.BacklogDebugger
-
getBreakpoints
- Specified by:
getBreakpoints
in interfaceorg.apache.camel.spi.BacklogDebugger
-
resumeBreakpoint
- Specified by:
resumeBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
resumeBreakpoint
- Specified by:
resumeBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setMessageBodyOnBreakpoint
- Specified by:
setMessageBodyOnBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setMessageBodyOnBreakpoint
- Specified by:
setMessageBodyOnBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
removeMessageBodyOnBreakpoint
- Specified by:
removeMessageBodyOnBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setMessageHeaderOnBreakpoint
public void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value) throws org.apache.camel.NoTypeConversionAvailableException - Specified by:
setMessageHeaderOnBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
- Throws:
org.apache.camel.NoTypeConversionAvailableException
-
setMessageHeaderOnBreakpoint
public void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value, Class<?> type) throws org.apache.camel.NoTypeConversionAvailableException - Specified by:
setMessageHeaderOnBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
- Throws:
org.apache.camel.NoTypeConversionAvailableException
-
setExchangePropertyOnBreakpoint
public void setExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName, Object value) throws org.apache.camel.NoTypeConversionAvailableException - Specified by:
setExchangePropertyOnBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
- Throws:
org.apache.camel.NoTypeConversionAvailableException
-
setExchangePropertyOnBreakpoint
public void setExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName, Object value, Class<?> type) throws org.apache.camel.NoTypeConversionAvailableException - Specified by:
setExchangePropertyOnBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
- Throws:
org.apache.camel.NoTypeConversionAvailableException
-
removeExchangePropertyOnBreakpoint
- Specified by:
removeExchangePropertyOnBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
getFallbackTimeout
public long getFallbackTimeout()- Specified by:
getFallbackTimeout
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setFallbackTimeout
public void setFallbackTimeout(long fallbackTimeout) - Specified by:
setFallbackTimeout
in interfaceorg.apache.camel.spi.BacklogDebugger
-
removeMessageHeaderOnBreakpoint
- Specified by:
removeMessageHeaderOnBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
resumeAll
public void resumeAll()- Specified by:
resumeAll
in interfaceorg.apache.camel.spi.BacklogDebugger
-
stepBreakpoint
public void stepBreakpoint()- Specified by:
stepBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
stepBreakpoint
- Specified by:
stepBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
step
public void step()- Specified by:
step
in interfaceorg.apache.camel.spi.BacklogDebugger
-
getSuspendedBreakpointNodeIds
- Specified by:
getSuspendedBreakpointNodeIds
in interfaceorg.apache.camel.spi.BacklogDebugger
-
getSuspendedExchange
- Specified by:
getSuspendedExchange
in interfaceorg.apache.camel.spi.BacklogDebugger
-
getSuspendedBreakpointMessage
- Specified by:
getSuspendedBreakpointMessage
in interfaceorg.apache.camel.spi.BacklogDebugger
-
disableBreakpoint
- Specified by:
disableBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
enableBreakpoint
- Specified by:
enableBreakpoint
in interfaceorg.apache.camel.spi.BacklogDebugger
-
isSingleStepIncludeStartEnd
public boolean isSingleStepIncludeStartEnd()- Specified by:
isSingleStepIncludeStartEnd
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setSingleStepIncludeStartEnd
public void setSingleStepIncludeStartEnd(boolean singleStepIncludeStartEnd) - Specified by:
setSingleStepIncludeStartEnd
in interfaceorg.apache.camel.spi.BacklogDebugger
-
getBodyMaxChars
public int getBodyMaxChars()- Specified by:
getBodyMaxChars
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setBodyMaxChars
public void setBodyMaxChars(int bodyMaxChars) - Specified by:
setBodyMaxChars
in interfaceorg.apache.camel.spi.BacklogDebugger
-
isBodyIncludeStreams
public boolean isBodyIncludeStreams()- Specified by:
isBodyIncludeStreams
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setBodyIncludeStreams
public void setBodyIncludeStreams(boolean bodyIncludeStreams) - Specified by:
setBodyIncludeStreams
in interfaceorg.apache.camel.spi.BacklogDebugger
-
isBodyIncludeFiles
public boolean isBodyIncludeFiles()- Specified by:
isBodyIncludeFiles
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setBodyIncludeFiles
public void setBodyIncludeFiles(boolean bodyIncludeFiles) - Specified by:
setBodyIncludeFiles
in interfaceorg.apache.camel.spi.BacklogDebugger
-
isIncludeExchangeProperties
public boolean isIncludeExchangeProperties()- Specified by:
isIncludeExchangeProperties
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setIncludeExchangeProperties
public void setIncludeExchangeProperties(boolean includeExchangeProperties) - Specified by:
setIncludeExchangeProperties
in interfaceorg.apache.camel.spi.BacklogDebugger
-
isIncludeException
public boolean isIncludeException()- Specified by:
isIncludeException
in interfaceorg.apache.camel.spi.BacklogDebugger
-
setIncludeException
public void setIncludeException(boolean includeException) - Specified by:
setIncludeException
in interfaceorg.apache.camel.spi.BacklogDebugger
-
dumpTracedMessagesAsXml
- Specified by:
dumpTracedMessagesAsXml
in interfaceorg.apache.camel.spi.BacklogDebugger
-
dumpTracedMessagesAsJSon
- Specified by:
dumpTracedMessagesAsJSon
in interfaceorg.apache.camel.spi.BacklogDebugger
-
getDebugCounter
public long getDebugCounter()- Specified by:
getDebugCounter
in interfaceorg.apache.camel.spi.BacklogDebugger
-
resetDebugCounter
public void resetDebugCounter()- Specified by:
resetDebugCounter
in interfaceorg.apache.camel.spi.BacklogDebugger
-
beforeProcess
public org.apache.camel.util.StopWatch beforeProcess(org.apache.camel.Exchange exchange, org.apache.camel.Processor processor, org.apache.camel.NamedNode definition) - Specified by:
beforeProcess
in interfaceorg.apache.camel.spi.BacklogDebugger
-
afterProcess
public void afterProcess(org.apache.camel.Exchange exchange, org.apache.camel.Processor processor, org.apache.camel.NamedNode definition, long timeTaken) - Specified by:
afterProcess
in interfaceorg.apache.camel.spi.BacklogDebugger
-
doStart
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-