public abstract class BaseMainSupport
extends org.apache.camel.support.service.BaseService
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.camel.CamelContext |
camelContext |
protected org.apache.camel.ProducerTemplate |
camelTemplate |
protected AtomicBoolean |
completed |
protected String |
configurationClasses |
protected List<Object> |
configurations |
protected String |
defaultPropertyPlaceholderLocation |
protected Properties |
initialProperties |
protected List<MainListener> |
listeners |
protected MainConfigurationProperties |
mainConfigurationProperties |
protected Properties |
overrideProperties |
protected String |
propertyPlaceholderLocations |
protected String |
routeBuilderClasses |
protected List<org.apache.camel.RoutesBuilder> |
routeBuilders |
protected RoutesCollector |
routesCollector |
protected Properties |
wildcardProperties |
| Constructor and Description |
|---|
BaseMainSupport() |
| Modifier and Type | Method and Description |
|---|---|
void |
addConfiguration(Object configuration) |
void |
addConfigurationClass(Class... configuration) |
void |
addInitialProperty(String key,
String value)
Adds a initial property for the properties component,
which will be used before any locations are resolved.
|
void |
addMainListener(MainListener listener)
Adds a
MainListener to receive callbacks when the main is started or stopping |
void |
addOverrideProperty(String key,
String value)
Adds an override property that take precedence
and will use first, if a property exist.
|
void |
addProperty(String key,
String value)
Adds a property (initial) for the properties component,
which will be used before any locations are resolved.
|
void |
addRouteBuilder(Class... routeBuilder) |
void |
addRouteBuilder(org.apache.camel.RoutesBuilder routeBuilder)
Deprecated.
|
void |
addRoutesBuilder(org.apache.camel.RoutesBuilder routeBuilder) |
protected void |
autoConfigurationFailFast(org.apache.camel.CamelContext camelContext,
Map<String,String> autoConfiguredProperties) |
protected void |
autoConfigurationFromProperties(org.apache.camel.CamelContext camelContext,
Map<String,String> autoConfiguredProperties) |
protected void |
autoConfigurationMainConfiguration(org.apache.camel.CamelContext camelContext,
MainConfigurationProperties config,
Map<String,String> autoConfiguredProperties) |
protected void |
autoConfigurationPropertiesComponent(org.apache.camel.CamelContext camelContext,
Map<String,String> autoConfiguredProperties) |
protected void |
autoconfigure(org.apache.camel.CamelContext camelContext) |
protected void |
autowireConfigurationFromRegistry(org.apache.camel.CamelContext camelContext,
boolean bindNullOnly,
boolean deepNesting) |
protected void |
autowireWildcardProperties(org.apache.camel.CamelContext camelContext) |
protected static void |
computeProperties(String keyPrefix,
String key,
Properties prop,
Map<org.apache.camel.main.BaseMainSupport.PropertyOptionKey,Map<String,Object>> properties,
Function<String,Iterable<Object>> supplier) |
MainConfigurationProperties |
configure()
To configure options on Camel Main.
|
protected void |
configureLifecycle(org.apache.camel.CamelContext camelContext) |
protected void |
configurePropertiesService(org.apache.camel.CamelContext camelContext) |
protected void |
configureRoutes(org.apache.camel.CamelContext camelContext) |
protected abstract org.apache.camel.CamelContext |
createCamelContext() |
protected void |
doAutowireWildcardProperties(String name,
org.apache.camel.Component component) |
protected void |
doConfigureCamelContextFromMainConfiguration(org.apache.camel.CamelContext camelContext,
MainConfigurationProperties config,
Map<String,String> autoConfiguredProperties)
Configures CamelContext from the
MainConfigurationProperties properties. |
protected abstract org.apache.camel.ProducerTemplate |
findOrCreateCamelTemplate() |
org.apache.camel.CamelContext |
getCamelContext() |
org.apache.camel.ProducerTemplate |
getCamelTemplate() |
String |
getConfigurationClasses() |
List<Object> |
getConfigurations() |
String |
getDefaultPropertyPlaceholderLocation() |
Properties |
getInitialProperties() |
Properties |
getOverrideProperties() |
String |
getPropertyPlaceholderLocations() |
String |
getRouteBuilderClasses() |
List<org.apache.camel.RoutesBuilder> |
getRouteBuilders()
Deprecated.
|
List<org.apache.camel.model.RouteDefinition> |
getRouteDefinitions() |
List<org.apache.camel.RoutesBuilder> |
getRoutesBuilders() |
RoutesCollector |
getRoutesCollector() |
protected void |
initCamelContext() |
boolean |
isAutoConfigurationEnabled()
Deprecated.
|
protected static boolean |
isServiceEnabled(String prefix,
String name,
Properties properties) |
protected void |
loadConfigurations(org.apache.camel.CamelContext camelContext) |
protected static Properties |
loadEnvironmentVariablesAsProperties(String[] prefixes) |
protected void |
loadRouteBuilders(org.apache.camel.CamelContext camelContext) |
protected static String |
optionKey(String key) |
protected void |
postProcessCamelContext(org.apache.camel.CamelContext camelContext) |
void |
removeMainListener(MainListener listener)
Removes the
MainListener |
void |
setAutoConfigurationEnabled(boolean autoConfigurationEnabled)
Deprecated.
use
configure() |
void |
setConfigurationClasses(String configurations) |
void |
setConfigurations(List<Object> configurations) |
void |
setDefaultPropertyPlaceholderLocation(String defaultPropertyPlaceholderLocation)
Set the default location for application properties if no locations have been set.
|
void |
setInitialProperties(Properties initialProperties)
Sets initial properties for the properties component,
which will be used before any locations are resolved.
|
void |
setOverrideProperties(Properties overrideProperties)
Sets a special list of override properties that take precedence
and will use first, if a property exist.
|
protected static boolean |
setPropertiesOnTarget(org.apache.camel.CamelContext context,
Object target,
Map<String,Object> properties,
String optionPrefix,
boolean failIfNotSet,
boolean ignoreCase,
Map<String,String> autoConfiguredProperties) |
void |
setPropertyPlaceholderLocations(String location)
A list of locations to add for loading properties.
|
void |
setRouteBuilderClasses(String builders) |
void |
setRouteBuilders(List<org.apache.camel.RoutesBuilder> routeBuilders)
Deprecated.
use
setRoutesBuilders(List) ()} |
void |
setRoutesBuilders(List<org.apache.camel.RoutesBuilder> routesBuilders) |
void |
setRoutesCollector(RoutesCollector routesCollector)
To use a custom
RoutesCollector. |
protected static void |
validateOptionAndValue(String key,
String option,
String value) |
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendprotected final AtomicBoolean completed
protected volatile org.apache.camel.CamelContext camelContext
protected volatile org.apache.camel.ProducerTemplate camelTemplate
protected final List<MainListener> listeners
protected final MainConfigurationProperties mainConfigurationProperties
protected final Properties wildcardProperties
protected RoutesCollector routesCollector
protected List<org.apache.camel.RoutesBuilder> routeBuilders
protected String routeBuilderClasses
protected String configurationClasses
protected String propertyPlaceholderLocations
protected String defaultPropertyPlaceholderLocation
protected Properties initialProperties
protected Properties overrideProperties
protected static Properties loadEnvironmentVariablesAsProperties(String[] prefixes)
protected static boolean setPropertiesOnTarget(org.apache.camel.CamelContext context,
Object target,
Map<String,Object> properties,
String optionPrefix,
boolean failIfNotSet,
boolean ignoreCase,
Map<String,String> autoConfiguredProperties)
throws Exception
Exceptionpublic MainConfigurationProperties configure()
public String getConfigurationClasses()
public void setConfigurationClasses(String configurations)
public void addConfigurationClass(Class... configuration)
public void addConfiguration(Object configuration)
public RoutesCollector getRoutesCollector()
public void setRoutesCollector(RoutesCollector routesCollector)
RoutesCollector.public String getRouteBuilderClasses()
public void setRouteBuilderClasses(String builders)
public String getPropertyPlaceholderLocations()
public void setPropertyPlaceholderLocations(String location)
public String getDefaultPropertyPlaceholderLocation()
public void setDefaultPropertyPlaceholderLocation(String defaultPropertyPlaceholderLocation)
@Deprecated public boolean isAutoConfigurationEnabled()
@Deprecated public void setAutoConfigurationEnabled(boolean autoConfigurationEnabled)
configure()Registry.bind(String, Object) method
or by using the BindToRegistry annotation style.
This option is default enabled.public Properties getInitialProperties()
public void setInitialProperties(Properties initialProperties)
public void addProperty(String key, String value)
key - the property keyvalue - the property valueaddInitialProperty(String, String),
addOverrideProperty(String, String)public void addInitialProperty(String key, String value)
key - the property keyvalue - the property valuepublic Properties getOverrideProperties()
public void setOverrideProperties(Properties overrideProperties)
public void addOverrideProperty(String key, String value)
key - the property keyvalue - the property valuepublic org.apache.camel.CamelContext getCamelContext()
@Deprecated public List<org.apache.camel.RoutesBuilder> getRouteBuilders()
getRoutesBuilders()@Deprecated public void setRouteBuilders(List<org.apache.camel.RoutesBuilder> routeBuilders)
setRoutesBuilders(List) ()}public List<org.apache.camel.RoutesBuilder> getRoutesBuilders()
public void setRoutesBuilders(List<org.apache.camel.RoutesBuilder> routesBuilders)
public List<org.apache.camel.model.RouteDefinition> getRouteDefinitions()
public org.apache.camel.ProducerTemplate getCamelTemplate()
throws Exception
Exceptionprotected abstract org.apache.camel.ProducerTemplate findOrCreateCamelTemplate()
protected abstract org.apache.camel.CamelContext createCamelContext()
protected void loadRouteBuilders(org.apache.camel.CamelContext camelContext)
throws Exception
Exceptionprotected void loadConfigurations(org.apache.camel.CamelContext camelContext)
throws Exception
Exceptionprotected void configurePropertiesService(org.apache.camel.CamelContext camelContext)
throws Exception
Exceptionprotected void configureLifecycle(org.apache.camel.CamelContext camelContext)
throws Exception
Exceptionprotected void autoconfigure(org.apache.camel.CamelContext camelContext)
throws Exception
Exceptionprotected void configureRoutes(org.apache.camel.CamelContext camelContext)
throws Exception
Exceptionprotected void postProcessCamelContext(org.apache.camel.CamelContext camelContext)
throws Exception
Exceptionprotected void autoConfigurationFailFast(org.apache.camel.CamelContext camelContext,
Map<String,String> autoConfiguredProperties)
throws Exception
Exceptionprotected void doConfigureCamelContextFromMainConfiguration(org.apache.camel.CamelContext camelContext,
MainConfigurationProperties config,
Map<String,String> autoConfiguredProperties)
throws Exception
MainConfigurationProperties properties.Exceptionprotected void autoConfigurationPropertiesComponent(org.apache.camel.CamelContext camelContext,
Map<String,String> autoConfiguredProperties)
throws Exception
Exceptionprotected void autoConfigurationMainConfiguration(org.apache.camel.CamelContext camelContext,
MainConfigurationProperties config,
Map<String,String> autoConfiguredProperties)
throws Exception
Exceptionprotected void autoConfigurationFromProperties(org.apache.camel.CamelContext camelContext,
Map<String,String> autoConfiguredProperties)
throws Exception
Exceptionprotected void autowireConfigurationFromRegistry(org.apache.camel.CamelContext camelContext,
boolean bindNullOnly,
boolean deepNesting)
throws Exception
Exceptionprotected void autowireWildcardProperties(org.apache.camel.CamelContext camelContext)
protected void doAutowireWildcardProperties(String name, org.apache.camel.Component component)
protected static void validateOptionAndValue(String key, String option, String value)
@Deprecated public void addRouteBuilder(org.apache.camel.RoutesBuilder routeBuilder)
addRoutesBuilder(RoutesBuilder)public void addRoutesBuilder(org.apache.camel.RoutesBuilder routeBuilder)
public void addRouteBuilder(Class... routeBuilder)
public void addMainListener(MainListener listener)
MainListener to receive callbacks when the main is started or stoppinglistener - the listenerpublic void removeMainListener(MainListener listener)
MainListenerlistener - the listenerprotected static void computeProperties(String keyPrefix, String key, Properties prop, Map<org.apache.camel.main.BaseMainSupport.PropertyOptionKey,Map<String,Object>> properties, Function<String,Iterable<Object>> supplier)
protected static boolean isServiceEnabled(String prefix, String name, Properties properties)
Apache Camel