public final class AggregationStrategyBeanAdapter
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.AggregationStrategy, org.apache.camel.CamelContextAware
AggregationStrategy
that adapts to a POJO.
This allows end users to use POJOs for the aggregation logic, instead of having to implement the
Camel API AggregationStrategy
.Constructor and Description |
---|
AggregationStrategyBeanAdapter(Class<?> type)
Creates this adapter.
|
AggregationStrategyBeanAdapter(Class<?> type,
String methodName)
Creates this adapter.
|
AggregationStrategyBeanAdapter(Object pojo)
Creates this adapter.
|
AggregationStrategyBeanAdapter(Object pojo,
String methodName)
Creates this adapter.
|
Modifier and Type | Method and Description |
---|---|
org.apache.camel.Exchange |
aggregate(org.apache.camel.Exchange oldExchange,
org.apache.camel.Exchange newExchange) |
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.CamelContext |
getCamelContext() |
String |
getMethodName() |
boolean |
isAllowNullNewExchange() |
boolean |
isAllowNullOldExchange() |
protected boolean |
isValidMethod(Method method)
Validates whether the given method is valid.
|
void |
setAllowNullNewExchange(boolean allowNullNewExchange) |
void |
setAllowNullOldExchange(boolean allowNullOldExchange) |
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setMethodName(String methodName) |
doInit, doResume, doShutdown, doSuspend, getStatus, init, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AggregationStrategyBeanAdapter(Object pojo)
pojo
- the pojo to use.public AggregationStrategyBeanAdapter(Class<?> type)
type
- the class type of the pojopublic AggregationStrategyBeanAdapter(Object pojo, String methodName)
pojo
- the pojo to use.methodName
- the name of the method to callpublic org.apache.camel.CamelContext getCamelContext()
getCamelContext
in interface org.apache.camel.CamelContextAware
public void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext
in interface org.apache.camel.CamelContextAware
public String getMethodName()
public void setMethodName(String methodName)
public boolean isAllowNullOldExchange()
public void setAllowNullOldExchange(boolean allowNullOldExchange)
public boolean isAllowNullNewExchange()
public void setAllowNullNewExchange(boolean allowNullNewExchange)
public org.apache.camel.Exchange aggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange)
aggregate
in interface org.apache.camel.AggregationStrategy
protected boolean isValidMethod(Method method)
method
- the methodprotected void doStart() throws Exception
doStart
in class org.apache.camel.support.service.ServiceSupport
Exception
Apache Camel