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: A custom ProcessorFactory should extend the default implementation org.apache.camel.processor.DefaultProcessorFactory and in the overridden methods, super should be called to let the default implementation create the processor when custom processors is not created.
-
-
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, Object[] args)
Creates a processor by the name of the definition.Processor
createProcessor(Route route, NamedNode definition)
Creates the processor.
-
-
-
Field Detail
-
FACTORY
static final String FACTORY
Service factory key.- See Also:
- Constant Field Values
-
-
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, 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 by Camel itself and some component such as camel-cloud, camel-seda.- Parameters:
camelContext
- the camel contextdefinitionName
- the name of the definition that represents the processorargs
- arguments for creating the processor (optimized to use fixed order of parameters)- Returns:
- the created processor, or null if this situation is not yet implemented.
- Throws:
Exception
- can be thrown if error creating the processor
-
-