use of org.apache.camel.spi.ManagementStrategy in project camel by apache.
the class EventHelper method notifyCamelContextResuming.
public static void notifyCamelContextResuming(CamelContext context) {
ManagementStrategy management = context.getManagementStrategy();
if (management == null) {
return;
}
List<EventNotifier> notifiers = management.getEventNotifiers();
if (notifiers == null || notifiers.isEmpty()) {
return;
}
for (EventNotifier notifier : notifiers) {
if (notifier.isIgnoreCamelContextEvents()) {
continue;
}
EventFactory factory = management.getEventFactory();
if (factory == null) {
return;
}
EventObject event = factory.createCamelContextResumingEvent(context);
if (event == null) {
return;
}
doNotifyEvent(notifier, event);
}
}
use of org.apache.camel.spi.ManagementStrategy in project camel by apache.
the class EventHelper method notifyExchangeFailed.
public static void notifyExchangeFailed(CamelContext context, Exchange exchange) {
if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) {
// do not generate events for an notify event
return;
}
ManagementStrategy management = context.getManagementStrategy();
if (management == null) {
return;
}
List<EventNotifier> notifiers = management.getEventNotifiers();
if (notifiers == null || notifiers.isEmpty()) {
return;
}
for (EventNotifier notifier : notifiers) {
if (notifier.isIgnoreExchangeEvents() || notifier.isIgnoreExchangeFailedEvents()) {
continue;
}
EventFactory factory = management.getEventFactory();
if (factory == null) {
return;
}
EventObject event = factory.createExchangeFailedEvent(exchange);
if (event == null) {
return;
}
doNotifyEvent(notifier, event);
}
}
use of org.apache.camel.spi.ManagementStrategy in project camel by apache.
the class EventHelper method notifyExchangeFailureHandled.
public static void notifyExchangeFailureHandled(CamelContext context, Exchange exchange, Processor failureHandler, boolean deadLetterChannel, String deadLetterUri) {
if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) {
// do not generate events for an notify event
return;
}
ManagementStrategy management = context.getManagementStrategy();
if (management == null) {
return;
}
List<EventNotifier> notifiers = management.getEventNotifiers();
if (notifiers == null || notifiers.isEmpty()) {
return;
}
for (EventNotifier notifier : notifiers) {
if (notifier.isIgnoreExchangeEvents() || notifier.isIgnoreExchangeFailedEvents()) {
continue;
}
EventFactory factory = management.getEventFactory();
if (factory == null) {
return;
}
EventObject event = factory.createExchangeFailureHandledEvent(exchange, failureHandler, deadLetterChannel, deadLetterUri);
if (event == null) {
return;
}
doNotifyEvent(notifier, event);
}
}
use of org.apache.camel.spi.ManagementStrategy in project camel by apache.
the class EventHelper method notifyExchangeCreated.
public static void notifyExchangeCreated(CamelContext context, Exchange exchange) {
if (exchange.getProperty(Exchange.NOTIFY_EVENT, false, Boolean.class)) {
// do not generate events for an notify event
return;
}
ManagementStrategy management = context.getManagementStrategy();
if (management == null) {
return;
}
List<EventNotifier> notifiers = management.getEventNotifiers();
if (notifiers == null || notifiers.isEmpty()) {
return;
}
for (EventNotifier notifier : notifiers) {
if (notifier.isIgnoreExchangeEvents() || notifier.isIgnoreExchangeCreatedEvent()) {
continue;
}
EventFactory factory = management.getEventFactory();
if (factory == null) {
return;
}
EventObject event = factory.createExchangeCreatedEvent(exchange);
if (event == null) {
return;
}
doNotifyEvent(notifier, event);
}
}
use of org.apache.camel.spi.ManagementStrategy in project camel by apache.
the class EventHelper method notifyCamelContextStarting.
public static void notifyCamelContextStarting(CamelContext context) {
ManagementStrategy management = context.getManagementStrategy();
if (management == null) {
return;
}
List<EventNotifier> notifiers = management.getEventNotifiers();
if (notifiers == null || notifiers.isEmpty()) {
return;
}
for (EventNotifier notifier : notifiers) {
if (notifier.isIgnoreCamelContextEvents()) {
continue;
}
EventFactory factory = management.getEventFactory();
if (factory == null) {
return;
}
EventObject event = factory.createCamelContextStartingEvent(context);
if (event == null) {
return;
}
doNotifyEvent(notifier, event);
}
}
Aggregations