public abstract class ProcessorReifier<T extends ProcessorDefinition<?>> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected T |
definition |
protected org.slf4j.Logger |
log |
| Constructor and Description |
|---|
ProcessorReifier(T definition) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addInterceptStrategies(org.apache.camel.spi.RouteContext routeContext,
List<org.apache.camel.spi.InterceptStrategy> interceptors,
List<org.apache.camel.spi.InterceptStrategy> strategies)
Adds the given list of interceptors to the channel.
|
void |
addRoutes(org.apache.camel.spi.RouteContext routeContext) |
void |
configureChild(ProcessorDefinition<?> output)
Strategy for children to do any custom configuration
|
protected org.apache.camel.Processor |
createChildProcessor(org.apache.camel.spi.RouteContext routeContext,
boolean mandatory)
Creates the child processor (outputs) from the current definition
|
protected org.apache.camel.Processor |
createCompositeProcessor(org.apache.camel.spi.RouteContext routeContext,
List<org.apache.camel.Processor> list)
Creates a new instance of some kind of composite processor which defaults
to using a
Pipeline but derived classes could change the
behaviour |
protected org.apache.camel.Processor |
createOutputsProcessor(org.apache.camel.spi.RouteContext routeContext)
Prefer to use {#link #createChildProcessor}.
|
protected org.apache.camel.Processor |
createOutputsProcessor(org.apache.camel.spi.RouteContext routeContext,
Collection<ProcessorDefinition<?>> outputs) |
protected org.apache.camel.Processor |
createOutputsProcessorImpl(org.apache.camel.spi.RouteContext routeContext,
Collection<ProcessorDefinition<?>> outputs) |
abstract org.apache.camel.Processor |
createProcessor(org.apache.camel.spi.RouteContext routeContext)
Override this in definition class and implement logic to create the
processor based on the definition model.
|
protected org.apache.camel.Processor |
createProcessor(org.apache.camel.spi.RouteContext routeContext,
ProcessorDefinition<?> output) |
protected String |
getId(OptionalIdentifiedDefinition<?> def,
org.apache.camel.spi.RouteContext routeContext) |
protected org.apache.camel.Channel |
makeProcessor(org.apache.camel.spi.RouteContext routeContext)
Creates the processor and wraps it in any necessary interceptors and
error handlers
|
protected void |
preCreateProcessor()
Strategy to execute any custom logic before the
Processor is
created. |
static void |
registerReifier(Class<?> processorClass,
Function<ProcessorDefinition<?>,ProcessorReifier<? extends ProcessorDefinition<?>>> creator) |
static ProcessorReifier<? extends ProcessorDefinition<?>> |
reifier(ProcessorDefinition<?> definition) |
protected org.apache.camel.Channel |
wrapChannel(org.apache.camel.spi.RouteContext routeContext,
org.apache.camel.Processor processor,
ProcessorDefinition<?> child) |
protected org.apache.camel.Channel |
wrapChannel(org.apache.camel.spi.RouteContext routeContext,
org.apache.camel.Processor processor,
ProcessorDefinition<?> child,
Boolean inheritErrorHandler) |
protected org.apache.camel.Processor |
wrapInErrorHandler(org.apache.camel.spi.RouteContext routeContext,
org.apache.camel.Processor output)
Wraps the given output in an error handler
|
org.apache.camel.Channel |
wrapProcessor(org.apache.camel.spi.RouteContext routeContext,
org.apache.camel.Processor processor)
Wraps the child processor in whatever necessary interceptors and error
handlers
|
protected final org.slf4j.Logger log
protected final T extends ProcessorDefinition<?> definition
public ProcessorReifier(T definition)
public static void registerReifier(Class<?> processorClass, Function<ProcessorDefinition<?>,ProcessorReifier<? extends ProcessorDefinition<?>>> creator)
public static ProcessorReifier<? extends ProcessorDefinition<?>> reifier(ProcessorDefinition<?> definition)
public abstract org.apache.camel.Processor createProcessor(org.apache.camel.spi.RouteContext routeContext) throws Exception
Exceptionprotected org.apache.camel.Processor createOutputsProcessor(org.apache.camel.spi.RouteContext routeContext) throws Exception
Exceptionprotected org.apache.camel.Processor createChildProcessor(org.apache.camel.spi.RouteContext routeContext, boolean mandatory) throws Exception
routeContext - the route contextmandatory - whether or not children is mandatory (ie the definition
should have outputs)Exception - is thrown if error creating the child or if it was
mandatory and there was no output defined on definitionpublic void addRoutes(org.apache.camel.spi.RouteContext routeContext) throws Exception
Exceptionpublic org.apache.camel.Channel wrapProcessor(org.apache.camel.spi.RouteContext routeContext, org.apache.camel.Processor processor) throws Exception
Exceptionprotected org.apache.camel.Channel wrapChannel(org.apache.camel.spi.RouteContext routeContext, org.apache.camel.Processor processor, ProcessorDefinition<?> child) throws Exception
Exceptionprotected org.apache.camel.Channel wrapChannel(org.apache.camel.spi.RouteContext routeContext, org.apache.camel.Processor processor, ProcessorDefinition<?> child, Boolean inheritErrorHandler) throws Exception
Exceptionprotected org.apache.camel.Processor wrapInErrorHandler(org.apache.camel.spi.RouteContext routeContext, org.apache.camel.Processor output) throws Exception
routeContext - the route contextoutput - the outputException - can be thrown if failed to create error handler builderprotected void addInterceptStrategies(org.apache.camel.spi.RouteContext routeContext, List<org.apache.camel.spi.InterceptStrategy> interceptors, List<org.apache.camel.spi.InterceptStrategy> strategies)
routeContext - the route contextinterceptors - the list to add strategiesstrategies - list of strategies to add.protected org.apache.camel.Processor createCompositeProcessor(org.apache.camel.spi.RouteContext routeContext, List<org.apache.camel.Processor> list) throws Exception
Pipeline but derived classes could change the
behaviourExceptionprotected org.apache.camel.Processor createOutputsProcessor(org.apache.camel.spi.RouteContext routeContext, Collection<ProcessorDefinition<?>> outputs) throws Exception
Exceptionprotected org.apache.camel.Processor createOutputsProcessorImpl(org.apache.camel.spi.RouteContext routeContext, Collection<ProcessorDefinition<?>> outputs) throws Exception
Exceptionprotected org.apache.camel.Processor createProcessor(org.apache.camel.spi.RouteContext routeContext, ProcessorDefinition<?> output) throws Exception
Exceptionprotected org.apache.camel.Channel makeProcessor(org.apache.camel.spi.RouteContext routeContext) throws Exception
Exceptionprotected void preCreateProcessor()
Processor is
created.public void configureChild(ProcessorDefinition<?> output)
output - the child to be added as output to thisprotected String getId(OptionalIdentifiedDefinition<?> def, org.apache.camel.spi.RouteContext routeContext)
Apache Camel