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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations