Search in sources :

Example 76 with DefaultCamelContext

use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.

the class MultipleEventNotifierEventsTest method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    DefaultCamelContext context = new DefaultCamelContext(createRegistry());
    context.getManagementStrategy().addEventNotifier(new EventNotifierSupport() {

        public void notify(EventObject event) throws Exception {
            events.add(event);
        }

        public boolean isEnabled(EventObject event) {
            return true;
        }

        @Override
        protected void doStart() throws Exception {
        }

        @Override
        protected void doStop() throws Exception {
        }
    });
    context.getManagementStrategy().addEventNotifier(new EventNotifierSupport() {

        public void notify(EventObject event) throws Exception {
            events2.add(event);
        }

        public boolean isEnabled(EventObject event) {
            return true;
        }

        @Override
        protected void doStart() throws Exception {
            setIgnoreCamelContextEvents(true);
            setIgnoreServiceEvents(true);
            setIgnoreRouteEvents(true);
        }

        @Override
        protected void doStop() throws Exception {
        }
    });
    return context;
}
Also used : EventNotifierSupport(org.apache.camel.support.EventNotifierSupport) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) EventObject(java.util.EventObject)

Example 77 with DefaultCamelContext

use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.

the class PublishEventNotifierTest method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    CamelContext context = new DefaultCamelContext(createRegistry());
    PublishEventNotifier notifier = new PublishEventNotifier();
    notifier.setCamelContext(context);
    notifier.setEndpointUri("mock:event");
    context.getManagementStrategy().addEventNotifier(notifier);
    return context;
}
Also used : CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext)

Example 78 with DefaultCamelContext

use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.

the class PublishEventNotifierToRouteTest method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    CamelContext context = new DefaultCamelContext(createRegistry());
    PublishEventNotifier notifier = new PublishEventNotifier();
    notifier.setCamelContext(context);
    notifier.setEndpointUri("seda:event");
    context.getManagementStrategy().addEventNotifier(notifier);
    return context;
}
Also used : CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext)

Example 79 with DefaultCamelContext

use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.

the class TwoManagedCamelContextClashTest method createCamelContext.

protected CamelContext createCamelContext(String name, String managementPattern) throws Exception {
    DefaultCamelContext context = new DefaultCamelContext();
    context.setName(name);
    if (managementPattern != null) {
        context.getManagementNameStrategy().setNamePattern(managementPattern);
    }
    return context;
}
Also used : DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext)

Example 80 with DefaultCamelContext

use of org.apache.camel.impl.DefaultCamelContext in project camel by apache.

the class TwoManagedCamelContextTest method createCamelContext.

protected CamelContext createCamelContext(String name) throws Exception {
    DefaultCamelContext context = new DefaultCamelContext();
    context.setName(name);
    return context;
}
Also used : DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext)

Aggregations

DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)474 CamelContext (org.apache.camel.CamelContext)206 Test (org.junit.Test)183 DefaultExchange (org.apache.camel.impl.DefaultExchange)128 RouteBuilder (org.apache.camel.builder.RouteBuilder)101 Exchange (org.apache.camel.Exchange)91 Before (org.junit.Before)70 SimpleRegistry (org.apache.camel.impl.SimpleRegistry)61 RegisteredDelivery (org.jsmpp.bean.RegisteredDelivery)39 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)38 ESMClass (org.jsmpp.bean.ESMClass)30 ProducerTemplate (org.apache.camel.ProducerTemplate)27 CountDownLatch (java.util.concurrent.CountDownLatch)15 Endpoint (org.apache.camel.Endpoint)13 FailedToCreateRouteException (org.apache.camel.FailedToCreateRouteException)13 Processor (org.apache.camel.Processor)12 RouteStartupOrder (org.apache.camel.spi.RouteStartupOrder)12 Address (org.jsmpp.bean.Address)11 SubmitMultiResult (org.jsmpp.bean.SubmitMultiResult)11 Date (java.util.Date)10