public class Main extends MainSupport
MainSupport.Option, MainSupport.ParameterOption
Modifier and Type | Field and Description |
---|---|
protected static Main |
instance |
protected MainRegistry |
registry |
camelContext, camelTemplate, completed, configurationClasses, configurations, DEFAULT_EXIT_CODE, exitCode, initialProperties, latch, listeners, LOG, mainConfigurationProperties, options, overrideProperties, propertyPlaceholderLocations, routeBuilderClasses, routeBuilders, UNINITIALIZED_EXIT_CODE
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) |
addConfiguration, addConfigurationClass, addMainListener, addOption, addRouteBuilder, addRouteBuilder, afterStart, afterStop, autoConfigurationFromProperties, autoConfigurationFromRegistry, autoConfigurationMainConfiguration, autoConfigurationPropertiesComponent, beforeStart, beforeStop, completed, configure, disableHangupSupport, doConfigureCamelContextFromMainConfiguration, enableHangupSupport, enableTrace, getCamelContext, getCamelTemplate, getConfigurationClasses, getConfigurations, getDuration, getDurationHitExitCode, getDurationIdle, getDurationMaxMessages, getExitCode, getFileWatchDirectory, getInitialProperties, getOverrideProperties, getPropertyPlaceholderLocations, getReloadStrategy, getRouteBuilderClasses, getRouteBuilders, getRouteDefinitions, initCamelContext, isAutoConfigurationEnabled, isFileWatchDirectoryRecursively, isTrace, loadConfigurations, loadRouteBuilders, parseArguments, postProcessCamelContext, removeMainListener, run, run, setAutoConfigurationEnabled, setConfigurationClasses, setConfigurations, setDuration, setDurationHitExitCode, setDurationIdle, setDurationMaxMessages, setFileWatchDirectory, setFileWatchDirectoryRecursively, setInitialProperties, setOverrideProperties, setPropertyPlaceholderLocations, setReloadStrategy, setRouteBuilderClasses, setRouteBuilders, showOptions, showOptionsHeader, waitUntilCompleted
doResume, doShutdown, doSuspend, getStatus, init, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
protected final MainRegistry registry
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.ServiceSupport
Exception
protected void doStart() throws Exception
doStart
in class MainSupport
Exception
protected void doStop() throws Exception
doStop
in class MainSupport
Exception
protected org.apache.camel.ProducerTemplate findOrCreateCamelTemplate()
findOrCreateCamelTemplate
in class MainSupport
protected org.apache.camel.CamelContext createCamelContext()
createCamelContext
in class MainSupport
Apache Camel