org.apache.camel.spi
Interface Debugger

All Superinterfaces:
CamelContextAware, Service
All Known Implementing Classes:
DefaultDebugger

public interface Debugger
extends Service, CamelContextAware

A debugger which allows tooling to attach breakpoints which is is being invoked when Exchanges is being routed.

Version:

Method Summary
 void activateAllBreakpoints()
          Activate all breakpoints.
 void addBreakpoint(Breakpoint breakpoint)
          Add the given breakpoint
 void addBreakpoint(Breakpoint breakpoint, Condition... conditions)
          Add the given breakpoint
 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.

 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.

 boolean afterProcess(Exchange exchange, Processor processor, ProcessorDefinition<?> definition, long timeTaken)
          Callback invoked when an Exchange has been processed which allows implementators to notify breakpoints.
 boolean beforeProcess(Exchange exchange, Processor processor, ProcessorDefinition<?> definition)
          Callback invoked when an Exchange is about to be processed which allows implementators to notify breakpoints.
 List<Breakpoint> getBreakpoints()
          Gets a list of all the breakpoints
 boolean onEvent(Exchange exchange, EventObject event)
          Callback invoked when an Exchange is being processed which allows implementators to notify breakpoints.
 void removeBreakpoint(Breakpoint breakpoint)
          Removes the given breakpoint
 boolean startSingleStepExchange(String exchangeId, Breakpoint breakpoint)
          Starts the single step debug mode for the given exchange
 void 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.Service
start, stop
 
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 breakpoint
conditions - a number of Conditions

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 breakpoint
conditions - a number of Conditions

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 id
breakpoint - 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,
                      ProcessorDefinition<?> definition)
Callback invoked when an Exchange is about to be processed which allows implementators to notify breakpoints.

Parameters:
exchange - the exchange
processor - the Processor about to be processed
definition - 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,
                     ProcessorDefinition<?> definition,
                     long timeTaken)
Callback invoked when an Exchange has been processed which allows implementators to notify breakpoints.

Parameters:
exchange - the exchange
processor - the Processor which was processed
definition - the definition of the processor
timeTaken - time in millis it took to process the Exchange - 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,
                EventObject event)
Callback invoked when an Exchange is being processed which allows implementators to notify breakpoints.

Parameters:
exchange - the exchange
event - the event (instance of AbstractExchangeEvent
Returns:
true if any breakpoint was hit, false if not breakpoint was hit


Apache CAMEL