Class KameletMain

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.main.BaseMainSupport
org.apache.camel.main.MainSupport
org.apache.camel.main.MainCommandLineSupport
org.apache.camel.main.KameletMain

public class KameletMain extends org.apache.camel.main.MainCommandLineSupport
A Main class for booting up Camel with Kamelet in standalone mode.
  • 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
    Modifier and Type
    Field
    Description
    static final String
     
    protected final org.apache.camel.main.MainRegistry
     

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

    argumentProperties, 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, defaultPropertyPlaceholderLocation, helper, initialProperties, listeners, mainConfigurationProperties, overrideProperties, propertyPlaceholderLocations, routesCollector, standalone, 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
     
    KameletMain(String overrides)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
    autoconfigure(org.apache.camel.CamelContext camelContext)
     
    void
    bind(String name, Object bean)
    Binds the given name to the bean object, so that it can be looked up inside the CamelContext this command line tool runs with.
    protected void
    Sets initial properties that are specific to camel-kamelet-main
    protected void
    configurePropertiesService(org.apache.camel.CamelContext camelContext)
     
    protected void
    configureRoutesLoader(org.apache.camel.CamelContext camelContext)
     
    protected ClassLoader
    createApplicationContextClassLoader(org.apache.camel.CamelContext camelContext)
     
    protected org.apache.camel.CamelContext
     
    protected org.apache.camel.spi.LifecycleStrategy
    createLifecycleStrategy(org.apache.camel.CamelContext camelContext)
     
    protected void
     
    protected void
     
    protected void
     
    protected org.apache.camel.ProducerTemplate
     
     
     
     
     
     
    boolean
     
    boolean
     
    boolean
     
    lookup(String name)
    Using the given name does lookup for the bean being already bound using the bind(String, Object) method.
    <T> T
    lookup(String name, Class<T> type)
    Using the given name and type does lookup for the bean being already bound using the bind(String, Object) method.
    <T> Map<String,T>
    Using the given type does lookup for the bean being already bound using the bind(String, Object) method.
    static void
    main(String... args)
     
    protected void
    postProcessCamelRegistry(org.apache.camel.CamelContext camelContext, org.apache.camel.main.MainConfigurationProperties config)
     
    protected void
    preProcessCamelRegistry(org.apache.camel.CamelContext camelContext, org.apache.camel.main.MainConfigurationProperties config)
     
    void
    setDownload(boolean download)
    Whether to allow automatic downloaded JAR dependencies, over the internet, that Kamelets requires.
    void
    Sets a custom download listener
    void
    setFresh(boolean fresh)
    Make sure we use fresh (i.e.
    void
    setMavenSettings(String mavenSettings)
    Optionally set the location of Maven settings.xml if it's different than ~/.m2/settings.xml.
    void
    setMavenSettingsSecurity(String mavenSettingsSecurity)
    Optionally set the location of Maven settings-security.xml if it's different than ~/.m2/settings-security.xml.
    void
    Additional maven repositories for download on-demand (Use commas to separate multiple repositories).
    void
    setSilent(boolean silent)
    Whether to run in silent mode (used during export or resolving dependencies)
    void
    setStubPattern(String stubPattern)
    Whether to use stub endpoints instead of creating the actual endpoints.
    void
     
    protected String
     

    Methods inherited from class org.apache.camel.main.MainCommandLineSupport

    addArgumentProperty, addOption, getArgumentProperties, initOptions, parseArguments, run, setArgumentProperties, setArgumentProperties, showOptions

    Methods inherited from class org.apache.camel.main.MainSupport

    afterStart, afterStop, beforeStart, beforeStop, completed, configureLifecycle, enableTrace, enableTraceStandby, getAppName, getCamelTemplate, getCompleteTask, getExitCode, getShutdownStrategy, initCamelContext, internalBeforeStart, isTrace, registerMainBootstrap, run, setAppName, setShutdownStrategy, waitUntilCompleted

    Methods inherited from class org.apache.camel.main.BaseMainSupport

    addInitialProperty, addMainListener, addOverrideProperty, addProperty, autoConfigurationFailFast, autoConfigurationFromProperties, autoConfigurationFromReloadedProperties, autoConfigurationMainConfiguration, autoConfigurationPropertiesComponent, autoConfigurationSingleOption, autowireWildcardProperties, configure, configurePackageScan, configureRoutes, configureStartupRecorder, doAutoConfigurationFromProperties, doAutowireWildcardProperties, doConfigureCamelContextFromMainConfiguration, getCamelContext, getDefaultPropertyPlaceholderLocation, getInitialProperties, getOverrideProperties, getPropertyPlaceholderLocations, getRoutesCollector, loadConfigurations, loadCustomBeans, modelineRoutes, postProcessCamelContext, removeMainListener, 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 class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_KAMELETS_LOCATION

      public static final String DEFAULT_KAMELETS_LOCATION
      See Also:
    • registry

      protected final org.apache.camel.main.MainRegistry registry
  • Constructor Details

    • KameletMain

      public KameletMain()
    • KameletMain

      public KameletMain(String overrides)
  • Method Details

    • main

      public static void main(String... args) throws Exception
      Throws:
      Exception
    • bind

      public void bind(String name, Object bean)
      Binds the given name to the bean object, so that it can be looked up inside the CamelContext this command line tool runs with.
      Parameters:
      name - the used name through which we do bind
      bean - the object to bind
    • lookup

      public Object lookup(String name)
      Using the given name does lookup for the bean being already bound using the bind(String, Object) method.
      See Also:
      • BeanRepository.lookupByName(String)
    • lookup

      public <T> T lookup(String name, Class<T> type)
      Using the given name and type does lookup for the bean being already bound using the bind(String, Object) method.
      See Also:
      • BeanRepository.lookupByNameAndType(String, Class)
    • lookupByType

      public <T> Map<String,T> lookupByType(Class<T> type)
      Using the given type does lookup for the bean being already bound using the bind(String, Object) method.
      See Also:
      • BeanRepository.findByTypeWithName(Class)
    • isDownload

      public boolean isDownload()
    • setDownload

      public void setDownload(boolean download)
      Whether to allow automatic downloaded JAR dependencies, over the internet, that Kamelets requires. This is by default enabled.
    • getRepos

      public String getRepos()
    • setRepos

      public void setRepos(String repos)
      Additional maven repositories for download on-demand (Use commas to separate multiple repositories).
    • isFresh

      public boolean isFresh()
    • setFresh

      public void setFresh(boolean fresh)
      Make sure we use fresh (i.e. non-cached) resources.
    • setStubPattern

      public void setStubPattern(String stubPattern)
      Whether to use stub endpoints instead of creating the actual endpoints. This allows to simulate using real components but run without them on the classpath.
      Parameters:
      stubPattern - endpoint pattern (Use * for all).
    • getStubPattern

      public String getStubPattern()
    • isSilent

      public boolean isSilent()
    • setSilent

      public void setSilent(boolean silent)
      Whether to run in silent mode (used during export or resolving dependencies)
    • setMavenSettings

      public void setMavenSettings(String mavenSettings)
      Optionally set the location of Maven settings.xml if it's different than ~/.m2/settings.xml. If set to false, no default settings file will be used at all.
    • getMavenSettings

      public String getMavenSettings()
    • setMavenSettingsSecurity

      public void setMavenSettingsSecurity(String mavenSettingsSecurity)
      Optionally set the location of Maven settings-security.xml if it's different than ~/.m2/settings-security.xml.
    • getMavenSettingsSecurity

      public String getMavenSettingsSecurity()
    • getDownloadListener

      public DownloadListener getDownloadListener()
    • setDownloadListener

      public void setDownloadListener(DownloadListener downloadListener)
      Sets a custom download listener
    • showOptionsHeader

      public void showOptionsHeader()
      Overrides:
      showOptionsHeader in class org.apache.camel.main.MainCommandLineSupport
    • addInitialOptions

      protected void addInitialOptions()
      Overrides:
      addInitialOptions in class org.apache.camel.main.MainCommandLineSupport
    • doInit

      protected void doInit() throws Exception
      Overrides:
      doInit in class org.apache.camel.main.MainSupport
      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
    • createCamelContext

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

      protected void configurePropertiesService(org.apache.camel.CamelContext camelContext) throws Exception
      Overrides:
      configurePropertiesService in class org.apache.camel.main.MainCommandLineSupport
      Throws:
      Exception
    • autoconfigure

      protected void autoconfigure(org.apache.camel.CamelContext camelContext) throws Exception
      Overrides:
      autoconfigure in class org.apache.camel.main.MainSupport
      Throws:
      Exception
    • createLifecycleStrategy

      protected org.apache.camel.spi.LifecycleStrategy createLifecycleStrategy(org.apache.camel.CamelContext camelContext)
      Overrides:
      createLifecycleStrategy in class org.apache.camel.main.BaseMainSupport
    • createApplicationContextClassLoader

      protected ClassLoader createApplicationContextClassLoader(org.apache.camel.CamelContext camelContext)
    • configureRoutesLoader

      protected void configureRoutesLoader(org.apache.camel.CamelContext camelContext)
      Overrides:
      configureRoutesLoader in class org.apache.camel.main.BaseMainSupport
    • configureInitialProperties

      protected void configureInitialProperties(String location)
      Sets initial properties that are specific to camel-kamelet-main
    • startupInfo

      protected String startupInfo()
    • preProcessCamelRegistry

      protected void preProcessCamelRegistry(org.apache.camel.CamelContext camelContext, org.apache.camel.main.MainConfigurationProperties config)
      Overrides:
      preProcessCamelRegistry in class org.apache.camel.main.BaseMainSupport
    • postProcessCamelRegistry

      protected void postProcessCamelRegistry(org.apache.camel.CamelContext camelContext, org.apache.camel.main.MainConfigurationProperties config)
      Overrides:
      postProcessCamelRegistry in class org.apache.camel.main.BaseMainSupport