public class Main extends org.apache.camel.main.MainCommandLineSupport
ApplicationContext.
By placing a file in the LOCATION_PROPERTIES directory of any JARs on the classpath,
allows this Main class to load those additional Spring XML files as Spring
ApplicationContext to be included.
Each line in the LOCATION_PROPERTIES is a reference to a Spring XML file to include,
which by default gets loaded from classpath.| Modifier and Type | Field and Description |
|---|---|
protected static Main |
instance |
static String |
LOCATION_PROPERTIES |
DEFAULT_EXIT_CODE, exitCode, LOG, UNINITIALIZED_EXIT_CODEcamelContext, camelTemplate, completed, configurationClasses, configurations, defaultPropertyPlaceholderLocation, initialProperties, latch, listeners, mainConfigurationProperties, overrideProperties, propertyPlaceholderLocations, routeBuilderClasses, routeBuilders, routesCollector| Constructor and Description |
|---|
Main() |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.context.support.AbstractApplicationContext |
createAdditionalLocationsFromClasspath() |
protected org.apache.camel.CamelContext |
createCamelContext() |
protected org.springframework.context.support.AbstractApplicationContext |
createDefaultApplicationContext() |
protected void |
doStart() |
protected void |
doStop() |
protected void |
findLocations(Set<String> locations,
ClassLoader classLoader) |
protected org.apache.camel.ProducerTemplate |
findOrCreateCamelTemplate() |
org.springframework.context.support.AbstractApplicationContext |
getApplicationContext() |
String |
getApplicationContextUri() |
String |
getFileApplicationContextUri() |
static Main |
getInstance()
Returns the currently executing main
|
org.springframework.context.support.AbstractApplicationContext |
getParentApplicationContext() |
String |
getParentApplicationContextUri() |
static void |
main(String... args) |
void |
setApplicationContext(org.springframework.context.support.AbstractApplicationContext applicationContext) |
void |
setApplicationContextUri(String applicationContextUri) |
void |
setFileApplicationContextUri(String fileApplicationContextUri) |
void |
setParentApplicationContext(org.springframework.context.support.AbstractApplicationContext parentApplicationContext) |
void |
setParentApplicationContextUri(String parentApplicationContextUri) |
addOption, parseArguments, run, showOptions, showOptionsHeaderafterStart, afterStop, beforeStart, beforeStop, completed, disableHangupSupport, enableHangupSupport, enableTrace, getDuration, getDurationHitExitCode, getDurationIdle, getDurationMaxMessages, getExitCode, isTrace, run, setDuration, setDurationHitExitCode, setDurationIdle, setDurationMaxMessages, waitUntilCompletedaddConfiguration, addConfigurationClass, addInitialProperty, addMainListener, addOverrideProperty, addProperty, addRouteBuilder, addRouteBuilder, addRoutesBuilder, autoConfigurationFailFast, autoConfigurationFromProperties, autoConfigurationMainConfiguration, autoConfigurationPropertiesComponent, autowireConfigurationFromRegistry, computeProperties, configure, doConfigureCamelContextFromMainConfiguration, getCamelContext, getCamelTemplate, getConfigurationClasses, getConfigurations, getDefaultPropertyPlaceholderLocation, getInitialProperties, getOverrideProperties, getPropertyPlaceholderLocations, getRouteBuilderClasses, getRouteBuilders, getRouteDefinitions, getRoutesBuilders, getRoutesCollector, initCamelContext, isAutoConfigurationEnabled, isServiceEnabled, loadConfigurations, loadEnvironmentVariablesAsProperties, loadRouteBuilders, optionKey, postProcessCamelContext, removeMainListener, setAutoConfigurationEnabled, setConfigurationClasses, setConfigurations, setDefaultPropertyPlaceholderLocation, setInitialProperties, setOverrideProperties, setPropertiesOnTarget, setPropertyPlaceholderLocations, setRouteBuilderClasses, setRouteBuilders, setRoutesBuilders, setRoutesCollector, validateOptionAndValuebuild, doBuild, doInit, doResume, doShutdown, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic static final String LOCATION_PROPERTIES
public Main()
public static Main getInstance()
public org.springframework.context.support.AbstractApplicationContext getApplicationContext()
public void setApplicationContext(org.springframework.context.support.AbstractApplicationContext applicationContext)
public String getApplicationContextUri()
public void setApplicationContextUri(String applicationContextUri)
public String getFileApplicationContextUri()
public void setFileApplicationContextUri(String fileApplicationContextUri)
public org.springframework.context.support.AbstractApplicationContext getParentApplicationContext()
public void setParentApplicationContext(org.springframework.context.support.AbstractApplicationContext parentApplicationContext)
public String getParentApplicationContextUri()
public void setParentApplicationContextUri(String parentApplicationContextUri)
protected org.apache.camel.CamelContext createCamelContext()
createCamelContext in class org.apache.camel.main.BaseMainSupportprotected void doStart() throws Exception
doStart in class org.apache.camel.main.MainSupportExceptionprotected void doStop() throws Exception
doStop in class org.apache.camel.main.MainSupportExceptionprotected org.apache.camel.ProducerTemplate findOrCreateCamelTemplate()
findOrCreateCamelTemplate in class org.apache.camel.main.BaseMainSupportprotected org.springframework.context.support.AbstractApplicationContext createDefaultApplicationContext() throws IOException
IOExceptionprotected org.springframework.context.support.AbstractApplicationContext createAdditionalLocationsFromClasspath() throws IOException
IOExceptionprotected void findLocations(Set<String> locations, ClassLoader classLoader) throws IOException
IOExceptionApache Camel