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, toStringdoShutdown, getStatus, init, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspendedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentParameterJsonSchema, getDataFormatParameterJsonSchema, getEipParameterJsonSchema, getLanguageParameterJsonSchemaadapt, 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, stopisRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendinggetDelayer, getShutdownRoute, getShutdownRunningTask, isAllowUseOriginalMessage, isAutoStartup, isDebugging, isHandleFault, isLogExhaustedMessageBody, isLogMask, isMessageHistory, isStreamCaching, isTracing, setAllowUseOriginalMessage, setAutoStartup, setDebugging, setDelayer, setHandleFault, setLogExhaustedMessageBody, setLogMask, setMessageHistory, setShutdownRoute, setShutdownRunningTask, setStreamCaching, setTracingpublic 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()
ModelgetRouteDefinitions in interface Modelpublic RouteDefinition getRouteDefinition(String id)
ModelgetRouteDefinition in interface Modelid - id of the routepublic void addRouteDefinitions(InputStream is) throws Exception
ModelCamelContext 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 Modelis - 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
ModelCamelContext 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 ModelrouteDefinitions - the route(s) definition to addException - if the route definitions could not be created for whatever reasonpublic void addRouteDefinition(RouteDefinition routeDefinition) throws Exception
ModelCamelContext 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 ModelrouteDefinition - the route definition to addException - if the route definition could not be created for whatever reasonpublic void removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions) throws Exception
ModelremoveRouteDefinitions in interface ModelrouteDefinitions - route(s) definitions to removeException - if the route definitions could not be removed for whatever reasonpublic void removeRouteDefinition(RouteDefinition routeDefinition) throws Exception
ModelremoveRouteDefinition in interface ModelrouteDefinition - route definition to removeException - if the route definition could not be removed for whatever reasonpublic List<RestDefinition> getRestDefinitions()
ModelgetRestDefinitions in interface Modelpublic void addRestDefinitions(InputStream is, boolean addToRoutes) throws Exception
ModeladdRestDefinitions in interface Modelis - 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
ModeladdRestDefinitions in interface ModelrestDefinitions - 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)
ModelsetDataFormats in interface ModeldataFormats - the data formatspublic Map<String,DataFormatDefinition> getDataFormats()
ModelgetDataFormats in interface Modelpublic DataFormatDefinition resolveDataFormatDefinition(String name)
ModelresolveDataFormatDefinition in interface Modelname - the data format definition name or a reference to it in the Registrypublic ProcessorDefinition getProcessorDefinition(String id)
ModelgetProcessorDefinition in interface Modelid - id of the processor definitionpublic <T extends ProcessorDefinition> T getProcessorDefinition(String id, Class<T> type)
ModelgetProcessorDefinition in interface Modelid - id of the processor definitiontype - the processor definition typepublic void setValidators(List<ValidatorDefinition> validators)
ModelsetValidators in interface Modelvalidators - the validatorspublic HystrixConfigurationDefinition getHystrixConfiguration(String id)
ModelgetHystrixConfiguration in interface Modelid - id of the configuration, or null to return the default configurationpublic void setHystrixConfiguration(HystrixConfigurationDefinition configuration)
ModelsetHystrixConfiguration in interface Modelconfiguration - the configurationpublic void setHystrixConfigurations(List<HystrixConfigurationDefinition> configurations)
ModelsetHystrixConfigurations in interface Modelconfigurations - the configuration listpublic void addHystrixConfiguration(String id, HystrixConfigurationDefinition configuration)
ModeladdHystrixConfiguration in interface Modelid - name of the configurationconfiguration - the configurationpublic List<ValidatorDefinition> getValidators()
ModelgetValidators in interface Modelpublic void setTransformers(List<TransformerDefinition> transformers)
ModelsetTransformers in interface Modeltransformers - the transformerspublic List<TransformerDefinition> getTransformers()
ModelgetTransformers in interface Modelpublic ServiceCallConfigurationDefinition getServiceCallConfiguration(String serviceName)
ModelgetServiceCallConfiguration in interface ModelserviceName - name of service, or null to return the default configurationpublic void setServiceCallConfiguration(ServiceCallConfigurationDefinition configuration)
ModelsetServiceCallConfiguration in interface Modelconfiguration - the configurationpublic void setServiceCallConfigurations(List<ServiceCallConfigurationDefinition> configurations)
ModelsetServiceCallConfigurations in interface Modelconfigurations - the configuration listpublic void addServiceCallConfiguration(String serviceName, ServiceCallConfigurationDefinition configuration)
ModeladdServiceCallConfiguration in interface ModelserviceName - 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.AbstractCamelContextExceptionprotected org.apache.camel.spi.TransformerRegistry<org.apache.camel.impl.transformer.TransformerKey> createTransformerRegistry() throws Exception
createTransformerRegistry in class org.apache.camel.impl.engine.AbstractCamelContextExceptionprotected 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.AbstractCamelContextprotected void doStartEagerServices()
doStartEagerServices in class org.apache.camel.impl.engine.AbstractCamelContextprotected void bindDataFormats() throws Exception
bindDataFormats in class org.apache.camel.impl.engine.AbstractCamelContextExceptionprotected void shutdownRouteService(org.apache.camel.impl.engine.BaseRouteService routeService) throws Exception
shutdownRouteService in class org.apache.camel.impl.engine.AbstractCamelContextExceptionprotected boolean isStreamCachingInUse() throws Exception
isStreamCachingInUse in class org.apache.camel.impl.engine.AbstractCamelContextExceptionpublic void startRouteDefinitions() throws Exception
ModelstartRouteDefinitions in interface ModelstartRouteDefinitions in class org.apache.camel.impl.engine.AbstractCamelContextExceptionpublic org.apache.camel.AsyncProcessor createMulticast(Collection<org.apache.camel.Processor> processors, ExecutorService executor, boolean shutdownExecutorService)
createMulticast in interface org.apache.camel.ExtendedCamelContextApache Camel