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
Modifier and TypeFieldDescriptionprotected static Main
protected Class
<?> protected final 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Binds the givenname
to thebean
object, so that it can be looked up inside the CamelContext this command line tool runs with.protected org.apache.camel.CamelContext
protected void
doInit()
protected void
doStart()
protected void
doStop()
protected org.apache.camel.ProducerTemplate
static Main
Returns the currently executing mainUsing the givenname
does lookup for the bean being already bound using thebind(String, Object)
method.<T> T
Using the givenname
andtype
does lookup for the bean being already bound using thebind(String, Object)
method.lookupByType
(Class<T> type) Using the giventype
does lookup for the bean being already bound using thebind(String, Object)
method.static void
Methods inherited from class org.apache.camel.main.MainCommandLineSupport
addArgumentProperty, addInitialOptions, addOption, configurePropertiesService, getArgumentProperties, initOptions, parseArguments, run, setArgumentProperties, setArgumentProperties, showOptions, showOptionsHeader
Methods 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, waitUntilCompleted
Methods inherited from class org.apache.camel.main.BaseMainSupport
addInitialProperty, addMainListener, addOverrideProperty, addProperty, autoConfigurationFailFast, autoConfigurationFromProperties, autoConfigurationFromReloadedProperties, autoConfigurationMainConfiguration, autoConfigurationPropertiesComponent, autoConfigurationSingleOption, autowireWildcardProperties, configure, configurePackageScan, configureRoutes, configureRoutesLoader, configureStartupRecorder, createLifecycleStrategy, doAutoConfigurationFromProperties, doAutowireWildcardProperties, doConfigureCamelContextFromMainConfiguration, getCamelContext, getDefaultPropertyPlaceholderLocation, getInitialProperties, getOverrideProperties, getPropertyPlaceholderLocations, getRoutesCollector, loadConfigurations, loadCustomBeans, modelineRoutes, postProcessCamelContext, postProcessCamelRegistry, preProcessCamelRegistry, 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
-
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 givenname
to thebean
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 bindbean
- the object to bind
-
lookup
Using the givenname
does lookup for the bean being already bound using thebind(String, Object)
method.- See Also:
-
lookup
Using the givenname
andtype
does lookup for the bean being already bound using thebind(String, Object)
method.- See Also:
-
lookupByType
Using the giventype
does lookup for the bean being already bound using thebind(String, Object)
method.- See Also:
-
doInit
- Overrides:
doInit
in classMainSupport
- Throws:
Exception
-
doStart
- Overrides:
doStart
in classMainSupport
- Throws:
Exception
-
doStop
- Overrides:
doStop
in classMainSupport
- Throws:
Exception
-
findOrCreateCamelTemplate
protected org.apache.camel.ProducerTemplate findOrCreateCamelTemplate()- Specified by:
findOrCreateCamelTemplate
in classMainSupport
-
createCamelContext
protected org.apache.camel.CamelContext createCamelContext()- Specified by:
createCamelContext
in classMainSupport
-