Java 类org.apache.camel.StartupListener 实例源码

项目:Camel    文件:DefaultCamelContext.java   
public void addStartupListener(StartupListener listener) throws Exception {
    // either add to listener so we can invoke then later when CamelContext has been started
    // or invoke the callback right now
    if (isStarted()) {
        listener.onCamelContextStarted(this, true);
    } else {
        startupListeners.add(listener);
    }
}
项目:Camel    文件:DefaultCamelContext.java   
private void startService(Service service) throws Exception {
    // and register startup aware so they can be notified when
    // camel context has been started
    if (service instanceof StartupListener) {
        StartupListener listener = (StartupListener) service;
        addStartupListener(listener);
    }

    if (service instanceof CamelContextAware) {
        CamelContextAware aware = (CamelContextAware) service;
        aware.setCamelContext(this);
    }

    service.start();
}
项目:dropwizard-camel    文件:ManagedCamelContext.java   
@Override
public void addStartupListener(StartupListener listener) throws Exception {
    context.addStartupListener(listener);
}