Search in sources :

Example 1 with ExchangeFailedEvent

use of org.apache.camel.management.event.ExchangeFailedEvent in project camel by apache.

the class DebugExceptionEventBreakpointTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    breakpoint = new BreakpointSupport() {

        public void onEvent(Exchange exchange, EventObject event, ProcessorDefinition<?> definition) {
            AbstractExchangeEvent aee = (AbstractExchangeEvent) event;
            Exception e = aee.getExchange().getException();
            logs.add("Breakpoint at " + definition + " caused by: " + e.getClass().getSimpleName() + "[" + e.getMessage() + "]");
        }
    };
    exceptionCondition = new ConditionSupport() {

        public boolean matchEvent(Exchange exchange, EventObject event) {
            return event instanceof ExchangeFailedEvent;
        }
    };
}
Also used : Exchange(org.apache.camel.Exchange) ExchangeFailedEvent(org.apache.camel.management.event.ExchangeFailedEvent) BreakpointSupport(org.apache.camel.impl.BreakpointSupport) ConditionSupport(org.apache.camel.impl.ConditionSupport) AbstractExchangeEvent(org.apache.camel.management.event.AbstractExchangeEvent) EventObject(java.util.EventObject)

Aggregations

EventObject (java.util.EventObject)1 Exchange (org.apache.camel.Exchange)1 BreakpointSupport (org.apache.camel.impl.BreakpointSupport)1 ConditionSupport (org.apache.camel.impl.ConditionSupport)1 AbstractExchangeEvent (org.apache.camel.management.event.AbstractExchangeEvent)1 ExchangeFailedEvent (org.apache.camel.management.event.ExchangeFailedEvent)1