org.apache.camel.spi.CamelEvent Java Examples

The following examples show how to use org.apache.camel.spi.CamelEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CronSourceLoaderInterceptor.java    From camel-k-runtime with Apache License 2.0 5 votes vote down vote up
@Override
public void notify(CamelEvent event) throws Exception {
    LOGGER.info("Initiate runtime shutdown");
    this.runtime.getCamelContext().getExecutorServiceManager().newThread("CronShutdownStrategy", () -> {
        try {
            LOGGER.info("Shutting down the runtime");
            runtime.stop();
        } catch (Exception e) {
            LOGGER.warn("Error while shutting down the runtime", e);
        }
    }).start();
}
 
Example #2
Source File: CamelManagementEventBridge.java    From camel-quarkus with Apache License 2.0 4 votes vote down vote up
@Override
public void notify(CamelEvent event) throws Exception {
    beanManager.getEvent().select(CamelEvent.class).fire(event);
}
 
Example #3
Source File: CamelManagementEventBridge.java    From camel-quarkus with Apache License 2.0 4 votes vote down vote up
@Override
public boolean isEnabled(CamelEvent event) {
    return true;
}
 
Example #4
Source File: CamelLifecycleEventBridge.java    From camel-quarkus with Apache License 2.0 4 votes vote down vote up
private <T extends CamelEvent> void fireEvent(T event) {
    beanManager.get().getEvent().select(CamelEvent.class).fire(event);
}
 
Example #5
Source File: CamelEventNotifierTest.java    From camel-spring-boot with Apache License 2.0 4 votes vote down vote up
@Override
public void notify(CamelEvent event) throws Exception {
    counter.incrementAndGet();
}
 
Example #6
Source File: CamelEventNotifierTest.java    From camel-spring-boot with Apache License 2.0 4 votes vote down vote up
@Override
public boolean isEnabled(CamelEvent event) {
    return true;
}
 
Example #7
Source File: CronSourceLoaderInterceptor.java    From camel-k-runtime with Apache License 2.0 4 votes vote down vote up
@Override
public boolean isEnabled(CamelEvent event) {
    return event instanceof CamelEvent.ExchangeCompletedEvent || event instanceof CamelEvent.ExchangeFailedEvent;
}
 
Example #8
Source File: CamelContextStartupEventNotifier.java    From wildfly-camel with Apache License 2.0 4 votes vote down vote up
@Override
public void notify(CamelEvent event) throws Exception {
       if (event instanceof CamelContextStartedEvent) {
           this.startupTime = System.currentTimeMillis();
       }
   }