Package org.apache.camel.main
Class Main
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.Main
A Main class for booting up Camel in standalone mode.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.camel.main.MainCommandLineSupport
MainCommandLineSupport.Option, MainCommandLineSupport.ParameterOption -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Mainprotected Class<?>protected final 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 TypeMethodDescriptionvoidBinds the givennameto thebeanobject, so that it can be looked up inside the CamelContext this command line tool runs with.protected org.apache.camel.CamelContextprotected voiddoInit()protected voiddoStart()protected voiddoStop()protected org.apache.camel.ProducerTemplatestatic MainReturns the currently executing mainUsing 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 voidMethods inherited from class org.apache.camel.main.MainCommandLineSupport
addArgumentProperty, addInitialOptions, addOption, configurePropertiesService, getArgumentProperties, initOptions, parseArguments, run, setArgumentProperties, setArgumentProperties, showOptions, showOptionsHeaderMethods inherited from class org.apache.camel.main.MainSupport
afterStart, afterStop, autoconfigure, 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, configureRoutesLoader, configureStartupRecorder, doAutoConfigurationFromProperties, doAutowireWildcardProperties, doConfigureCamelContextFromMainConfiguration, getCamelContext, getDefaultPropertyPlaceholderLocation, getInitialProperties, getOverrideProperties, getPropertyPlaceholderLocations, getRoutesCollector, loadConfigurations, loadCustomBeans, modelineRoutes, postProcessCamelContext, postProcessCamelRegistry, preProcessCamelRegistry, 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
-
instance
-
registry
-
mainClass
-
-
Constructor Details
-
Main
public Main()Camel main application It is recommended to useMain(Class)to specify the main class. -
Main
Camel main application- Parameters:
mainClass- the main class
-
Main
@SafeVarargs public Main(Class<?> mainClass, Class<org.apache.camel.CamelConfiguration>... configurationClasses) Camel main application- Parameters:
mainClass- the main classconfigurationClasses- additional camel configuration classes
-
-
Method Details
-
main
- Throws:
Exception
-
getInstance
Returns the currently executing main- Returns:
- the current running instance
-
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:
-
BeanRepository.lookupByName(String)
-
lookup
Using the givennameandtypedoes lookup for the bean being already bound using thebind(String, Object)method.- See Also:
-
BeanRepository.lookupByNameAndType(String, Class)
-
lookupByType
Using the giventypedoes lookup for the bean being already bound using thebind(String, Object)method.- See Also:
-
BeanRepository.findByTypeWithName(Class)
-
doInit
- Overrides:
doInitin classMainSupport- Throws:
Exception
-
doStart
- Overrides:
doStartin classMainSupport- Throws:
Exception
-
doStop
- Overrides:
doStopin classMainSupport- Throws:
Exception
-
findOrCreateCamelTemplate
protected org.apache.camel.ProducerTemplate findOrCreateCamelTemplate()- Specified by:
findOrCreateCamelTemplatein classMainSupport
-
createCamelContext
protected org.apache.camel.CamelContext createCamelContext()- Specified by:
createCamelContextin classMainSupport
-