org.apache.camel.impl
Class DefaultDebugger

java.lang.Object
  extended by org.apache.camel.impl.DefaultDebugger
All Implemented Interfaces:
CamelContextAware, Service, Debugger

public class DefaultDebugger
extends Object
implements Debugger, CamelContextAware

The default implementation of the Debugger.

Version:

Constructor Summary
DefaultDebugger()
           
DefaultDebugger(CamelContext camelContext)
           
 
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
 CamelContext getCamelContext()
          Get the CamelContext
protected  void onAfterProcess(Exchange exchange, Processor processor, ProcessorDefinition<?> definition, long timeTaken, Breakpoint breakpoint)
           
protected  void onBeforeProcess(Exchange exchange, Processor processor, ProcessorDefinition<?> definition, Breakpoint breakpoint)
           
 boolean onEvent(Exchange exchange, EventObject event)
          Callback invoked when an Exchange is being processed which allows implementators to notify breakpoints.
protected  void onEvent(Exchange exchange, EventObject event, Breakpoint breakpoint)
           
 void removeBreakpoint(Breakpoint breakpoint)
          Removes the given breakpoint
 void setCamelContext(CamelContext camelContext)
          Injects the CamelContext
 void start()
          Starts the service
 boolean startSingleStepExchange(String exchangeId, Breakpoint breakpoint)
          Starts the single step debug mode for the given exchange
 void stop()
          Stops the service
 void stopSingleStepExchange(String exchangeId)
          Stops the single step debug mode for the given exchange.
 void suspendAllBreakpoints()
          Suspends all breakpoints.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultDebugger

public DefaultDebugger()

DefaultDebugger

public DefaultDebugger(CamelContext camelContext)
Method Detail

getCamelContext

public CamelContext getCamelContext()
Description copied from interface: CamelContextAware
Get the CamelContext

Specified by:
getCamelContext in interface CamelContextAware
Returns:
camelContext the Camel context

setCamelContext

public void setCamelContext(CamelContext camelContext)
Description copied from interface: CamelContextAware
Injects the CamelContext

Specified by:
setCamelContext in interface CamelContextAware
Parameters:
camelContext - the Camel context

addBreakpoint

public void addBreakpoint(Breakpoint breakpoint)
Description copied from interface: Debugger
Add the given breakpoint

Specified by:
addBreakpoint in interface Debugger
Parameters:
breakpoint - the breakpoint

addBreakpoint

public void addBreakpoint(Breakpoint breakpoint,
                          Condition... conditions)
Description copied from interface: Debugger
Add the given breakpoint

Specified by:
addBreakpoint in interface Debugger
Parameters:
breakpoint - the breakpoint
conditions - a number of Conditions

addSingleStepBreakpoint

public void addSingleStepBreakpoint(Breakpoint breakpoint)
Description copied from interface: Debugger
Add the given breakpoint which will be used in single step mode

The debugger will single step the first message arriving.

Specified by:
addSingleStepBreakpoint in interface Debugger
Parameters:
breakpoint - the breakpoint

addSingleStepBreakpoint

public void addSingleStepBreakpoint(Breakpoint breakpoint,
                                    Condition... conditions)
Description copied from interface: Debugger
Add the given breakpoint which will be used in single step mode

The debugger will single step the first message arriving.

Specified by:
addSingleStepBreakpoint in interface Debugger
Parameters:
breakpoint - the breakpoint
conditions - a number of Conditions

removeBreakpoint

public void removeBreakpoint(Breakpoint breakpoint)
Description copied from interface: Debugger
Removes the given breakpoint

Specified by:
removeBreakpoint in interface Debugger
Parameters:
breakpoint - the breakpoint

suspendAllBreakpoints

public void suspendAllBreakpoints()
Description copied from interface: Debugger
Suspends all breakpoints.

Specified by:
suspendAllBreakpoints in interface Debugger

activateAllBreakpoints

public void activateAllBreakpoints()
Description copied from interface: Debugger
Activate all breakpoints.

Specified by:
activateAllBreakpoints in interface Debugger

getBreakpoints

public List<Breakpoint> getBreakpoints()
Description copied from interface: Debugger
Gets a list of all the breakpoints

Specified by:
getBreakpoints in interface Debugger
Returns:
the breakpoints wrapped in an unmodifiable list, is never null.

startSingleStepExchange

public boolean startSingleStepExchange(String exchangeId,
                                       Breakpoint breakpoint)
Description copied from interface: Debugger
Starts the single step debug mode for the given exchange

Specified by:
startSingleStepExchange in interface Debugger
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

public void stopSingleStepExchange(String exchangeId)
Description copied from interface: Debugger
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.

Specified by:
stopSingleStepExchange in interface Debugger
Parameters:
exchangeId - the exchange id

beforeProcess

public boolean beforeProcess(Exchange exchange,
                             Processor processor,
                             ProcessorDefinition<?> definition)
Description copied from interface: Debugger
Callback invoked when an Exchange is about to be processed which allows implementators to notify breakpoints.

Specified by:
beforeProcess in interface Debugger
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

public boolean afterProcess(Exchange exchange,
                            Processor processor,
                            ProcessorDefinition<?> definition,
                            long timeTaken)
Description copied from interface: Debugger
Callback invoked when an Exchange has been processed which allows implementators to notify breakpoints.

Specified by:
afterProcess in interface Debugger
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

public boolean onEvent(Exchange exchange,
                       EventObject event)
Description copied from interface: Debugger
Callback invoked when an Exchange is being processed which allows implementators to notify breakpoints.

Specified by:
onEvent in interface Debugger
Parameters:
exchange - the exchange
event - the event (instance of AbstractExchangeEvent
Returns:
true if any breakpoint was hit, false if not breakpoint was hit

onBeforeProcess

protected void onBeforeProcess(Exchange exchange,
                               Processor processor,
                               ProcessorDefinition<?> definition,
                               Breakpoint breakpoint)

onAfterProcess

protected void onAfterProcess(Exchange exchange,
                              Processor processor,
                              ProcessorDefinition<?> definition,
                              long timeTaken,
                              Breakpoint breakpoint)

onEvent

protected void onEvent(Exchange exchange,
                       EventObject event,
                       Breakpoint breakpoint)

start

public void start()
           throws Exception
Description copied from interface: Service
Starts the service

Specified by:
start in interface Service
Throws:
Exception - is thrown if starting failed

stop

public void stop()
          throws Exception
Description copied from interface: Service
Stops the service

Specified by:
stop in interface Service
Throws:
Exception - is thrown if stopping failed

toString

public String toString()
Overrides:
toString in class Object


Apache CAMEL