|
||||||||||
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.PollEnricher
public class PollEnricher
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.
PollingConsumer
to obatin the additional data as opposed to Enricher
that uses a Producer
.
Enricher
Constructor Summary | |
---|---|
PollEnricher(AggregationStrategy aggregationStrategy,
PollingConsumer consumer,
long timeout)
Creates a new PollEnricher . |
|
PollEnricher(PollingConsumer consumer)
Creates a new PollEnricher . |
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 poll enricher. |
void |
setDefaultAggregationStrategy()
Sets the default aggregation strategy for this poll enricher. |
void |
setTimeout(long timeout)
Sets the timeout to use when polling. |
String |
toString()
|
Methods inherited from class org.apache.camel.impl.ServiceSupport |
---|
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PollEnricher(PollingConsumer consumer)
PollEnricher
. 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.
consumer
- consumer to resource endpoint.public PollEnricher(AggregationStrategy aggregationStrategy, PollingConsumer consumer, long timeout)
PollEnricher
.
aggregationStrategy
- aggregation strategy to aggregate input data and additional data.consumer
- consumer to resource endpoint.Method Detail |
---|
public void setAggregationStrategy(AggregationStrategy aggregationStrategy)
aggregationStrategy
- the aggregationStrategy to setpublic void setDefaultAggregationStrategy()
public void setTimeout(long timeout)
timeout
- timeout in millis.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 Processor
exchange
- 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.
public String toString()
toString
in class Object
protected void doStart() throws Exception
doStart
in class ServiceSupport
Exception
protected void doStop() throws Exception
doStop
in class ServiceSupport
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |