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 being invoked whenExchanges is being routed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidactivateAllBreakpoints()Activate all breakpoints.voidaddBreakpoint(Breakpoint breakpoint)Add the given breakpointvoidaddBreakpoint(Breakpoint breakpoint, Condition... conditions)Add the given breakpointvoidaddSingleStepBreakpoint(Breakpoint breakpoint)Add the given breakpoint which will be used in single step modevoidaddSingleStepBreakpoint(Breakpoint breakpoint, Condition... conditions)Add the given breakpoint which will be used in single step modebooleanafterProcess(Exchange exchange, Processor processor, NamedNode definition, long timeTaken)Callback invoked when anExchangehas been processed which allows implementators to notify breakpoints.booleanbeforeProcess(Exchange exchange, Processor processor, NamedNode definition)Callback invoked when anExchangeis about to be processed which allows implementators to notify breakpoints.List<Breakpoint>getBreakpoints()Gets a list of all the breakpointsbooleanonEvent(Exchange exchange, CamelEvent.ExchangeEvent event)Callback invoked when anExchangeis being processed which allows implementators to notify breakpoints.voidremoveBreakpoint(Breakpoint breakpoint)Removes the given breakpointbooleanstartSingleStepExchange(String exchangeId, Breakpoint breakpoint)Starts the single step debug mode for the given exchangevoidstopSingleStepExchange(String exchangeId)Stops the single step debug mode for the given exchange.voidsuspendAllBreakpoints()Suspends all breakpoints.-
Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
-
-
-
Field Detail
-
FACTORY
static final String FACTORY
- See Also:
- Constant Field Values
-
-
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 ofConditions
-
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 ofConditions
-
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 anExchangeis about to be processed which allows implementators to notify breakpoints.- Parameters:
exchange- the exchangeprocessor- theProcessorabout 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 anExchangehas been processed which allows implementators to notify breakpoints.- Parameters:
exchange- the exchangeprocessor- theProcessorwhich 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 anExchangeis 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
-
-