public abstract class AbstractModelCamelContext extends org.apache.camel.impl.engine.AbstractCamelContext implements ModelCamelContext, org.apache.camel.CatalogCamelContext
Constructor and Description |
---|
AbstractModelCamelContext()
Creates the
ModelCamelContext using
DefaultRegistry as registry. |
AbstractModelCamelContext(boolean init) |
AbstractModelCamelContext(org.apache.camel.spi.Registry registry)
Creates the
ModelCamelContext using the given registry |
Modifier and Type | Method and Description |
---|---|
void |
addHystrixConfiguration(String id,
HystrixConfigurationDefinition configuration)
Adds the Hystrix configuration
|
void |
addRestDefinitions(Collection<RestDefinition> restDefinitions,
boolean addToRoutes)
Adds a collection of rest definitions to the context
|
void |
addRestDefinitions(InputStream is,
boolean addToRoutes)
Adds a collection of rest definitions to the context
|
void |
addRouteDefinition(RouteDefinition routeDefinition)
Add a route definition to the context
Important: Each route in the same
CamelContext must have an unique route id. |
void |
addRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
Adds a collection of route definitions to the context
Important: Each route in the same
CamelContext must have an unique route id. |
void |
addRouteDefinitions(InputStream is)
Adds a collection of route definitions to the context
Important: Each route in the same
CamelContext must have an unique route id. |
void |
addServiceCallConfiguration(String serviceName,
ServiceCallConfigurationDefinition configuration)
Adds the service call configuration
|
protected void |
bindDataFormats() |
protected abstract org.apache.camel.health.HealthCheckRegistry |
createHealthCheckRegistry() |
org.apache.camel.AsyncProcessor |
createMulticast(Collection<org.apache.camel.Processor> processors,
ExecutorService executor,
boolean shutdownExecutorService) |
protected abstract org.apache.camel.runtimecatalog.RuntimeCamelCatalog |
createRuntimeCamelCatalog() |
protected org.apache.camel.spi.TransformerRegistry<org.apache.camel.impl.transformer.TransformerKey> |
createTransformerRegistry() |
protected org.apache.camel.spi.ValidatorRegistry<org.apache.camel.impl.validator.ValidatorKey> |
createValidatorRegistry() |
protected void |
doStartEagerServices() |
protected void |
doStartStandardServices() |
Map<String,DataFormatDefinition> |
getDataFormats()
Gets the data formats that can be referenced in the routes.
|
HystrixConfigurationDefinition |
getHystrixConfiguration(String id)
Gets the Hystrix configuration by the given name.
|
ProcessorDefinition |
getProcessorDefinition(String id)
Gets the processor definition from any of the routes which with the given id
|
<T extends ProcessorDefinition> |
getProcessorDefinition(String id,
Class<T> type)
Gets the processor definition from any of the routes which with the given id
|
List<RestDefinition> |
getRestDefinitions()
Returns a list of the current REST definitions
|
RouteDefinition |
getRouteDefinition(String id)
Gets the route definition with the given id
|
List<RouteDefinition> |
getRouteDefinitions()
Returns a list of the current route definitions
|
ServiceCallConfigurationDefinition |
getServiceCallConfiguration(String serviceName)
Gets the service call configuration by the given name.
|
List<TransformerDefinition> |
getTransformers()
Gets the transformers that can be referenced in the routes.
|
List<ValidatorDefinition> |
getValidators()
Gets the validators that can be referenced in the routes.
|
protected boolean |
isStreamCachingInUse() |
void |
removeRouteDefinition(RouteDefinition routeDefinition)
Removes a route definition from the context - stopping any previously running
routes if any of them are actively running
|
void |
removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
Removes a collection of route definitions from the context - stopping any previously running
routes if any of them are actively running
|
DataFormatDefinition |
resolveDataFormatDefinition(String name)
Resolve a data format definition given its name
|
void |
setDataFormats(Map<String,DataFormatDefinition> dataFormats)
Sets the data formats that can be referenced in the routes.
|
void |
setHystrixConfiguration(HystrixConfigurationDefinition configuration)
Sets the default Hystrix configuration
|
void |
setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations)
Sets the Hystrix configurations
|
void |
setServiceCallConfiguration(ServiceCallConfigurationDefinition configuration)
Sets the default service call configuration
|
void |
setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> configurations)
Sets the service call configurations
|
void |
setTransformers(List<TransformerDefinition> transformers)
Sets the transformers that can be referenced in the routes.
|
void |
setValidators(List<ValidatorDefinition> validators)
Sets the validators that can be referenced in the routes.
|
protected void |
shutdownRouteService(org.apache.camel.impl.engine.BaseRouteService routeService) |
void |
startRouteDefinitions()
Start all routes from this model.
|
adapt, addComponent, addEndpoint, addEndpointToRegistry, addInterceptStrategy, addLifecycleStrategy, addLogListener, addRestConfiguration, addRoute, addRoutePolicyFactory, addRoutes, addService, addService, addService, addStartupListener, convertBeanToEndpoint, createAsyncProcessorAwaitManager, createBeanPostProcessor, createBeanProcessorFactory, createBeanProxyFactory, createCamelContextNameStrategy, createClassResolver, createComponentResolver, createConsumerTemplate, createConsumerTemplate, createDataFormat, createDataFormatResolver, createEndpoint, createEndpointRegistry, createErrorHandlerExecutorService, createExecutorServiceManager, createFactoryFinder, createFactoryFinderResolver, createFluentProducerTemplate, createFluentProducerTemplate, createHeadersMapFactory, createInflightRepository, createInjector, createLanguageResolver, createManagementNameStrategy, createMessageHistoryFactory, createModelJAXBContextFactory, createNodeIdFactory, createPackageScanClassResolver, createPollingConsumerServicePool, createProcessorFactory, createProducerServicePool, createProducerTemplate, createProducerTemplate, createRegistry, createRestRegistry, createRestRegistryFactory, createRouteController, createShutdownStrategy, createStreamCachingStrategy, createTypeConverter, createTypeConverterRegistry, createUnitOfWorkFactory, createUuidGenerator, deferStartService, disableJMX, doAddService, doAddService, doAddService, doInit, doResume, doShutdownRoute, doStart, doStartCamel, doStartOrResumeRoutes, doStop, doSuspend, forceLazyInitialization, forceStopLazyInitialization, getAnnotationBasedProcessorFactory, getApplicationContextClassLoader, getAsyncProcessorAwaitManager, getBeanPostProcessor, getBeanProcessorFactory, getBeanProxyFactory, getClassResolver, getComponent, getComponent, getComponent, getComponent, getComponentNames, getComponentParameterJsonSchema, getComponentResolver, getDataFormatParameterJsonSchema, getDataFormatResolver, getDebugger, getDefaultFactoryFinder, getDeferServiceFactory, getDelayer, getEipParameterJsonSchema, getEndpoint, getEndpoint, getEndpointKey, getEndpointKey, getEndpointKeyPreNormalized, getEndpointMap, getEndpointRegistry, getEndpoints, getErrorHandlerExecutorService, getErrorHandlerFactory, getExecutorServiceManager, getExtension, getFactoryFinder, getFactoryFinderResolver, getGlobalOption, getGlobalOptions, getHeadersMapFactory, getInflightRepository, getInitialization, getInjector, getInterceptStrategies, getLanguageNames, getLanguageParameterJsonSchema, getLanguageResolver, getLifecycleStrategies, getLogListeners, getManagementMBeanAssembler, getManagementName, getManagementNameStrategy, getManagementStrategy, getMessageHistoryFactory, getModelJAXBContextFactory, getName, getNameStrategy, getNodeIdFactory, getPackageScanClassResolver, getPollingConsumerServicePool, getProcessor, getProcessor, getProcessorFactory, getProducerServicePool, getPropertiesComponent, getPropertiesComponent, getPropertyPrefixToken, getPropertySuffixToken, getRegistry, getRegistry, getReloadStrategy, getRestConfiguration, getRestConfiguration, getRestConfigurations, getRestRegistry, getRestRegistryFactory, getRoute, getRouteController, getRoutePolicyFactories, getRoutes, getRouteServices, getRouteStartupOrder, getRouteStatus, getRuntimeEndpointRegistry, getShutdownRoute, getShutdownRunningTask, getShutdownStrategy, getSSLContextParameters, getStreamCachingStrategy, getTransformerRegistry, getTypeConverter, getTypeConverterRegistry, getUnitOfWorkFactory, getUptime, getUptimeMillis, getUuidGenerator, getValidatorRegistry, getVersion, hasComponent, hasEndpoint, hasService, hasService, hasServices, isAllowUseOriginalMessage, isAutoCreateComponents, isAutoStartup, isDebugging, isHandleFault, isJMXDisabled, isLoadTypeConverters, isLogExhaustedMessageBody, isLogMask, isMessageHistory, isSetupRoutes, isStartingRoutes, isStreamCaching, isTracing, isTypeConverterStatisticsEnabled, isUseBreadcrumb, isUseDataType, isUseMDCLogging, isVetoStarted, logRouteState, lookup, normalizeEndpointUri, registerEndpointCallback, removeComponent, removeEndpoint, removeEndpoints, removeRoute, removeRoute, removeService, resolveComponent, resolveDataFormat, resolveLanguage, resolvePropertyPlaceholders, resolveTransformer, resolveTransformer, resolveValidator, resume, resumeRoute, resumeRouteService, routeSupportsSuspension, safelyStartRouteServices, safelyStartRouteServices, setAllowUseOriginalMessage, setApplicationContextClassLoader, setAsyncProcessorAwaitManager, setAutoCreateComponents, setAutoStartup, setBeanPostProcessor, setClassResolver, setComponentResolver, setContextCounter, setDataFormatResolver, setDebugger, setDebugging, setDefaultExtension, setDelayer, setErrorHandlerExecutorService, setErrorHandlerFactory, setExecutorServiceManager, setExtension, setFactoryFinderResolver, setGlobalOptions, setHandleFault, setHeadersMapFactory, setInflightRepository, setInitialization, setInjector, setInterceptStrategies, setLanguageResolver, setLoadTypeConverters, setLogExhaustedMessageBody, setLogMask, setManagementMBeanAssembler, setManagementName, setManagementNameStrategy, setManagementStrategy, setMessageHistory, setMessageHistoryFactory, setModelJAXBContextFactory, setName, setNameStrategy, setNodeIdFactory, setPackageScanClassResolver, setPollingConsumerServicePool, setProcessorFactory, setProducerServicePool, setRegistry, setReloadStrategy, setRestConfiguration, setRestRegistry, setRestRegistryFactory, setRouteController, setRoutePolicyFactories, setRuntimeEndpointRegistry, setShutdownRoute, setShutdownRunningTask, setShutdownStrategy, setSSLContextParameters, setStartingRoutes, setStreamCaching, setStreamCachingStrategy, setTracing, setTypeConverter, setTypeConverterRegistry, setTypeConverterStatisticsEnabled, setUnitOfWorkFactory, setupManagement, setupRoutes, setUseBreadcrumb, setUseDataType, setUseMDCLogging, setUuidGenerator, shouldStartRoutes, shutdown, start, startAllRoutes, startRoute, startRouteService, stop, stopRoute, stopRoute, stopRoute, stopRouteService, stopRouteService, suspend, suspendRoute, suspendRoute, suspendRouteService, toString
doShutdown, getStatus, init, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentParameterJsonSchema, getDataFormatParameterJsonSchema, getEipParameterJsonSchema, getLanguageParameterJsonSchema
adapt, addComponent, addEndpoint, addLifecycleStrategy, addRestConfiguration, addRoutePolicyFactory, addRoutes, addService, addService, addService, addStartupListener, createConsumerTemplate, createConsumerTemplate, createDataFormat, createFluentProducerTemplate, createFluentProducerTemplate, createProducerTemplate, createProducerTemplate, deferStartService, disableJMX, getApplicationContextClassLoader, getClassResolver, getComponent, getComponent, getComponent, getComponent, getComponentNames, getDebugger, getEndpoint, getEndpoint, getEndpointMap, getEndpointRegistry, getEndpoints, getExecutorServiceManager, getExtension, getGlobalOption, getGlobalOptions, getHeadersMapFactory, getInflightRepository, getInjector, getLanguageNames, getLifecycleStrategies, getManagementName, getManagementNameStrategy, getManagementStrategy, getMessageHistoryFactory, getName, getNameStrategy, getProcessor, getProcessor, getPropertiesComponent, getPropertiesComponent, getPropertyPrefixToken, getPropertySuffixToken, getRegistry, getRegistry, getReloadStrategy, getRestConfiguration, getRestConfiguration, getRestConfigurations, getRestRegistry, getRoute, getRouteController, getRoutePolicyFactories, getRoutes, getRuntimeEndpointRegistry, getShutdownStrategy, getSSLContextParameters, getStatus, getStreamCachingStrategy, getTransformerRegistry, getTypeConverter, getTypeConverterRegistry, getUptime, getUptimeMillis, getUuidGenerator, getValidatorRegistry, getVersion, hasComponent, hasEndpoint, hasService, hasService, hasServices, isLoadTypeConverters, isTypeConverterStatisticsEnabled, isUseBreadcrumb, isUseDataType, isUseMDCLogging, isVetoStarted, removeComponent, removeEndpoint, removeEndpoints, removeRoute, removeService, resolveDataFormat, resolveLanguage, resolvePropertyPlaceholders, resolveTransformer, resolveTransformer, resolveValidator, setApplicationContextClassLoader, setClassResolver, setDebugger, setExecutorServiceManager, setExtension, setGlobalOptions, setHeadersMapFactory, setInflightRepository, setLoadTypeConverters, setManagementName, setManagementNameStrategy, setManagementStrategy, setMessageHistoryFactory, setNameStrategy, setReloadStrategy, setRestConfiguration, setRestRegistry, setRouteController, setRuntimeEndpointRegistry, setShutdownStrategy, setSSLContextParameters, setStreamCachingStrategy, setTypeConverterRegistry, setTypeConverterStatisticsEnabled, setUseBreadcrumb, setUseDataType, setUseMDCLogging, setUuidGenerator, start, stop
isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
getDelayer, getShutdownRoute, getShutdownRunningTask, isAllowUseOriginalMessage, isAutoStartup, isDebugging, isHandleFault, isLogExhaustedMessageBody, isLogMask, isMessageHistory, isStreamCaching, isTracing, setAllowUseOriginalMessage, setAutoStartup, setDebugging, setDelayer, setHandleFault, setLogExhaustedMessageBody, setLogMask, setMessageHistory, setShutdownRoute, setShutdownRunningTask, setStreamCaching, setTracing
public AbstractModelCamelContext()
ModelCamelContext
using
DefaultRegistry
as registry.
Use one of the other constructors to force use an explicit registry.public AbstractModelCamelContext(org.apache.camel.spi.Registry registry)
ModelCamelContext
using the given registryregistry
- the registrypublic AbstractModelCamelContext(boolean init)
public List<RouteDefinition> getRouteDefinitions()
Model
getRouteDefinitions
in interface Model
public RouteDefinition getRouteDefinition(String id)
Model
getRouteDefinition
in interface Model
id
- id of the routepublic void addRouteDefinitions(InputStream is) throws Exception
Model
CamelContext
must have an unique route id.
If you use the API from CamelContext
or Model
to add routes, then any
new routes which has a route id that matches an old route, then the old route is replaced by the new route.addRouteDefinitions
in interface Model
is
- input stream with the route(s) definition to addException
- if the route definitions could not be created for whatever reasonpublic void addRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
Model
CamelContext
must have an unique route id.
If you use the API from CamelContext
or Model
to add routes, then any
new routes which has a route id that matches an old route, then the old route is replaced by the new route.addRouteDefinitions
in interface Model
routeDefinitions
- the route(s) definition to addException
- if the route definitions could not be created for whatever reasonpublic void addRouteDefinition(RouteDefinition routeDefinition) throws Exception
Model
CamelContext
must have an unique route id.
If you use the API from CamelContext
or Model
to add routes, then any
new routes which has a route id that matches an old route, then the old route is replaced by the new route.addRouteDefinition
in interface Model
routeDefinition
- the route definition to addException
- if the route definition could not be created for whatever reasonpublic void removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
Model
removeRouteDefinitions
in interface Model
routeDefinitions
- route(s) definitions to removeException
- if the route definitions could not be removed for whatever reasonpublic void removeRouteDefinition(RouteDefinition routeDefinition) throws Exception
Model
removeRouteDefinition
in interface Model
routeDefinition
- route definition to removeException
- if the route definition could not be removed for whatever reasonpublic List<RestDefinition> getRestDefinitions()
Model
getRestDefinitions
in interface Model
public void addRestDefinitions(InputStream is, boolean addToRoutes) throws Exception
Model
addRestDefinitions
in interface Model
is
- input stream with the rest(s) definition to addaddToRoutes
- whether the rests should also automatically be added as routesException
- if the rest definitions could not be created for whatever reasonpublic void addRestDefinitions(Collection<RestDefinition> restDefinitions, boolean addToRoutes) throws Exception
Model
addRestDefinitions
in interface Model
restDefinitions
- the rest(s) definition to addaddToRoutes
- whether the rests should also automatically be added as routesException
- if the rest definitions could not be created for whatever reasonpublic void setDataFormats(Map<String,DataFormatDefinition> dataFormats)
Model
setDataFormats
in interface Model
dataFormats
- the data formatspublic Map<String,DataFormatDefinition> getDataFormats()
Model
getDataFormats
in interface Model
public DataFormatDefinition resolveDataFormatDefinition(String name)
Model
resolveDataFormatDefinition
in interface Model
name
- the data format definition name or a reference to it in the Registry
public ProcessorDefinition getProcessorDefinition(String id)
Model
getProcessorDefinition
in interface Model
id
- id of the processor definitionpublic <T extends ProcessorDefinition> T getProcessorDefinition(String id, Class<T> type)
Model
getProcessorDefinition
in interface Model
id
- id of the processor definitiontype
- the processor definition typepublic void setValidators(List<ValidatorDefinition> validators)
Model
setValidators
in interface Model
validators
- the validatorspublic HystrixConfigurationDefinition getHystrixConfiguration(String id)
Model
getHystrixConfiguration
in interface Model
id
- id of the configuration, or null to return the default configurationpublic void setHystrixConfiguration(HystrixConfigurationDefinition configuration)
Model
setHystrixConfiguration
in interface Model
configuration
- the configurationpublic void setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations)
Model
setHystrixConfigurations
in interface Model
configurations
- the configuration listpublic void addHystrixConfiguration(String id, HystrixConfigurationDefinition configuration)
Model
addHystrixConfiguration
in interface Model
id
- name of the configurationconfiguration
- the configurationpublic List<ValidatorDefinition> getValidators()
Model
getValidators
in interface Model
public void setTransformers(List<TransformerDefinition> transformers)
Model
setTransformers
in interface Model
transformers
- the transformerspublic List<TransformerDefinition> getTransformers()
Model
getTransformers
in interface Model
public ServiceCallConfigurationDefinition getServiceCallConfiguration(String serviceName)
Model
getServiceCallConfiguration
in interface Model
serviceName
- name of service, or null to return the default configurationpublic void setServiceCallConfiguration(ServiceCallConfigurationDefinition configuration)
Model
setServiceCallConfiguration
in interface Model
configuration
- the configurationpublic void setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> configurations)
Model
setServiceCallConfigurations
in interface Model
configurations
- the configuration listpublic void addServiceCallConfiguration(String serviceName, ServiceCallConfigurationDefinition configuration)
Model
addServiceCallConfiguration
in interface Model
serviceName
- name of the serviceconfiguration
- the configurationprotected org.apache.camel.spi.ValidatorRegistry<org.apache.camel.impl.validator.ValidatorKey> createValidatorRegistry() throws Exception
createValidatorRegistry
in class org.apache.camel.impl.engine.AbstractCamelContext
Exception
protected org.apache.camel.spi.TransformerRegistry<org.apache.camel.impl.transformer.TransformerKey> createTransformerRegistry() throws Exception
createTransformerRegistry
in class org.apache.camel.impl.engine.AbstractCamelContext
Exception
protected abstract org.apache.camel.health.HealthCheckRegistry createHealthCheckRegistry()
protected abstract org.apache.camel.runtimecatalog.RuntimeCamelCatalog createRuntimeCamelCatalog()
protected void doStartStandardServices()
doStartStandardServices
in class org.apache.camel.impl.engine.AbstractCamelContext
protected void doStartEagerServices()
doStartEagerServices
in class org.apache.camel.impl.engine.AbstractCamelContext
protected void bindDataFormats() throws Exception
bindDataFormats
in class org.apache.camel.impl.engine.AbstractCamelContext
Exception
protected void shutdownRouteService(org.apache.camel.impl.engine.BaseRouteService routeService) throws Exception
shutdownRouteService
in class org.apache.camel.impl.engine.AbstractCamelContext
Exception
protected boolean isStreamCachingInUse() throws Exception
isStreamCachingInUse
in class org.apache.camel.impl.engine.AbstractCamelContext
Exception
public void startRouteDefinitions() throws Exception
Model
startRouteDefinitions
in interface Model
startRouteDefinitions
in class org.apache.camel.impl.engine.AbstractCamelContext
Exception
public org.apache.camel.AsyncProcessor createMulticast(Collection<org.apache.camel.Processor> processors, ExecutorService executor, boolean shutdownExecutorService)
createMulticast
in interface org.apache.camel.ExtendedCamelContext
Apache Camel