Package org.apache.camel.main
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
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final org.apache.camel.main.MainRegistryFields inherited from class org.apache.camel.main.MainCommandLineSupport
argumentProperties, optionsFields inherited from class org.apache.camel.main.MainSupport
camelTemplate, DEFAULT_EXIT_CODE, exitCode, LOG, shutdownStrategy, UNINITIALIZED_EXIT_CODEFields inherited from class org.apache.camel.main.BaseMainSupport
camelContext, defaultPropertyPlaceholderLocation, helper, initialProperties, listeners, mainConfigurationProperties, overrideProperties, propertyPlaceholderLocations, routesCollector, standalone, wildcardPropertiesFields 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidautoconfigure(org.apache.camel.CamelContext camelContext) voidBinds the givennameto thebeanobject, so that it can be looked up inside the CamelContext this command line tool runs with.protected voidconfigureInitialProperties(String location) Sets initial properties that are specific to camel-kamelet-mainprotected voidconfigurePropertiesService(org.apache.camel.CamelContext camelContext) protected voidconfigureRoutesLoader(org.apache.camel.CamelContext camelContext) protected ClassLoadercreateApplicationContextClassLoader(org.apache.camel.CamelContext camelContext) protected org.apache.camel.CamelContextprotected org.apache.camel.spi.LifecycleStrategycreateLifecycleStrategy(org.apache.camel.CamelContext camelContext) protected voiddoInit()protected voiddoStart()protected voiddoStop()protected org.apache.camel.ProducerTemplategetRepos()booleanbooleanisFresh()booleanisSilent()Using the givennamedoes lookup for the bean being already bound using thebind(String, Object)method.<T> TUsing the givennameandtypedoes lookup for the bean being already bound using thebind(String, Object)method.lookupByType(Class<T> type) Using the giventypedoes lookup for the bean being already bound using thebind(String, Object)method.static voidprotected voidpostProcessCamelRegistry(org.apache.camel.CamelContext camelContext, org.apache.camel.main.MainConfigurationProperties config) protected voidpreProcessCamelRegistry(org.apache.camel.CamelContext camelContext, org.apache.camel.main.MainConfigurationProperties config) voidsetDownload(boolean download) Whether to allow automatic downloaded JAR dependencies, over the internet, that Kamelets requires.voidsetDownloadListener(DownloadListener downloadListener) Sets a custom download listenervoidsetFresh(boolean fresh) Make sure we use fresh (i.e.voidsetMavenSettings(String mavenSettings) Optionally set the location of Maven settings.xml if it's different than~/.m2/settings.xml.voidsetMavenSettingsSecurity(String mavenSettingsSecurity) Optionally set the location of Maven settings-security.xml if it's different than~/.m2/settings-security.xml.voidAdditional maven repositories for download on-demand (Use commas to separate multiple repositories).voidsetSilent(boolean silent) Whether to run in silent mode (used during export or resolving dependencies)voidsetStubPattern(String stubPattern) Whether to use stub endpoints instead of creating the actual endpoints.voidprotected StringMethods inherited from class org.apache.camel.main.MainCommandLineSupport
addArgumentProperty, addOption, getArgumentProperties, initOptions, parseArguments, run, setArgumentProperties, setArgumentProperties, showOptionsMethods 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, waitUntilCompletedMethods 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, setRoutesCollectorMethods 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
-
Field Details
-
DEFAULT_KAMELETS_LOCATION
- See Also:
-
registry
protected final org.apache.camel.main.MainRegistry registry
-
-
Constructor Details
-
KameletMain
public KameletMain() -
KameletMain
-
-
Method Details
-
main
- Throws:
Exception
-
bind
Binds the givennameto thebeanobject, 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 bindbean- the object to bind
-
lookup
Using the givennamedoes lookup for the bean being already bound using thebind(String, Object)method.- See Also:
-
lookup
Using the givennameandtypedoes lookup for the bean being already bound using thebind(String, Object)method.- See Also:
-
lookupByType
Using the giventypedoes lookup for the bean being already bound using thebind(String, Object)method.- See Also:
-
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
-
setRepos
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
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
-
isSilent
public boolean isSilent() -
setSilent
public void setSilent(boolean silent) Whether to run in silent mode (used during export or resolving dependencies) -
setMavenSettings
Optionally set the location of Maven settings.xml if it's different than~/.m2/settings.xml. If set tofalse, no default settings file will be used at all. -
getMavenSettings
-
setMavenSettingsSecurity
Optionally set the location of Maven settings-security.xml if it's different than~/.m2/settings-security.xml. -
getMavenSettingsSecurity
-
getDownloadListener
-
setDownloadListener
Sets a custom download listener -
showOptionsHeader
public void showOptionsHeader()- Overrides:
showOptionsHeaderin classorg.apache.camel.main.MainCommandLineSupport
-
addInitialOptions
protected void addInitialOptions()- Overrides:
addInitialOptionsin classorg.apache.camel.main.MainCommandLineSupport
-
doInit
- Overrides:
doInitin classorg.apache.camel.main.MainSupport- Throws:
Exception
-
doStart
- Overrides:
doStartin classorg.apache.camel.main.MainSupport- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.apache.camel.main.MainSupport- Throws:
Exception
-
findOrCreateCamelTemplate
protected org.apache.camel.ProducerTemplate findOrCreateCamelTemplate()- Specified by:
findOrCreateCamelTemplatein classorg.apache.camel.main.MainSupport
-
createCamelContext
protected org.apache.camel.CamelContext createCamelContext()- Specified by:
createCamelContextin classorg.apache.camel.main.MainSupport
-
configurePropertiesService
protected void configurePropertiesService(org.apache.camel.CamelContext camelContext) throws Exception - Overrides:
configurePropertiesServicein classorg.apache.camel.main.MainCommandLineSupport- Throws:
Exception
-
autoconfigure
- Overrides:
autoconfigurein classorg.apache.camel.main.MainSupport- Throws:
Exception
-
createLifecycleStrategy
protected org.apache.camel.spi.LifecycleStrategy createLifecycleStrategy(org.apache.camel.CamelContext camelContext) - Overrides:
createLifecycleStrategyin classorg.apache.camel.main.BaseMainSupport
-
createApplicationContextClassLoader
protected ClassLoader createApplicationContextClassLoader(org.apache.camel.CamelContext camelContext) -
configureRoutesLoader
protected void configureRoutesLoader(org.apache.camel.CamelContext camelContext) - Overrides:
configureRoutesLoaderin classorg.apache.camel.main.BaseMainSupport
-
configureInitialProperties
Sets initial properties that are specific to camel-kamelet-main -
startupInfo
-
preProcessCamelRegistry
protected void preProcessCamelRegistry(org.apache.camel.CamelContext camelContext, org.apache.camel.main.MainConfigurationProperties config) - Overrides:
preProcessCamelRegistryin classorg.apache.camel.main.BaseMainSupport
-
postProcessCamelRegistry
protected void postProcessCamelRegistry(org.apache.camel.CamelContext camelContext, org.apache.camel.main.MainConfigurationProperties config) - Overrides:
postProcessCamelRegistryin classorg.apache.camel.main.BaseMainSupport
-