Tabnine Logo
CamelContextStartedEvent.getContext
Code IndexAdd Tabnine to your IDE (free)

How to use
getContext
method
in
org.apache.camel.management.event.CamelContextStartedEvent

Best Java code snippets using org.apache.camel.management.event.CamelContextStartedEvent.getContext (Showing top 6 results out of 315)

origin: com.bosch.bis.monitoring/bis-event-publisher-impl

@Override
protected void camelContextStarted(CamelContextStartedEvent event) {
  if (reportNonCustomEndpointIDs) {
    reportNonCustomEndpointIDs(event.getContext());
  }
}
origin: camelinaction/camelinaction2

  /**
   * Listen for event (observe using @Observes) when Camel is started.
   * <p/>
   * You can listen for any of the Camel events from org.apache.camel.management.event package.
   */
  void onContextStarted(@Observes CamelContextStartedEvent event) {
    System.out.println("***************************************");
    System.out.println("* Camel started " + event.getContext().getName());
    System.out.println("***************************************");
  }
}
origin: camelinaction/camelinaction2

  /**
   * Listen for event (observe using @Observes) when Camel is started.
   * <p/>
   * You can listen for any of the Camel events from org.apache.camel.management.event package.
   */
  void onContextStarted(@Observes CamelContextStartedEvent event) {
    System.out.println("***************************************");
    System.out.println("* Camel started " + event.getContext().getName());
    System.out.println("***************************************");
  }
}
origin: org.apache.camel/camel-core-osgi

public void notify(EventObject event) throws Exception {
  if (event instanceof CamelContextStartedEvent) {
    CamelContext context = ((CamelContextStartedEvent) event).getContext();
    registerCamelContext(context);
  } else if (event instanceof CamelContextStoppingEvent) {
    CamelContext context = ((CamelContextStoppingEvent) event).getContext();
    ServiceRegistration<?> reg = registrations.remove(context);
    if (reg != null) {
      if (log.isDebugEnabled()) {
        log.debug("Unregistering CamelContext [{}] from OSGi registry", context.getName());
      }
      try {
        reg.unregister();
      } catch (Exception e) {
        log.warn("Error unregistering CamelContext [" + context.getName() + "] from OSGi registry. This exception will be ignored.", e);
      }
    }
  }
}
origin: com.bosch.bis.monitoring/bis-event-publisher-impl

@Override
public void notify(EventObject event) throws Exception {
  if (event instanceof CamelContextStartedEvent) {
    CamelContextStartedEvent contextStartedEvent = (CamelContextStartedEvent) event;
    publishModel(contextStartedEvent.getContext());
  }
  if (event instanceof RouteAddedEvent) {
    routeAdded((RouteAddedEvent) event);
  } else if (event instanceof RouteRemovedEvent) {
    routeRemoved((RouteRemovedEvent) event);
  }
}
origin: stackoverflow.com

 public class ContextStartEventListener extends EventNotifierSupport implements ApplicationContextAware {

    private ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) {
      this.applicationContext = applicationContext;
    }

    @Override
    public void notify(EventObject event) throws Exception {
      if (event instanceof CamelContextStartedEvent) {
        try {
          CamelContextStartedEvent startedEvent = (CamelContextStartedEvent) event;
          DefaultCamelContext context=(DefaultCamelContext)startedEvent.getContext();
          Resource[] xmlResources=applicationContext.getResources("classpath*:net/**/route.xml");
          for (int i=0;i<xmlResources.length;i++) {
            InputStream is = xmlResources[i].getInputStream();
            RoutesDefinition routes = context.loadRoutesDefinition(is);
            context.addRouteDefinitions(routes.getRoutes());
          }       
        } catch (Throwable ex) {
          // do something on error
        }
      }
    }
...
org.apache.camel.management.eventCamelContextStartedEventgetContext

Popular methods of CamelContextStartedEvent

    Popular in Java

    • Start an intent from android
    • addToBackStack (FragmentTransaction)
    • startActivity (Activity)
    • setContentView (Activity)
    • FileWriter (java.io)
      A specialized Writer that writes to a file in the file system. All write requests made by calling me
    • PrintWriter (java.io)
      Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
    • SSLHandshakeException (javax.net.ssl)
      The exception that is thrown when a handshake could not be completed successfully.
    • HttpServlet (javax.servlet.http)
      Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
    • JPanel (javax.swing)
    • Base64 (org.apache.commons.codec.binary)
      Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
    • Top Sublime Text plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now