public class SendDynamicProcessor extends ServiceSupport implements AsyncProcessor, IdAware, CamelContextAware
SendProcessor
Modifier and Type | Field and Description |
---|---|
protected int |
cacheSize |
protected CamelContext |
camelContext |
protected Expression |
expression |
protected String |
id |
protected boolean |
ignoreInvalidEndpoint |
protected static org.slf4j.Logger |
LOG |
protected ExchangePattern |
pattern |
protected ProducerCache |
producerCache |
protected String |
uri |
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
SendDynamicProcessor(Expression expression) |
SendDynamicProcessor(String uri,
Expression expression) |
Modifier and Type | Method and Description |
---|---|
protected Exchange |
configureExchange(Exchange exchange,
ExchangePattern pattern,
ExchangePattern destinationExchangePattern,
Endpoint endpoint) |
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
int |
getCacheSize() |
CamelContext |
getCamelContext()
Get the
CamelContext |
EndpointUtilizationStatistics |
getEndpointUtilizationStatistics() |
Expression |
getExpression() |
String |
getId()
Returns the id
|
ExchangePattern |
getPattern() |
String |
getUri() |
boolean |
isIgnoreInvalidEndpoint() |
void |
process(Exchange exchange)
Processes the message exchange
|
boolean |
process(Exchange exchange,
AsyncCallback callback)
Processes the message exchange.
|
protected static Endpoint |
resolveEndpoint(Exchange exchange,
Object recipient) |
void |
setCacheSize(int cacheSize) |
void |
setCamelContext(CamelContext camelContext)
Injects the
CamelContext |
void |
setId(String id)
Sets the id
|
void |
setIgnoreInvalidEndpoint(boolean ignoreInvalidEndpoint) |
void |
setPattern(ExchangePattern pattern) |
String |
toString() |
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
protected static final org.slf4j.Logger LOG
protected CamelContext camelContext
protected final Expression expression
protected ExchangePattern pattern
protected ProducerCache producerCache
protected boolean ignoreInvalidEndpoint
protected int cacheSize
public SendDynamicProcessor(Expression expression)
public SendDynamicProcessor(String uri, Expression expression)
public void process(Exchange exchange) throws Exception
Processor
public boolean process(Exchange exchange, AsyncCallback callback)
AsyncProcessor
Processor.process(org.apache.camel.Exchange)
, but the caller supports having the exchange asynchronously processed.
If there was a failure processing then the caused Exception
would be set on the Exchange
.process
in interface AsyncProcessor
exchange
- the message exchangecallback
- the AsyncCallback
will be invoked when the processing of the exchange is completed.
If the exchange is completed synchronously, then the callback is also invoked synchronously.
The callback should therefore be careful of starting recursive loop.protected static Endpoint resolveEndpoint(Exchange exchange, Object recipient) throws NoTypeConversionAvailableException
protected Exchange configureExchange(Exchange exchange, ExchangePattern pattern, ExchangePattern destinationExchangePattern, Endpoint endpoint)
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class ServiceSupport
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
ServiceSupport.doStop()
method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext
is shutting down.doStop
in class ServiceSupport
Exception
ServiceSupport.doStart()
public EndpointUtilizationStatistics getEndpointUtilizationStatistics()
public CamelContext getCamelContext()
CamelContextAware
CamelContext
getCamelContext
in interface CamelContextAware
public void setCamelContext(CamelContext camelContext)
CamelContextAware
CamelContext
setCamelContext
in interface CamelContextAware
camelContext
- the Camel contextpublic Expression getExpression()
public ExchangePattern getPattern()
public void setPattern(ExchangePattern pattern)
public boolean isIgnoreInvalidEndpoint()
public void setIgnoreInvalidEndpoint(boolean ignoreInvalidEndpoint)
public int getCacheSize()
public void setCacheSize(int cacheSize)
Apache Camel