Package org.apache.camel.spi
Interface ProcessorFactory
-
public interface ProcessorFactory
A factory to createProcessor
based on thedefinition
. This allows you to implement a custom factory in which you can control the creation of the processors. It also allows you to manipulate thedefinition
s for example to configure or change options. Its also possible to add new steps in the route by adding outputs todefinition
s. Important: By returning null from the create methods you fallback to let the default implementation in Camel create theProcessor
. You want to do this if you only want to manipulate thedefinition
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Processor
createChildProcessor(Route route, NamedNode definition, boolean mandatory)
Creates the child processor.Processor
createProcessor(CamelContext camelContext, String definitionName, Map<String,Object> args)
Creates a processor by the name of the definition.Processor
createProcessor(Route route, NamedNode definition)
Creates the processor.
-
-
-
Method Detail
-
createChildProcessor
Processor createChildProcessor(Route route, NamedNode definition, boolean mandatory) throws Exception
Creates the child processor. The child processor is an output from the given definition, for example the sub route in a splitter EIP.- Parameters:
route
- the route contextdefinition
- the definition which represents the processormandatory
- whether or not the child is mandatory- Returns:
- the created processor, or null to let the default implementation in Camel create the processor.
- Throws:
Exception
- can be thrown if error creating the processor
-
createProcessor
Processor createProcessor(Route route, NamedNode definition) throws Exception
Creates the processor.- Parameters:
route
- the route contextdefinition
- the definition which represents the processor- Returns:
- the created processor, or null to let the default implementation in Camel create the processor.
- Throws:
Exception
- can be thrown if error creating the processor
-
createProcessor
Processor createProcessor(CamelContext camelContext, String definitionName, Map<String,Object> args) throws Exception
Creates a processor by the name of the definition. This should only be used in some special situations where the processor is used internally in some features such as camel-cloud.- Parameters:
camelContext
- the camel contextdefinitionName
- the name of the definition that represents the processorargs
- arguments for creating the processor (name=vale pairs)- Returns:
- the created processor, or null if this situation is not yet implemented.
- Throws:
Exception
- can be thrown if error creating the processor
-
-