|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.processor.Enricher
public class Enricher
A content enricher that enriches input data by first obtaining additional
data from a resource represented by an endpoint producer
and second by aggregating input data and additional data. Aggregation of
input data and additional data is delegated to an AggregationStrategy
object.
| Constructor Summary | |
|---|---|
Enricher(AggregationStrategy aggregationStrategy,
Producer producer)
Creates a new Enricher. |
|
Enricher(Producer producer)
Creates a new Enricher. |
|
| Method Summary | |
|---|---|
protected Exchange |
createResourceExchange(Exchange source,
ExchangePattern pattern)
Creates a new DefaultExchange instance from the given
exchange. |
protected void |
doStart()
|
protected void |
doStop()
|
void |
process(Exchange exchange)
Enriches the input data ( exchange) by first obtaining
additional data from an endpoint represented by an endpoint
producer and second by aggregating input data and additional
data. |
void |
setAggregationStrategy(AggregationStrategy aggregationStrategy)
Sets the aggregation strategy for this enricher. |
void |
setDefaultAggregationStrategy()
Sets the default aggregation strategy for this enricher. |
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
|---|
addChildService, getStatus, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, notStarting, removeChildService, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Enricher(Producer producer)
Enricher. The default aggregation strategy is to
copy the additional data obtained from the enricher's resource over the
input data. When using the copy aggregation strategy the enricher
degenerates to a normal transformer.
producer - producer to resource endpoint.
public Enricher(AggregationStrategy aggregationStrategy,
Producer producer)
Enricher.
aggregationStrategy - aggregation strategy to aggregate input data and additional data.producer - producer to resource endpoint.| Method Detail |
|---|
public void setAggregationStrategy(AggregationStrategy aggregationStrategy)
aggregationStrategy - the aggregationStrategy to setpublic void setDefaultAggregationStrategy()
public void process(Exchange exchange)
throws Exception
exchange) by first obtaining
additional data from an endpoint represented by an endpoint
producer and second by aggregating input data and additional
data. Aggregation of input data and additional data is delegated to an
AggregationStrategy object set at construction time. If the
message exchange with the resource endpoint fails then no aggregation
will be done and the failed exchange content is copied over to the
original message exchange.
process in interface Processorexchange - input data.
Exception - if an internal processing error has occurred.
protected Exchange createResourceExchange(Exchange source,
ExchangePattern pattern)
DefaultExchange instance from the given
exchange. The resulting exchange's pattern is defined by
pattern.
source - exchange to copy from.pattern - exchange pattern to set.
protected void doStart()
throws Exception
doStart in class ServiceSupportException
protected void doStop()
throws Exception
doStop in class ServiceSupportException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||