Package org.apache.camel.spi
Interface Debugger
-
- All Superinterfaces:
AutoCloseable
,CamelContextAware
,Service
public interface Debugger extends Service, CamelContextAware
A debugger which allows tooling to attach breakpoints which is is being invoked whenExchange
s is being routed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
activateAllBreakpoints()
Activate all breakpoints.void
addBreakpoint(Breakpoint breakpoint)
Add the given breakpointvoid
addBreakpoint(Breakpoint breakpoint, Condition... conditions)
Add the given breakpointvoid
addSingleStepBreakpoint(Breakpoint breakpoint)
Add the given breakpoint which will be used in single step modevoid
addSingleStepBreakpoint(Breakpoint breakpoint, Condition... conditions)
Add the given breakpoint which will be used in single step modeboolean
afterProcess(Exchange exchange, Processor processor, NamedNode definition, long timeTaken)
Callback invoked when anExchange
has been processed which allows implementators to notify breakpoints.boolean
beforeProcess(Exchange exchange, Processor processor, NamedNode definition)
Callback invoked when anExchange
is about to be processed which allows implementators to notify breakpoints.List<Breakpoint>
getBreakpoints()
Gets a list of all the breakpointsboolean
onEvent(Exchange exchange, CamelEvent.ExchangeEvent event)
Callback invoked when anExchange
is being processed which allows implementators to notify breakpoints.void
removeBreakpoint(Breakpoint breakpoint)
Removes the given breakpointboolean
startSingleStepExchange(String exchangeId, Breakpoint breakpoint)
Starts the single step debug mode for the given exchangevoid
stopSingleStepExchange(String exchangeId)
Stops the single step debug mode for the given exchange.void
suspendAllBreakpoints()
Suspends all breakpoints.-
Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
-
-
-
Method Detail
-
addBreakpoint
void addBreakpoint(Breakpoint breakpoint)
Add the given breakpoint- Parameters:
breakpoint
- the breakpoint
-
addBreakpoint
void addBreakpoint(Breakpoint breakpoint, Condition... conditions)
Add the given breakpoint- Parameters:
breakpoint
- the breakpointconditions
- a number ofCondition
s
-
addSingleStepBreakpoint
void addSingleStepBreakpoint(Breakpoint breakpoint)
Add the given breakpoint which will be used in single step mode The debugger will single step the first message arriving.- Parameters:
breakpoint
- the breakpoint
-
addSingleStepBreakpoint
void addSingleStepBreakpoint(Breakpoint breakpoint, Condition... conditions)
Add the given breakpoint which will be used in single step mode The debugger will single step the first message arriving.- Parameters:
breakpoint
- the breakpointconditions
- a number ofCondition
s
-
removeBreakpoint
void removeBreakpoint(Breakpoint breakpoint)
Removes the given breakpoint- Parameters:
breakpoint
- the breakpoint
-
suspendAllBreakpoints
void suspendAllBreakpoints()
Suspends all breakpoints.
-
activateAllBreakpoints
void activateAllBreakpoints()
Activate all breakpoints.
-
getBreakpoints
List<Breakpoint> getBreakpoints()
Gets a list of all the breakpoints- Returns:
- the breakpoints wrapped in an unmodifiable list, is never null.
-
startSingleStepExchange
boolean startSingleStepExchange(String exchangeId, Breakpoint breakpoint)
Starts the single step debug mode for the given exchange- Parameters:
exchangeId
- the exchange idbreakpoint
- the breakpoint- Returns:
- true if the debugger will single step the given exchange, false if the debugger is already single stepping another, and thus cannot simultaneously single step another exchange
-
stopSingleStepExchange
void stopSingleStepExchange(String exchangeId)
Stops the single step debug mode for the given exchange. Notice: The default implementation of the debugger is capable of auto stopping when the exchange is complete.- Parameters:
exchangeId
- the exchange id
-
beforeProcess
boolean beforeProcess(Exchange exchange, Processor processor, NamedNode definition)
Callback invoked when anExchange
is about to be processed which allows implementators to notify breakpoints.- Parameters:
exchange
- the exchangeprocessor
- theProcessor
about to be processeddefinition
- the definition of the processor- Returns:
- true if any breakpoint was hit, false if not breakpoint was hit
-
afterProcess
boolean afterProcess(Exchange exchange, Processor processor, NamedNode definition, long timeTaken)
Callback invoked when anExchange
has been processed which allows implementators to notify breakpoints.- Parameters:
exchange
- the exchangeprocessor
- theProcessor
which was processeddefinition
- the definition of the processortimeTaken
- time in millis it took to process theExchange
- time spend in breakpoint callbacks may affect this time- Returns:
- true if any breakpoint was hit, false if not breakpoint was hit
-
onEvent
boolean onEvent(Exchange exchange, CamelEvent.ExchangeEvent event)
Callback invoked when anExchange
is being processed which allows implementators to notify breakpoints.- Parameters:
exchange
- the exchangeevent
- the event (instance ofCamelEvent.ExchangeEvent
- Returns:
- true if any breakpoint was hit, false if not breakpoint was hit
-
-