Class DefaultBacklogDebugger

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.impl.debugger.DefaultBacklogDebugger
All Implemented Interfaces:
AutoCloseable, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.BacklogDebugger, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public final class DefaultBacklogDebugger extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.spi.BacklogDebugger
  • Method Details

    • createDebugger

      public static org.apache.camel.spi.BacklogDebugger createDebugger(org.apache.camel.CamelContext context)
      Creates a new backlog debugger.

      In case the environment variable BacklogDebugger.SUSPEND_MODE_ENV_VAR_NAME or the system property BacklogDebugger.SUSPEND_MODE_SYSTEM_PROP_NAME has been set to true, the message processing is directly suspended.

      Parameters:
      context - Camel context
      Returns:
      a new backlog debugger
    • getBacklogDebugger

      public static org.apache.camel.spi.BacklogDebugger getBacklogDebugger(org.apache.camel.CamelContext context)
      A helper method to return the BacklogDebugger instance if one is enabled
      Returns:
      the backlog debugger or null if none can be found
    • getInitialBreakpoints

      public String getInitialBreakpoints()
      Specified by:
      getInitialBreakpoints in interface org.apache.camel.spi.BacklogDebugger
    • setInitialBreakpoints

      public void setInitialBreakpoints(String initialBreakpoints)
      Specified by:
      setInitialBreakpoints in interface org.apache.camel.spi.BacklogDebugger
    • getLoggingLevel

      public String getLoggingLevel()
      Specified by:
      getLoggingLevel in interface org.apache.camel.spi.BacklogDebugger
    • setLoggingLevel

      public void setLoggingLevel(String level)
      Specified by:
      setLoggingLevel in interface org.apache.camel.spi.BacklogDebugger
    • enableDebugger

      public void enableDebugger()
      Specified by:
      enableDebugger in interface org.apache.camel.spi.BacklogDebugger
    • disableDebugger

      public void disableDebugger()
      Specified by:
      disableDebugger in interface org.apache.camel.spi.BacklogDebugger
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface org.apache.camel.spi.BacklogDebugger
    • hasBreakpoint

      public boolean hasBreakpoint(String nodeId)
      Specified by:
      hasBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • setSuspendMode

      public void setSuspendMode(boolean suspendMode)
      Specified by:
      setSuspendMode in interface org.apache.camel.spi.BacklogDebugger
    • isSuspendMode

      public boolean isSuspendMode()
      Specified by:
      isSuspendMode in interface org.apache.camel.spi.BacklogDebugger
    • isSingleStepMode

      public boolean isSingleStepMode()
      Specified by:
      isSingleStepMode in interface org.apache.camel.spi.BacklogDebugger
    • attach

      public void attach()
      Specified by:
      attach in interface org.apache.camel.spi.BacklogDebugger
    • detach

      public void detach()
      Specified by:
      detach in interface org.apache.camel.spi.BacklogDebugger
    • addBreakpoint

      public void addBreakpoint(String nodeId)
      Specified by:
      addBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • addConditionalBreakpoint

      public void addConditionalBreakpoint(String nodeId, String language, String predicate)
      Specified by:
      addConditionalBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • removeBreakpoint

      public void removeBreakpoint(String nodeId)
      Specified by:
      removeBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • removeAllBreakpoints

      public void removeAllBreakpoints()
      Specified by:
      removeAllBreakpoints in interface org.apache.camel.spi.BacklogDebugger
    • getBreakpoints

      public Set<String> getBreakpoints()
      Specified by:
      getBreakpoints in interface org.apache.camel.spi.BacklogDebugger
    • resumeBreakpoint

      public void resumeBreakpoint(String nodeId)
      Specified by:
      resumeBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • resumeBreakpoint

      public void resumeBreakpoint(String nodeId, boolean stepMode)
      Specified by:
      resumeBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • setMessageBodyOnBreakpoint

      public void setMessageBodyOnBreakpoint(String nodeId, Object body)
      Specified by:
      setMessageBodyOnBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • setMessageBodyOnBreakpoint

      public void setMessageBodyOnBreakpoint(String nodeId, Object body, Class<?> type)
      Specified by:
      setMessageBodyOnBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • removeMessageBodyOnBreakpoint

      public void removeMessageBodyOnBreakpoint(String nodeId)
      Specified by:
      removeMessageBodyOnBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • setMessageHeaderOnBreakpoint

      public void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value) throws org.apache.camel.NoTypeConversionAvailableException
      Specified by:
      setMessageHeaderOnBreakpoint in interface org.apache.camel.spi.BacklogDebugger
      Throws:
      org.apache.camel.NoTypeConversionAvailableException
    • setMessageHeaderOnBreakpoint

      public void setMessageHeaderOnBreakpoint(String nodeId, String headerName, Object value, Class<?> type) throws org.apache.camel.NoTypeConversionAvailableException
      Specified by:
      setMessageHeaderOnBreakpoint in interface org.apache.camel.spi.BacklogDebugger
      Throws:
      org.apache.camel.NoTypeConversionAvailableException
    • setExchangePropertyOnBreakpoint

      public void setExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName, Object value) throws org.apache.camel.NoTypeConversionAvailableException
      Specified by:
      setExchangePropertyOnBreakpoint in interface org.apache.camel.spi.BacklogDebugger
      Throws:
      org.apache.camel.NoTypeConversionAvailableException
    • setExchangePropertyOnBreakpoint

      public void setExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName, Object value, Class<?> type) throws org.apache.camel.NoTypeConversionAvailableException
      Specified by:
      setExchangePropertyOnBreakpoint in interface org.apache.camel.spi.BacklogDebugger
      Throws:
      org.apache.camel.NoTypeConversionAvailableException
    • removeExchangePropertyOnBreakpoint

      public void removeExchangePropertyOnBreakpoint(String nodeId, String exchangePropertyName)
      Specified by:
      removeExchangePropertyOnBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • getFallbackTimeout

      public long getFallbackTimeout()
      Specified by:
      getFallbackTimeout in interface org.apache.camel.spi.BacklogDebugger
    • setFallbackTimeout

      public void setFallbackTimeout(long fallbackTimeout)
      Specified by:
      setFallbackTimeout in interface org.apache.camel.spi.BacklogDebugger
    • removeMessageHeaderOnBreakpoint

      public void removeMessageHeaderOnBreakpoint(String nodeId, String headerName)
      Specified by:
      removeMessageHeaderOnBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • resumeAll

      public void resumeAll()
      Specified by:
      resumeAll in interface org.apache.camel.spi.BacklogDebugger
    • stepBreakpoint

      public void stepBreakpoint()
      Specified by:
      stepBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • stepBreakpoint

      public void stepBreakpoint(String nodeId)
      Specified by:
      stepBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • step

      public void step()
      Specified by:
      step in interface org.apache.camel.spi.BacklogDebugger
    • getSuspendedBreakpointNodeIds

      public Set<String> getSuspendedBreakpointNodeIds()
      Specified by:
      getSuspendedBreakpointNodeIds in interface org.apache.camel.spi.BacklogDebugger
    • getSuspendedExchange

      public org.apache.camel.Exchange getSuspendedExchange(String id)
      Specified by:
      getSuspendedExchange in interface org.apache.camel.spi.BacklogDebugger
    • getSuspendedBreakpointMessage

      public org.apache.camel.spi.BacklogTracerEventMessage getSuspendedBreakpointMessage(String id)
      Specified by:
      getSuspendedBreakpointMessage in interface org.apache.camel.spi.BacklogDebugger
    • disableBreakpoint

      public void disableBreakpoint(String nodeId)
      Specified by:
      disableBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • enableBreakpoint

      public void enableBreakpoint(String nodeId)
      Specified by:
      enableBreakpoint in interface org.apache.camel.spi.BacklogDebugger
    • isSingleStepIncludeStartEnd

      public boolean isSingleStepIncludeStartEnd()
      Specified by:
      isSingleStepIncludeStartEnd in interface org.apache.camel.spi.BacklogDebugger
    • setSingleStepIncludeStartEnd

      public void setSingleStepIncludeStartEnd(boolean singleStepIncludeStartEnd)
      Specified by:
      setSingleStepIncludeStartEnd in interface org.apache.camel.spi.BacklogDebugger
    • getBodyMaxChars

      public int getBodyMaxChars()
      Specified by:
      getBodyMaxChars in interface org.apache.camel.spi.BacklogDebugger
    • setBodyMaxChars

      public void setBodyMaxChars(int bodyMaxChars)
      Specified by:
      setBodyMaxChars in interface org.apache.camel.spi.BacklogDebugger
    • isBodyIncludeStreams

      public boolean isBodyIncludeStreams()
      Specified by:
      isBodyIncludeStreams in interface org.apache.camel.spi.BacklogDebugger
    • setBodyIncludeStreams

      public void setBodyIncludeStreams(boolean bodyIncludeStreams)
      Specified by:
      setBodyIncludeStreams in interface org.apache.camel.spi.BacklogDebugger
    • isBodyIncludeFiles

      public boolean isBodyIncludeFiles()
      Specified by:
      isBodyIncludeFiles in interface org.apache.camel.spi.BacklogDebugger
    • setBodyIncludeFiles

      public void setBodyIncludeFiles(boolean bodyIncludeFiles)
      Specified by:
      setBodyIncludeFiles in interface org.apache.camel.spi.BacklogDebugger
    • isIncludeExchangeProperties

      public boolean isIncludeExchangeProperties()
      Specified by:
      isIncludeExchangeProperties in interface org.apache.camel.spi.BacklogDebugger
    • setIncludeExchangeProperties

      public void setIncludeExchangeProperties(boolean includeExchangeProperties)
      Specified by:
      setIncludeExchangeProperties in interface org.apache.camel.spi.BacklogDebugger
    • isIncludeException

      public boolean isIncludeException()
      Specified by:
      isIncludeException in interface org.apache.camel.spi.BacklogDebugger
    • setIncludeException

      public void setIncludeException(boolean includeException)
      Specified by:
      setIncludeException in interface org.apache.camel.spi.BacklogDebugger
    • dumpTracedMessagesAsXml

      public String dumpTracedMessagesAsXml(String nodeId)
      Specified by:
      dumpTracedMessagesAsXml in interface org.apache.camel.spi.BacklogDebugger
    • dumpTracedMessagesAsJSon

      public String dumpTracedMessagesAsJSon(String nodeId)
      Specified by:
      dumpTracedMessagesAsJSon in interface org.apache.camel.spi.BacklogDebugger
    • getDebugCounter

      public long getDebugCounter()
      Specified by:
      getDebugCounter in interface org.apache.camel.spi.BacklogDebugger
    • resetDebugCounter

      public void resetDebugCounter()
      Specified by:
      resetDebugCounter in interface org.apache.camel.spi.BacklogDebugger
    • beforeProcess

      public org.apache.camel.util.StopWatch beforeProcess(org.apache.camel.Exchange exchange, org.apache.camel.Processor processor, org.apache.camel.NamedNode definition)
      Specified by:
      beforeProcess in interface org.apache.camel.spi.BacklogDebugger
    • afterProcess

      public void afterProcess(org.apache.camel.Exchange exchange, org.apache.camel.Processor processor, org.apache.camel.NamedNode definition, long timeTaken)
      Specified by:
      afterProcess in interface org.apache.camel.spi.BacklogDebugger
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      Throws:
      Exception