public class Main extends MainCommandLineSupport
MainCommandLineSupport.Option, MainCommandLineSupport.ParameterOption| Modifier and Type | Field and Description |
|---|---|
protected static Main |
instance |
protected MainRegistry |
registry |
optionscamelTemplate, DEFAULT_EXIT_CODE, exitCode, LOG, shutdownStrategy, UNINITIALIZED_EXIT_CODEcamelContext, DEFAULT_PROPERTY_PLACEHOLDER_LOCATION, defaultPropertyPlaceholderLocation, INITIAL_PROPERTIES_LOCATION, initialProperties, listeners, mainConfigurationProperties, OVERRIDE_PROPERTIES_LOCATION, overrideProperties, PROPERTY_PLACEHOLDER_LOCATION, propertyPlaceholderLocations, routesCollector, wildcardProperties| Constructor and Description |
|---|
Main() |
Main(Class<?>... configurationClass) |
| Modifier and Type | Method and Description |
|---|---|
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 org.apache.camel.CamelContext |
createCamelContext() |
protected void |
doInit() |
protected void |
doStart() |
protected void |
doStop() |
protected org.apache.camel.ProducerTemplate |
findOrCreateCamelTemplate() |
static Main |
getInstance()
Returns the currently executing main
|
Object |
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> |
lookupByType(Class<T> type)
Using the given
type does lookup for the bean being already bound using the
bind(String, Object) method. |
static void |
main(String... args) |
addOption, initOptions, parseArguments, run, showOptions, showOptionsHeaderafterStart, afterStop, beforeStart, beforeStop, completed, configureLifecycle, enableTrace, getCamelTemplate, getCompleteTask, getDuration, getDurationHitExitCode, getDurationIdle, getDurationMaxMessages, getExitCode, getShutdownStrategy, initCamelContext, isTrace, run, setDuration, setDurationHitExitCode, setDurationIdle, setDurationMaxMessages, setShutdownStrategy, waitUntilCompletedaddInitialProperty, addMainListener, addOverrideProperty, addProperty, autoConfigurationFailFast, autoConfigurationFromProperties, autoConfigurationMainConfiguration, autoConfigurationPropertiesComponent, autoconfigure, autowireWildcardProperties, configure, configurePropertiesService, configureRoutes, configureStartupRecorder, doAutowireWildcardProperties, doConfigureCamelContextFromMainConfiguration, getCamelContext, getDefaultPropertyPlaceholderLocation, getInitialProperties, getOverrideProperties, getPropertyPlaceholderLocations, getRoutesCollector, isAutoConfigurationEnabled, loadConfigurations, postProcessCamelContext, removeMainListener, setAutoConfigurationEnabled, setDefaultPropertyPlaceholderLocation, setInitialProperties, setInitialProperties, setOverrideProperties, setOverrideProperties, setPropertyPlaceholderLocations, setRoutesCollectorbuild, 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, suspendprotected static Main instance
protected final MainRegistry registry
public Main()
public Main(Class<?>... configurationClass)
public static Main getInstance()
public void bind(String name, Object bean)
name to the bean object, so that it can be looked up inside the
CamelContext this command line tool runs with.name - the used name through which we do bindbean - the object to bindpublic Object lookup(String name)
name does lookup for the bean being already bound using the
bind(String, Object) method.BeanRepository.lookupByName(String)public <T> T lookup(String name, Class<T> type)
name and type does lookup for the bean being already bound using the
bind(String, Object) method.BeanRepository.lookupByNameAndType(String, Class)public <T> Map<String,T> lookupByType(Class<T> type)
type does lookup for the bean being already bound using the
bind(String, Object) method.BeanRepository.findByTypeWithName(Class)protected void doInit()
throws Exception
doInit in class org.apache.camel.support.service.BaseServiceExceptionprotected void doStart()
throws Exception
doStart in class MainSupportExceptionprotected void doStop()
throws Exception
doStop in class MainSupportExceptionprotected org.apache.camel.ProducerTemplate findOrCreateCamelTemplate()
findOrCreateCamelTemplate in class MainSupportprotected org.apache.camel.CamelContext createCamelContext()
createCamelContext in class MainSupportApache Camel