|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.support.ServiceSupport
org.apache.camel.impl.DefaultProducerTemplate
public class DefaultProducerTemplate
Template (named like Spring's TransactionTemplate & JmsTemplate
et al) for working with Camel and sending Message instances in an
Exchange to an Endpoint.
| Field Summary |
|---|
| Fields inherited from class org.apache.camel.support.ServiceSupport |
|---|
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
| Constructor Summary | |
|---|---|
DefaultProducerTemplate(CamelContext context)
|
|
DefaultProducerTemplate(CamelContext context,
Endpoint defaultEndpoint)
|
|
DefaultProducerTemplate(CamelContext context,
ExecutorService executor)
|
|
| Method Summary | ||
|---|---|---|
Future<Exchange> |
asyncCallback(Endpoint endpoint,
Exchange exchange,
Synchronization onCompletion)
Sends an asynchronous exchange to the given endpoint. |
|
Future<Exchange> |
asyncCallback(Endpoint endpoint,
Processor processor,
Synchronization onCompletion)
Sends an asynchronous exchange to the given endpoint using a supplied processor. |
|
Future<Exchange> |
asyncCallback(String uri,
Exchange exchange,
Synchronization onCompletion)
Sends an asynchronous exchange to the given endpoint. |
|
Future<Exchange> |
asyncCallback(String uri,
Processor processor,
Synchronization onCompletion)
Sends an asynchronous exchange to the given endpoint using a supplied processor. |
|
Future<Object> |
asyncCallbackRequestBody(Endpoint endpoint,
Object body,
Synchronization onCompletion)
Sends an asynchronous body to the given endpoint. |
|
Future<Object> |
asyncCallbackRequestBody(String uri,
Object body,
Synchronization onCompletion)
Sends an asynchronous body to the given endpoint. |
|
Future<Object> |
asyncCallbackSendBody(Endpoint endpoint,
Object body,
Synchronization onCompletion)
Sends an asynchronous body to the given endpoint. |
|
Future<Object> |
asyncCallbackSendBody(String uri,
Object body,
Synchronization onCompletion)
Sends an asynchronous body to the given endpoint. |
|
Future<Object> |
asyncRequestBody(Endpoint endpoint,
Object body)
Sends an asynchronous body to the given endpoint. |
|
|
asyncRequestBody(Endpoint endpoint,
Object body,
Class<T> type)
Sends an asynchronous body to the given endpoint. |
|
Future<Object> |
asyncRequestBody(String uri,
Object body)
Sends an asynchronous body to the given endpoint. |
|
|
asyncRequestBody(String uri,
Object body,
Class<T> type)
Sends an asynchronous body to the given endpoint. |
|
Future<Object> |
asyncRequestBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue)
Sends an asynchronous body to the given endpoint. |
|
|
asyncRequestBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue,
Class<T> type)
Sends an asynchronous body to the given endpoint. |
|
Future<Object> |
asyncRequestBodyAndHeader(String endpointUri,
Object body,
String header,
Object headerValue)
Sends an asynchronous body to the given endpoint. |
|
|
asyncRequestBodyAndHeader(String endpointUri,
Object body,
String header,
Object headerValue,
Class<T> type)
Sends an asynchronous body to the given endpoint. |
|
Future<Object> |
asyncRequestBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers)
Sends an asynchronous body to the given endpoint. |
|
|
asyncRequestBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers,
Class<T> type)
Sends an asynchronous body to the given endpoint. |
|
Future<Object> |
asyncRequestBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers)
Sends an asynchronous body to the given endpoint. |
|
|
asyncRequestBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers,
Class<T> type)
Sends an asynchronous body to the given endpoint. |
|
Future<Exchange> |
asyncSend(Endpoint endpoint,
Exchange exchange)
Sends an asynchronous exchange to the given endpoint. |
|
Future<Exchange> |
asyncSend(Endpoint endpoint,
Processor processor)
Sends an asynchronous exchange to the given endpoint. |
|
Future<Exchange> |
asyncSend(String uri,
Exchange exchange)
Sends an asynchronous exchange to the given endpoint. |
|
Future<Exchange> |
asyncSend(String uri,
Processor processor)
Sends an asynchronous exchange to the given endpoint. |
|
Future<Object> |
asyncSendBody(Endpoint endpoint,
Object body)
Sends an asynchronous body to the given endpoint. |
|
Future<Object> |
asyncSendBody(String uri,
Object body)
Sends an asynchronous body to the given endpoint. |
|
protected Processor |
createBodyAndHeaderProcessor(Object body,
String header,
Object headerValue)
|
|
protected Processor |
createBodyAndPropertyProcessor(Object body,
String property,
Object propertyValue)
|
|
protected Processor |
createSetBodyProcessor(Object body)
|
|
protected void |
doStart()
|
|
protected void |
doStop()
|
|
|
extractFutureBody(Future<Object> future,
Class<T> type)
Gets the response body from the future handle, will wait until the response is ready. |
|
|
extractFutureBody(Future<Object> future,
long timeout,
TimeUnit unit,
Class<T> type)
Gets the response body from the future handle, will wait at most the given time for the response to be ready. |
|
protected Object |
extractResultBody(Exchange result)
|
|
protected Object |
extractResultBody(Exchange result,
ExchangePattern pattern)
|
|
CamelContext |
getContext()
|
|
int |
getCurrentCacheSize()
Gets an approximated size of the current cached resources in the backing cache pools. |
|
Endpoint |
getDefaultEndpoint()
|
|
protected Endpoint |
getMandatoryDefaultEndpoint()
|
|
int |
getMaximumCacheSize()
Gets the maximum cache size used in the backing cache pools. |
|
|
getResolvedEndpoint(String endpointUri,
Class<T> expectedClass)
|
|
static DefaultProducerTemplate |
newInstance(CamelContext camelContext,
String defaultEndpointUri)
|
|
Exchange |
request(Endpoint endpoint,
Processor processor)
Sends an exchange to an endpoint using a supplied processor Uses an ExchangePattern.InOut message exchange pattern. |
|
Exchange |
request(String endpoint,
Processor processor)
Sends an exchange to an endpoint using a supplied processor Uses an ExchangePattern.InOut message exchange pattern. |
|
Object |
requestBody(Endpoint endpoint,
Object body)
Send the body to an endpoint returning any result output body. |
|
|
requestBody(Endpoint endpoint,
Object body,
Class<T> type)
Send the body to an endpoint returning any result output body. |
|
Object |
requestBody(Object body)
Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern. |
|
|
requestBody(Object body,
Class<T> type)
Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern. |
|
Object |
requestBody(String endpoint,
Object body)
Send the body to an endpoint returning any result output body. |
|
|
requestBody(String endpointUri,
Object body,
Class<T> type)
Send the body to an endpoint returning any result output body. |
|
Object |
requestBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue)
Send the body to an endpoint returning any result output body. |
|
|
requestBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue,
Class<T> type)
Send the body to an endpoint returning any result output body. |
|
Object |
requestBodyAndHeader(Object body,
String header,
Object headerValue)
Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern. |
|
Object |
requestBodyAndHeader(String endpoint,
Object body,
String header,
Object headerValue)
Send the body to an endpoint returning any result output body. |
|
|
requestBodyAndHeader(String endpointUri,
Object body,
String header,
Object headerValue,
Class<T> type)
Send the body to an endpoint returning any result output body. |
|
Object |
requestBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers)
Sends the body to an endpoint with the specified headers and header values. |
|
|
requestBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers,
Class<T> type)
Sends the body to an endpoint with the specified headers and header values. |
|
Object |
requestBodyAndHeaders(Object body,
Map<String,Object> headers)
Sends the body to the default endpoint and returns the result content Uses an ExchangePattern.InOut message exchange pattern. |
|
Object |
requestBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers)
Sends the body to an endpoint with the specified headers and header values. |
|
|
requestBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers,
Class<T> type)
Sends the body to an endpoint with the specified headers and header values. |
|
protected Endpoint |
resolveMandatoryEndpoint(String endpointUri)
|
|
Exchange |
send(Endpoint endpoint,
Exchange exchange)
Sends the exchange to the given endpoint Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException(). |
|
Exchange |
send(Endpoint endpoint,
ExchangePattern pattern,
Processor processor)
Sends an exchange to an endpoint using a supplied processor Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException(). |
|
Exchange |
send(Endpoint endpoint,
Processor processor)
Sends an exchange to an endpoint using a supplied processor Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException(). |
|
Exchange |
send(Exchange exchange)
Sends the exchange to the default endpoint Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException(). |
|
Exchange |
send(Processor processor)
Sends an exchange to the default endpoint using a supplied processor Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException(). |
|
Exchange |
send(String endpointUri,
Exchange exchange)
Sends the exchange to the given endpoint Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException(). |
|
Exchange |
send(String endpointUri,
ExchangePattern pattern,
Processor processor)
Sends an exchange to an endpoint using a supplied processor Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException(). |
|
Exchange |
send(String endpointUri,
Processor processor)
Sends an exchange to an endpoint using a supplied processor Notice: that if the processing of the exchange failed with an Exception it is not thrown from this method, but you can access it from the returned exchange using Exchange.getException(). |
|
Object |
sendBody(Endpoint endpoint,
ExchangePattern pattern,
Object body)
Send the body to an endpoint with the given ExchangePattern
returning any result output body
Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBody(Endpoint endpoint,
Object body)
Send the body to an endpoint Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBody(Object body)
Sends the body to the default endpoint Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
Object |
sendBody(String endpointUri,
ExchangePattern pattern,
Object body)
Send the body to an endpoint returning any result output body Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBody(String endpointUri,
Object body)
Send the body to an endpoint Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
Object |
sendBodyAndHeader(Endpoint endpoint,
ExchangePattern pattern,
Object body,
String header,
Object headerValue)
Sends the body to an endpoint with a specified header and header value Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue)
Sends the body to an endpoint with a specified header and header value Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBodyAndHeader(Object body,
String header,
Object headerValue)
Sends the body to the default endpoint with a specified header and header value Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
Object |
sendBodyAndHeader(String endpoint,
ExchangePattern pattern,
Object body,
String header,
Object headerValue)
Sends the body to an endpoint with a specified header and header value Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBodyAndHeader(String endpointUri,
Object body,
String header,
Object headerValue)
Sends the body to an endpoint with a specified header and header value Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
Object |
sendBodyAndHeaders(Endpoint endpoint,
ExchangePattern pattern,
Object body,
Map<String,Object> headers)
Sends the body to an endpoint with the specified headers and header values Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers)
Sends the body to an endpoint with the specified headers and header values Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBodyAndHeaders(Object body,
Map<String,Object> headers)
Sends the body to the default endpoint with the specified headers and header values Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
Object |
sendBodyAndHeaders(String endpointUri,
ExchangePattern pattern,
Object body,
Map<String,Object> headers)
Sends the body to an endpoint with the specified headers and header values Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers)
Sends the body to an endpoint with the specified headers and header values Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
Object |
sendBodyAndProperty(Endpoint endpoint,
ExchangePattern pattern,
Object body,
String property,
Object propertyValue)
Sends the body to an endpoint with a specified property and property value Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBodyAndProperty(Endpoint endpoint,
Object body,
String property,
Object propertyValue)
Sends the body to an endpoint with a specified property and property value Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBodyAndProperty(Object body,
String property,
Object propertyValue)
Sends the body to the default endpoint with a specified property and property value Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
Object |
sendBodyAndProperty(String endpoint,
ExchangePattern pattern,
Object body,
String property,
Object propertyValue)
Sends the body to an endpoint with a specified property and property value Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
sendBodyAndProperty(String endpointUri,
Object body,
String property,
Object propertyValue)
Sends the body to an endpoint with a specified property and property value Notice: that if the processing of the exchange failed with an Exception it is thrown from this method as a CamelExecutionException with
the caused exception wrapped. |
|
void |
setDefaultEndpoint(Endpoint defaultEndpoint)
|
|
void |
setDefaultEndpointUri(String endpointUri)
Sets the default endpoint to use if none is specified |
|
void |
setExecutorService(ExecutorService executorService)
Sets a custom executor service to use for async messaging. |
|
void |
setMaximumCacheSize(int maximumCacheSize)
Sets a custom maximum cache size to use in the backing cache pools. |
|
| Methods inherited from class org.apache.camel.support.ServiceSupport |
|---|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, resume, shutdown, start, stop, suspend |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Constructor Detail |
|---|
public DefaultProducerTemplate(CamelContext context)
public DefaultProducerTemplate(CamelContext context,
ExecutorService executor)
public DefaultProducerTemplate(CamelContext context,
Endpoint defaultEndpoint)
| Method Detail |
|---|
public static DefaultProducerTemplate newInstance(CamelContext camelContext,
String defaultEndpointUri)
public int getMaximumCacheSize()
ProducerTemplate
getMaximumCacheSize in interface ProducerTemplatepublic void setMaximumCacheSize(int maximumCacheSize)
ProducerTemplate
setMaximumCacheSize in interface ProducerTemplatemaximumCacheSize - the custom maximum cache sizepublic int getCurrentCacheSize()
ProducerTemplate
getCurrentCacheSize in interface ProducerTemplate
public Exchange send(String endpointUri,
Exchange exchange)
ProducerTemplateExchange.getException().
send in interface ProducerTemplateendpointUri - the endpoint URI to send the exchange toexchange - the exchange to send
public Exchange send(String endpointUri,
Processor processor)
ProducerTemplateExchange.getException().
send in interface ProducerTemplateendpointUri - the endpoint URI to send the exchange toprocessor - the transformer used to populate the new exchange
Processor to populate the exchange
public Exchange send(String endpointUri,
ExchangePattern pattern,
Processor processor)
ProducerTemplateExchange.getException().
send in interface ProducerTemplateendpointUri - the endpoint URI to send the exchange topattern - the message ExchangePattern such as
ExchangePattern.InOnly or ExchangePattern.InOutprocessor - the transformer used to populate the new exchange
Processor to populate the exchange
public Exchange send(Endpoint endpoint,
Exchange exchange)
ProducerTemplateExchange.getException().
send in interface ProducerTemplateendpoint - the endpoint to send the exchange toexchange - the exchange to send
public Exchange send(Endpoint endpoint,
Processor processor)
ProducerTemplateExchange.getException().
send in interface ProducerTemplateendpoint - the endpoint to send the exchange toprocessor - the transformer used to populate the new exchange
Processor to populate the exchange
public Exchange send(Endpoint endpoint,
ExchangePattern pattern,
Processor processor)
ProducerTemplateExchange.getException().
send in interface ProducerTemplateendpoint - the endpoint to send the exchange topattern - the message ExchangePattern such as
ExchangePattern.InOnly or ExchangePattern.InOutprocessor - the transformer used to populate the new exchange
Processor to populate the exchange
public Object sendBody(Endpoint endpoint,
ExchangePattern pattern,
Object body)
ProducerTemplateExchangePattern
returning any result output body
CamelExecutionException with
the caused exception wrapped.
sendBody in interface ProducerTemplateendpoint - the endpoint to send the exchange topattern - the message ExchangePattern such as
ExchangePattern.InOnly or ExchangePattern.InOutbody - the payload
ExchangePattern is OUT capable, otherwise null
public void sendBody(Endpoint endpoint,
Object body)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBody in interface ProducerTemplateendpoint - the endpoint to send the exchange tobody - the payload
CamelExecutionException - if the processing of the exchange failed
public void sendBody(String endpointUri,
Object body)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBody in interface ProducerTemplateendpointUri - the endpoint URI to send the exchange tobody - the payload
CamelExecutionException - if the processing of the exchange failed
public Object sendBody(String endpointUri,
ExchangePattern pattern,
Object body)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBody in interface ProducerTemplateendpointUri - the endpoint URI to send the exchange topattern - the message ExchangePattern such as
ExchangePattern.InOnly or ExchangePattern.InOutbody - the payload
ExchangePattern is OUT capable, otherwise null
CamelExecutionException - if the processing of the exchange failed
public void sendBodyAndHeader(String endpointUri,
Object body,
String header,
Object headerValue)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndHeader in interface ProducerTemplateendpointUri - the endpoint URI to send tobody - the payload to sendheader - the header nameheaderValue - the header value
CamelExecutionException - if the processing of the exchange failed
public void sendBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndHeader in interface ProducerTemplateendpoint - the Endpoint to send tobody - the payload to sendheader - the header nameheaderValue - the header value
CamelExecutionException - if the processing of the exchange failed
public Object sendBodyAndHeader(Endpoint endpoint,
ExchangePattern pattern,
Object body,
String header,
Object headerValue)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndHeader in interface ProducerTemplateendpoint - the Endpoint to send topattern - the message ExchangePattern such as
ExchangePattern.InOnly or ExchangePattern.InOutbody - the payload to sendheader - the header nameheaderValue - the header value
ExchangePattern is OUT capable, otherwise null
CamelExecutionException - if the processing of the exchange failed
public Object sendBodyAndHeader(String endpoint,
ExchangePattern pattern,
Object body,
String header,
Object headerValue)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndHeader in interface ProducerTemplateendpoint - the Endpoint URI to send topattern - the message ExchangePattern such as
ExchangePattern.InOnly or ExchangePattern.InOutbody - the payload to sendheader - the header nameheaderValue - the header value
ExchangePattern is OUT capable, otherwise null
CamelExecutionException - if the processing of the exchange failed
public void sendBodyAndProperty(String endpointUri,
Object body,
String property,
Object propertyValue)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndProperty in interface ProducerTemplateendpointUri - the endpoint URI to send tobody - the payload to sendproperty - the property namepropertyValue - the property value
CamelExecutionException - if the processing of the exchange failed
public void sendBodyAndProperty(Endpoint endpoint,
Object body,
String property,
Object propertyValue)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndProperty in interface ProducerTemplateendpoint - the Endpoint to send tobody - the payload to sendproperty - the property namepropertyValue - the property value
CamelExecutionException - if the processing of the exchange failed
public Object sendBodyAndProperty(Endpoint endpoint,
ExchangePattern pattern,
Object body,
String property,
Object propertyValue)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndProperty in interface ProducerTemplateendpoint - the Endpoint to send topattern - the message ExchangePattern such as
ExchangePattern.InOnly or ExchangePattern.InOutbody - the payload to sendproperty - the property namepropertyValue - the property value
ExchangePattern is OUT capable, otherwise null
CamelExecutionException - if the processing of the exchange failed
public Object sendBodyAndProperty(String endpoint,
ExchangePattern pattern,
Object body,
String property,
Object propertyValue)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndProperty in interface ProducerTemplateendpoint - the Endpoint URI to send topattern - the message ExchangePattern such as
ExchangePattern.InOnly or ExchangePattern.InOutbody - the payload to sendproperty - the property namepropertyValue - the property value
ExchangePattern is OUT capable, otherwise null
CamelExecutionException - if the processing of the exchange failed
public void sendBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndHeaders in interface ProducerTemplateendpointUri - the endpoint URI to send tobody - the payload to sendheaders - headers
CamelExecutionException - if the processing of the exchange failed
public void sendBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndHeaders in interface ProducerTemplateendpoint - the endpoint URI to send tobody - the payload to sendheaders - headers
CamelExecutionException - if the processing of the exchange failed
public Object sendBodyAndHeaders(String endpointUri,
ExchangePattern pattern,
Object body,
Map<String,Object> headers)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndHeaders in interface ProducerTemplateendpointUri - the endpoint URI to send topattern - the message ExchangePattern such as
ExchangePattern.InOnly or ExchangePattern.InOutbody - the payload to sendheaders - headers
ExchangePattern is OUT capable, otherwise null
CamelExecutionException - if the processing of the exchange failed
public Object sendBodyAndHeaders(Endpoint endpoint,
ExchangePattern pattern,
Object body,
Map<String,Object> headers)
throws CamelExecutionException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndHeaders in interface ProducerTemplateendpoint - the endpoint URI to send topattern - the message ExchangePattern such as
ExchangePattern.InOnly or ExchangePattern.InOutbody - the payload to sendheaders - headers
ExchangePattern is OUT capable, otherwise null
CamelExecutionException - if the processing of the exchange failed
public Exchange request(Endpoint endpoint,
Processor processor)
ProducerTemplateExchangePattern.InOut message exchange pattern.
Exchange.getException().
request in interface ProducerTemplateendpoint - the Endpoint to send toprocessor - the processor which will populate the exchange before sending
public Object requestBody(Object body)
throws CamelExecutionException
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBody in interface ProducerTemplatebody - the payload to send
CamelExecutionException - if the processing of the exchange failed
public Object requestBody(Endpoint endpoint,
Object body)
throws CamelExecutionException
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBody in interface ProducerTemplateendpoint - the Endpoint to send tobody - the payload
CamelExecutionException - if the processing of the exchange failed
public Object requestBodyAndHeader(Object body,
String header,
Object headerValue)
throws CamelExecutionException
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBodyAndHeader in interface ProducerTemplatebody - the payloadheader - the header nameheaderValue - the header value
CamelExecutionException - if the processing of the exchange failed
public Object requestBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue)
throws CamelExecutionException
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBodyAndHeader in interface ProducerTemplateendpoint - the Endpoint to send tobody - the payloadheader - the header nameheaderValue - the header value
CamelExecutionException - if the processing of the exchange failed
public Exchange request(String endpoint,
Processor processor)
throws CamelExecutionException
ProducerTemplateExchangePattern.InOut message exchange pattern.
Exchange.getException().
request in interface ProducerTemplateendpoint - the endpoint URI to send toprocessor - the processor which will populate the exchange before sending
CamelExecutionException
public Object requestBody(String endpoint,
Object body)
throws CamelExecutionException
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBody in interface ProducerTemplateendpoint - the endpoint URI to send tobody - the payload
CamelExecutionException - if the processing of the exchange failed
public Object requestBodyAndHeader(String endpoint,
Object body,
String header,
Object headerValue)
throws CamelExecutionException
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBodyAndHeader in interface ProducerTemplateendpoint - the endpoint URI to send tobody - the payloadheader - the header nameheaderValue - the header value
CamelExecutionException - if the processing of the exchange failed
public Object requestBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers)
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBodyAndHeaders in interface ProducerTemplateendpointUri - the endpoint URI to send tobody - the payload to sendheaders - headers
public Object requestBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers)
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBodyAndHeaders in interface ProducerTemplateendpoint - the endpoint URI to send tobody - the payload to sendheaders - headers
public Object requestBodyAndHeaders(Object body,
Map<String,Object> headers)
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBodyAndHeaders in interface ProducerTemplatebody - the payload to sendheaders - headers
public <T> T requestBody(Object body,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBody in interface ProducerTemplatebody - the payload to sendtype - the expected response type
public <T> T requestBody(Endpoint endpoint,
Object body,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBody in interface ProducerTemplateendpoint - the Endpoint to send tobody - the payloadtype - the expected response type
public <T> T requestBody(String endpointUri,
Object body,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBody in interface ProducerTemplateendpointUri - the endpoint URI to send tobody - the payloadtype - the expected response type
public <T> T requestBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBodyAndHeader in interface ProducerTemplateendpoint - the Endpoint to send tobody - the payloadheader - the header nameheaderValue - the header valuetype - the expected response type
public <T> T requestBodyAndHeader(String endpointUri,
Object body,
String header,
Object headerValue,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBodyAndHeader in interface ProducerTemplateendpointUri - the endpoint URI to send tobody - the payloadheader - the header nameheaderValue - the header valuetype - the expected response type
public <T> T requestBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBodyAndHeaders in interface ProducerTemplateendpointUri - the endpoint URI to send tobody - the payload to sendheaders - headerstype - the expected response type
public <T> T requestBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
CamelExecutionException with
the caused exception wrapped.
requestBodyAndHeaders in interface ProducerTemplateendpoint - the endpoint URI to send tobody - the payload to sendheaders - headerstype - the expected response type
public void sendBody(Object body)
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBody in interface ProducerTemplatebody - the payload to sendpublic Exchange send(Exchange exchange)
ProducerTemplateExchange.getException().
send in interface ProducerTemplateexchange - the exchange to send
public Exchange send(Processor processor)
ProducerTemplateExchange.getException().
send in interface ProducerTemplateprocessor - the transformer used to populate the new exchange
Processor to populate the exchange
public void sendBodyAndHeader(Object body,
String header,
Object headerValue)
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndHeader in interface ProducerTemplatebody - the payload to sendheader - the header nameheaderValue - the header value
public void sendBodyAndProperty(Object body,
String property,
Object propertyValue)
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndProperty in interface ProducerTemplatebody - the payload to sendproperty - the property namepropertyValue - the property value
public void sendBodyAndHeaders(Object body,
Map<String,Object> headers)
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
sendBodyAndHeaders in interface ProducerTemplatebody - the payload to sendheaders - the headerspublic CamelContext getContext()
public Endpoint getDefaultEndpoint()
public void setDefaultEndpoint(Endpoint defaultEndpoint)
public void setDefaultEndpointUri(String endpointUri)
public <T extends Endpoint> T getResolvedEndpoint(String endpointUri,
Class<T> expectedClass)
protected Processor createBodyAndHeaderProcessor(Object body,
String header,
Object headerValue)
protected Processor createBodyAndPropertyProcessor(Object body,
String property,
Object propertyValue)
protected Processor createSetBodyProcessor(Object body)
protected Endpoint resolveMandatoryEndpoint(String endpointUri)
protected Endpoint getMandatoryDefaultEndpoint()
protected Object extractResultBody(Exchange result)
protected Object extractResultBody(Exchange result,
ExchangePattern pattern)
public void setExecutorService(ExecutorService executorService)
ProducerTemplate
setExecutorService in interface ProducerTemplateexecutorService - the executor service.
public Future<Exchange> asyncSend(String uri,
Exchange exchange)
ProducerTemplate
asyncSend in interface ProducerTemplateuri - the endpoint URI to send the exchange toexchange - the exchange to send
public Future<Exchange> asyncSend(String uri,
Processor processor)
ProducerTemplate
asyncSend in interface ProducerTemplateuri - the endpoint URI to send the exchange toprocessor - the transformer used to populate the new exchange
public Future<Object> asyncSendBody(String uri,
Object body)
ProducerTemplateExchangePattern.InOnly message exchange pattern.
asyncSendBody in interface ProducerTemplateuri - the endpoint URI to send the exchange tobody - the body to send
public Future<Object> asyncRequestBody(String uri,
Object body)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBody in interface ProducerTemplateuri - the endpoint URI to send the exchange tobody - the body to send
public <T> Future<T> asyncRequestBody(String uri,
Object body,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBody in interface ProducerTemplateuri - the endpoint URI to send the exchange tobody - the body to sendtype - the expected response type
public Future<Object> asyncRequestBodyAndHeader(String endpointUri,
Object body,
String header,
Object headerValue)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBodyAndHeader in interface ProducerTemplateendpointUri - the endpoint URI to send the exchange tobody - the body to sendheader - the header nameheaderValue - the header value
public <T> Future<T> asyncRequestBodyAndHeader(String endpointUri,
Object body,
String header,
Object headerValue,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBodyAndHeader in interface ProducerTemplateendpointUri - the endpoint URI to send the exchange tobody - the body to sendheader - the header nameheaderValue - the header valuetype - the expected response type
public Future<Object> asyncRequestBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBodyAndHeaders in interface ProducerTemplateendpointUri - the endpoint URI to send the exchange tobody - the body to sendheaders - headers
public <T> Future<T> asyncRequestBodyAndHeaders(String endpointUri,
Object body,
Map<String,Object> headers,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBodyAndHeaders in interface ProducerTemplateendpointUri - the endpoint URI to send the exchange tobody - the body to sendheaders - headerstype - the expected response type
public <T> T extractFutureBody(Future<Object> future,
Class<T> type)
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
extractFutureBody in interface ProducerTemplatefuture - the handle to get the responsetype - the expected response type
public <T> T extractFutureBody(Future<Object> future,
long timeout,
TimeUnit unit,
Class<T> type)
throws TimeoutException
ProducerTemplateCamelExecutionException with
the caused exception wrapped.
extractFutureBody in interface ProducerTemplatefuture - the handle to get the responsetimeout - the maximum time to waitunit - the time unit of the timeout argumenttype - the expected response type
TimeoutException - if the wait timed out
public Future<Object> asyncCallbackSendBody(String uri,
Object body,
Synchronization onCompletion)
ProducerTemplateExchangePattern.InOnly message exchange pattern.
asyncCallbackSendBody in interface ProducerTemplateuri - the endpoint URI to send the exchange tobody - the body to sendonCompletion - callback invoked when exchange has been completed
public Future<Object> asyncCallbackSendBody(Endpoint endpoint,
Object body,
Synchronization onCompletion)
ProducerTemplateExchangePattern.InOnly message exchange pattern.
asyncCallbackSendBody in interface ProducerTemplateendpoint - the endpoint to send the exchange tobody - the body to sendonCompletion - callback invoked when exchange has been completed
public Future<Object> asyncCallbackRequestBody(String uri,
Object body,
Synchronization onCompletion)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncCallbackRequestBody in interface ProducerTemplateuri - the endpoint URI to send the exchange tobody - the body to sendonCompletion - callback invoked when exchange has been completed
public Future<Object> asyncCallbackRequestBody(Endpoint endpoint,
Object body,
Synchronization onCompletion)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncCallbackRequestBody in interface ProducerTemplateendpoint - the endpoint to send the exchange tobody - the body to sendonCompletion - callback invoked when exchange has been completed
public Future<Exchange> asyncCallback(String uri,
Exchange exchange,
Synchronization onCompletion)
ProducerTemplate
asyncCallback in interface ProducerTemplateuri - the endpoint URI to send the exchange toexchange - the exchange to sendonCompletion - callback invoked when exchange has been completed
public Future<Exchange> asyncCallback(String uri,
Processor processor,
Synchronization onCompletion)
ProducerTemplate
asyncCallback in interface ProducerTemplateuri - the endpoint URI to send the exchange toprocessor - the transformer used to populate the new exchange
Processor to populate the exchangeonCompletion - callback invoked when exchange has been completed
public Future<Object> asyncRequestBody(Endpoint endpoint,
Object body)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBody in interface ProducerTemplateendpoint - the endpoint to send the exchange tobody - the body to send
public <T> Future<T> asyncRequestBody(Endpoint endpoint,
Object body,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBody in interface ProducerTemplateendpoint - the endpoint to send the exchange tobody - the body to sendtype - the expected response type
public Future<Object> asyncRequestBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBodyAndHeader in interface ProducerTemplateendpoint - the endpoint to send the exchange tobody - the body to sendheader - the header nameheaderValue - the header value
public <T> Future<T> asyncRequestBodyAndHeader(Endpoint endpoint,
Object body,
String header,
Object headerValue,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBodyAndHeader in interface ProducerTemplateendpoint - the endpoint to send the exchange tobody - the body to sendheader - the header nameheaderValue - the header valuetype - the expected response type
public Future<Object> asyncRequestBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBodyAndHeaders in interface ProducerTemplateendpoint - the endpoint to send the exchange tobody - the body to sendheaders - headers
public <T> Future<T> asyncRequestBodyAndHeaders(Endpoint endpoint,
Object body,
Map<String,Object> headers,
Class<T> type)
ProducerTemplateExchangePattern.InOut message exchange pattern.
asyncRequestBodyAndHeaders in interface ProducerTemplateendpoint - the endpoint to send the exchange tobody - the body to sendheaders - headerstype - the expected response type
public Future<Exchange> asyncSend(Endpoint endpoint,
Exchange exchange)
ProducerTemplate
asyncSend in interface ProducerTemplateendpoint - the endpoint to send the exchange toexchange - the exchange to send
public Future<Exchange> asyncSend(Endpoint endpoint,
Processor processor)
ProducerTemplate
asyncSend in interface ProducerTemplateendpoint - the endpoint to send the exchange toprocessor - the transformer used to populate the new exchange
public Future<Object> asyncSendBody(Endpoint endpoint,
Object body)
ProducerTemplateExchangePattern.InOnly message exchange pattern.
asyncSendBody in interface ProducerTemplateendpoint - the endpoint to send the exchange tobody - the body to send
public Future<Exchange> asyncCallback(Endpoint endpoint,
Exchange exchange,
Synchronization onCompletion)
ProducerTemplate
asyncCallback in interface ProducerTemplateendpoint - the endpoint to send the exchange toexchange - the exchange to sendonCompletion - callback invoked when exchange has been completed
public Future<Exchange> asyncCallback(Endpoint endpoint,
Processor processor,
Synchronization onCompletion)
ProducerTemplate
asyncCallback in interface ProducerTemplateendpoint - the endpoint to send the exchange toprocessor - the transformer used to populate the new exchange
Processor to populate the exchangeonCompletion - callback invoked when exchange has been completed
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 | |||||||||