Class CamelMain

  • All Implemented Interfaces:
    org.apache.camel.spi.HasCamelContext

    public final class CamelMain
    extends org.apache.camel.main.MainCommandLineSupport
    implements org.apache.camel.spi.HasCamelContext
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.camel.main.MainCommandLineSupport

        org.apache.camel.main.MainCommandLineSupport.Option, org.apache.camel.main.MainCommandLineSupport.ParameterOption
    • Field Summary

      • Fields inherited from class org.apache.camel.main.MainCommandLineSupport

        options
      • Fields inherited from class org.apache.camel.main.MainSupport

        camelTemplate, DEFAULT_EXIT_CODE, exitCode, LOG, shutdownStrategy, UNINITIALIZED_EXIT_CODE
      • Fields inherited from class org.apache.camel.main.BaseMainSupport

        camelContext, DEFAULT_PROPERTY_PLACEHOLDER_LOCATION, defaultPropertyPlaceholderLocation, INITIAL_PROPERTIES_LOCATION, initialProperties, listeners, mainConfigurationProperties, OVERRIDE_PROPERTIES_LOCATION, overrideProperties, PROPERTY_PLACEHOLDER_LOCATION, propertyPlaceholderLocations, routesCollector, wildcardProperties
      • Fields inherited from class org.apache.camel.support.service.BaseService

        BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
    • Constructor Summary

      Constructors 
      Constructor Description
      CamelMain​(org.apache.camel.CamelContext camelContext)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apache.camel.CamelContext createCamelContext()  
      protected void doInit()  
      protected void doStart()  
      protected void doStop()  
      protected org.apache.camel.ProducerTemplate findOrCreateCamelTemplate()  
      (package private) org.apache.camel.main.MainConfigurationProperties getMainConfigurationProperties()  
      (package private) Collection<org.apache.camel.main.MainListener> getMainListeners()  
      protected void initCamelContext()  
      protected void loadRouteBuilders​(org.apache.camel.CamelContext camelContext)  
      void run​(String[] args)  
      void runEngine()
      Start the engine if not done already and wait until completed, or the JVM terminates.
      void startEngine()
      Start the engine.
      • Methods inherited from class org.apache.camel.main.MainCommandLineSupport

        addOption, initOptions, parseArguments, showOptions, showOptionsHeader
      • Methods inherited from class org.apache.camel.main.MainSupport

        afterStart, afterStop, beforeStart, beforeStop, completed, configureLifecycle, enableTrace, getCamelTemplate, getCompleteTask, getDuration, getDurationHitExitCode, getDurationIdle, getDurationMaxMessages, getExitCode, getShutdownStrategy, isTrace, run, setDuration, setDurationHitExitCode, setDurationIdle, setDurationMaxMessages, setShutdownStrategy, waitUntilCompleted
      • Methods inherited from class org.apache.camel.main.BaseMainSupport

        addInitialProperty, addMainListener, addOverrideProperty, addProperty, autoConfigurationFailFast, autoConfigurationFromProperties, autoConfigurationMainConfiguration, autoConfigurationPropertiesComponent, autoconfigure, autowireWildcardProperties, configure, configurePropertiesService, configureRoutes, doAutowireWildcardProperties, doConfigureCamelContextFromMainConfiguration, getCamelContext, getDefaultPropertyPlaceholderLocation, getInitialProperties, getOverrideProperties, getPropertyPlaceholderLocations, getRoutesCollector, isAutoConfigurationEnabled, loadConfigurations, postProcessCamelContext, removeMainListener, setAutoConfigurationEnabled, setDefaultPropertyPlaceholderLocation, setInitialProperties, setInitialProperties, setOverrideProperties, setOverrideProperties, setPropertyPlaceholderLocations, setRoutesCollector
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
      • Methods inherited from interface org.apache.camel.spi.HasCamelContext

        getCamelContext
    • Constructor Detail

      • CamelMain

        public CamelMain​(org.apache.camel.CamelContext camelContext)
    • Method Detail

      • loadRouteBuilders

        protected void loadRouteBuilders​(org.apache.camel.CamelContext camelContext)
                                  throws Exception
        Overrides:
        loadRouteBuilders in class org.apache.camel.main.BaseMainSupport
        Throws:
        Exception
      • doInit

        protected void doInit()
                       throws Exception
        Overrides:
        doInit in class org.apache.camel.support.service.BaseService
        Throws:
        Exception
      • doStart

        protected void doStart()
                        throws Exception
        Overrides:
        doStart in class org.apache.camel.main.MainSupport
        Throws:
        Exception
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.apache.camel.main.MainSupport
        Throws:
        Exception
      • findOrCreateCamelTemplate

        protected org.apache.camel.ProducerTemplate findOrCreateCamelTemplate()
        Specified by:
        findOrCreateCamelTemplate in class org.apache.camel.main.MainSupport
      • initCamelContext

        protected void initCamelContext()
                                 throws Exception
        Overrides:
        initCamelContext in class org.apache.camel.main.MainSupport
        Throws:
        Exception
      • createCamelContext

        protected org.apache.camel.CamelContext createCamelContext()
        Specified by:
        createCamelContext in class org.apache.camel.main.MainSupport
      • getMainListeners

        Collection<org.apache.camel.main.MainListener> getMainListeners()
      • getMainConfigurationProperties

        org.apache.camel.main.MainConfigurationProperties getMainConfigurationProperties()
      • startEngine

        public void startEngine()
                         throws Exception
        Start the engine.
        Throws:
        Exception
      • runEngine

        public void runEngine()
                       throws Exception
        Start the engine if not done already and wait until completed, or the JVM terminates.
        Throws:
        Exception
      • run

        public void run​(String[] args)
                 throws Exception
        Overrides:
        run in class org.apache.camel.main.MainCommandLineSupport
        Throws:
        Exception