Interface Breakpoint


public interface Breakpoint
Callback interface for a debugger breakpoint, registered with the Debugger and invoked as Exchanges pass through route nodes.

Breakpoints are registered via Debugger.addBreakpoint(Breakpoint) (unconditional) or Debugger.addBreakpoint(Breakpoint, Condition...) (conditional). When all provided Conditions are satisfied, the Debugger calls the appropriate before* / after* callback on this interface. Multiple before* methods exist to differentiate the type of routing event: entering a processor node, handling an exchange event, and so on.

Exceptions thrown from any callback method are caught by the Debugger and logged at WARN level. This ensures that a buggy breakpoint does not abort routing of the exchange.

A breakpoint can be in Breakpoint.State.Active or Breakpoint.State.Suspended state. The BacklogDebugger uses the suspended state to pause exchange processing and wait for a resume signal from a debugging client.

See Also:
  • Method Details

    • getState

      Breakpoint.State getState()
      Gets the state of this break
      Returns:
      the state
    • suspend

      void suspend()
      Suspend this breakpoint
    • activate

      void activate()
      Activates this breakpoint
    • beforeProcess

      void beforeProcess(Exchange exchange, Processor processor, NamedNode definition)
      Callback invoked when the breakpoint was hit and the Exchange is about to be processed (before).
      Parameters:
      exchange - the Exchange
      processor - the Processor about to be processed
      definition - the NamedNode definition of the processor
    • afterProcess

      void afterProcess(Exchange exchange, Processor processor, NamedNode definition, long timeTaken)
      Callback invoked when the breakpoint was hit and the Exchange has been processed (after).
      Parameters:
      exchange - the Exchange
      processor - the Processor which was processed
      definition - the NamedNode definition of the processor
      timeTaken - time in millis it took to process the Exchange - time spend in breakpoint callbacks may affect this time
    • onEvent

      void onEvent(Exchange exchange, CamelEvent.ExchangeEvent event, @Nullable NamedNode definition)
      Callback invoked when the breakpoint was hit and any of the Exchange events occurred.
      Parameters:
      exchange - the Exchange
      event - the event (instance of CamelEvent.ExchangeEvent
      definition - the NamedNode definition of the last processor executed, may be null if not possible to resolve from tracing
      See Also: