org.apache.camel.model
Interface ModelCamelContext

All Superinterfaces:
CamelContext, RuntimeConfiguration, Service, SuspendableService
All Known Implementing Classes:
DefaultCamelContext

public interface ModelCamelContext
extends CamelContext

Model level interface for the CamelContext


Method Summary
 void addRouteDefinition(RouteDefinition routeDefinition)
          Add a route definition to the context
 void addRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
          Adds a collection of route definitions to the context
 Map<String,DataFormatDefinition> getDataFormats()
          Gets the data formats that can be referenced in the routes.
 RouteDefinition getRouteDefinition(String id)
          Gets the route definition with the given id
 List<RouteDefinition> getRouteDefinitions()
          Returns a list of the current route definitions
 RoutesDefinition loadRoutesDefinition(InputStream is)
          Loads a collection of route definitions from the given InputStream.
 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 startRoute(RouteDefinition route)
          Deprecated. favor using CamelContext.startRoute(String)
 void stopRoute(RouteDefinition route)
          Deprecated. favor using CamelContext.stopRoute(String)
 
Methods inherited from interface org.apache.camel.CamelContext
addComponent, addEndpoint, addInterceptStrategy, addLifecycleStrategy, addRegisterEndpointCallback, addRoutes, addService, addStartupListener, createConsumerTemplate, createConsumerTemplate, createProducerTemplate, createProducerTemplate, disableJMX, getApplicationContextClassLoader, getClassResolver, getComponent, getComponent, getComponentNames, getDataFormatResolver, getDebugger, getDefaultFactoryFinder, getDefaultTracer, getEndpoint, getEndpoint, getEndpointMap, getEndpoints, getErrorHandlerBuilder, getErrorHandlerExecutorService, getExecutorServiceManager, getExecutorServiceStrategy, getFactoryFinder, getInflightRepository, getInjector, getInterceptStrategies, getLanguageNames, getLifecycleStrategies, getManagementMBeanAssembler, getManagementName, getManagementStrategy, getName, getNameStrategy, getNodeIdFactory, getPackageScanClassResolver, getProcessorFactory, getProducerServicePool, getProperties, getPropertyPrefixToken, getPropertySuffixToken, getRegistry, getRoute, getRoutes, getRouteStatus, getShutdownStrategy, getStatus, getTypeConverter, getTypeConverterRegistry, getUptime, getUuidGenerator, getVersion, hasComponent, hasEndpoint, hasService, isLazyLoadTypeConverters, isStartingRoutes, isUseBreadcrumb, isUseMDCLogging, removeComponent, removeEndpoints, removeRoute, removeService, resolveDataFormat, resolveLanguage, resolvePropertyPlaceholders, resumeRoute, setApplicationContextClassLoader, setClassResolver, setDataFormatResolver, setDebugger, setDefaultTracer, setErrorHandlerBuilder, setExecutorServiceManager, setFactoryFinderResolver, setInflightRepository, setLazyLoadTypeConverters, setManagementName, setManagementStrategy, setNameStrategy, setNodeIdFactory, setPackageScanClassResolver, setProcessorFactory, setProducerServicePool, setProperties, setShutdownStrategy, setUseBreadcrumb, setUseMDCLogging, setUuidGenerator, shutdownRoute, shutdownRoute, startRoute, stopRoute, stopRoute, stopRoute, suspendRoute, suspendRoute
 
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
 
Methods inherited from interface org.apache.camel.Service
start, stop
 
Methods inherited from interface org.apache.camel.RuntimeConfiguration
getDelayer, getShutdownRoute, getShutdownRunningTask, isAutoStartup, isHandleFault, isStreamCaching, isTracing, setAutoStartup, setDelayer, setHandleFault, setShutdownRoute, setShutdownRunningTask, setStreamCaching, setTracing
 

Method Detail

getRouteDefinitions

List<RouteDefinition> getRouteDefinitions()
Returns a list of the current route definitions

Specified by:
getRouteDefinitions in interface CamelContext
Returns:
list of the current route definitions

getRouteDefinition

RouteDefinition getRouteDefinition(String id)
Gets the route definition with the given id

Specified by:
getRouteDefinition in interface CamelContext
Parameters:
id - id of the route
Returns:
the route definition or null if not found

loadRoutesDefinition

RoutesDefinition loadRoutesDefinition(InputStream is)
                                      throws Exception
Loads a collection of route definitions from the given InputStream.

Specified by:
loadRoutesDefinition in interface CamelContext
Parameters:
is - input stream with the route(s) definition to add
Returns:
the route definitions
Throws:
Exception - if the route definitions could not be loaded for whatever reason

addRouteDefinitions

void addRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
                         throws Exception
Adds a collection of route definitions to the context

Specified by:
addRouteDefinitions in interface CamelContext
Parameters:
routeDefinitions - the route(s) definition to add
Throws:
Exception - if the route definitions could not be created for whatever reason

addRouteDefinition

void addRouteDefinition(RouteDefinition routeDefinition)
                        throws Exception
Add a route definition to the context

Specified by:
addRouteDefinition in interface CamelContext
Parameters:
routeDefinition - the route definition to add
Throws:
Exception - if the route definition could not be created for whatever reason

removeRouteDefinitions

void removeRouteDefinitions(Collection<RouteDefinition> routeDefinitions)
                            throws Exception
Removes a collection of route definitions from the context - stopping any previously running routes if any of them are actively running

Specified by:
removeRouteDefinitions in interface CamelContext
Parameters:
routeDefinitions - route(s) definitions to remove
Throws:
Exception - if the route definitions could not be removed for whatever reason

removeRouteDefinition

void removeRouteDefinition(RouteDefinition routeDefinition)
                           throws Exception
Removes a route definition from the context - stopping any previously running routes if any of them are actively running

Specified by:
removeRouteDefinition in interface CamelContext
Parameters:
routeDefinition - route definition to remove
Throws:
Exception - if the route definition could not be removed for whatever reason

startRoute

@Deprecated
void startRoute(RouteDefinition route)
                throws Exception
Deprecated. favor using CamelContext.startRoute(String)

Starts the given route if it has been previously stopped

Specified by:
startRoute in interface CamelContext
Parameters:
route - the route to start
Throws:
Exception - is thrown if the route could not be started for whatever reason

stopRoute

@Deprecated
void stopRoute(RouteDefinition route)
               throws Exception
Deprecated. favor using CamelContext.stopRoute(String)

Stops the given route.

Specified by:
stopRoute in interface CamelContext
Parameters:
route - the route to stop
Throws:
Exception - is thrown if the route could not be stopped for whatever reason

setDataFormats

void setDataFormats(Map<String,DataFormatDefinition> dataFormats)
Sets the data formats that can be referenced in the routes.

Specified by:
setDataFormats in interface CamelContext
Parameters:
dataFormats - the data formats

getDataFormats

Map<String,DataFormatDefinition> getDataFormats()
Gets the data formats that can be referenced in the routes.

Specified by:
getDataFormats in interface CamelContext
Returns:
the data formats available

resolveDataFormatDefinition

DataFormatDefinition resolveDataFormatDefinition(String name)
Resolve a data format definition given its name

Specified by:
resolveDataFormatDefinition in interface CamelContext
Parameters:
name - the data format definition name or a reference to it in the Registry
Returns:
the resolved data format definition, or null if not found


Apache CAMEL