| Modifier and Type | Field and Description |
|---|---|
protected CamelContext |
context |
ACCEPT_CONTENT_TYPE, AGGREGATED_COMPLETED_BY, AGGREGATED_CORRELATION_KEY, AGGREGATED_SIZE, AGGREGATED_TIMEOUT, AGGREGATION_COMPLETE_ALL_GROUPS, AGGREGATION_COMPLETE_ALL_GROUPS_INCLUSIVE, AGGREGATION_STRATEGY, ASYNC_WAIT, AUTHENTICATION, AUTHENTICATION_FAILURE_POLICY_ID, BATCH_COMPLETE, BATCH_INDEX, BATCH_SIZE, BEAN_METHOD_NAME, BEAN_MULTI_PARAMETER_ARRAY, BINDING, BREADCRUMB_ID, CHARSET_NAME, CONTENT_ENCODING, CONTENT_LENGTH, CONTENT_TYPE, CORRELATION_ID, CREATED_TIMESTAMP, DATASET_INDEX, DEFAULT_CHARSET_PROPERTY, DESTINATION_OVERRIDE_URL, DISABLE_HTTP_STREAM_CACHE, DUPLICATE_MESSAGE, ERRORHANDLER_HANDLED, EVALUATE_EXPRESSION_RESULT, EXCEPTION_CAUGHT, EXCEPTION_HANDLED, EXTERNAL_REDELIVERED, FAILURE_ENDPOINT, FAILURE_HANDLED, FAILURE_ROUTE_ID, FILE_LAST_MODIFIED, FILE_LENGTH, FILE_LOCAL_WORK_PATH, FILE_LOCK_FILE_ACQUIRED, FILE_LOCK_FILE_NAME, FILE_NAME, FILE_NAME_ONLY, FILE_NAME_PRODUCED, FILE_PARENT, FILE_PATH, FILTER_MATCHED, FILTER_NON_XML_CHARS, GROUPED_EXCHANGE, HTTP_BASE_URI, HTTP_CHARACTER_ENCODING, HTTP_CHUNKED, HTTP_METHOD, HTTP_PATH, HTTP_PROTOCOL_VERSION, HTTP_QUERY, HTTP_RESPONSE_CODE, HTTP_SERVLET_REQUEST, HTTP_SERVLET_RESPONSE, HTTP_URI, HTTP_URL, INTERCEPT_SEND_TO_ENDPOINT_WHEN_MATCHED, INTERCEPTED_ENDPOINT, LANGUAGE_SCRIPT, LOG_DEBUG_BODY_MAX_CHARS, LOG_DEBUG_BODY_STREAMS, LOOP_INDEX, LOOP_SIZE, MAXIMUM_CACHE_POOL_SIZE, MAXIMUM_ENDPOINT_CACHE_SIZE, MESSAGE_HISTORY, MULTICAST_COMPLETE, MULTICAST_INDEX, NOTIFY_EVENT, ON_COMPLETION, OVERRULE_FILE_NAME, PARENT_UNIT_OF_WORK, RECEIVED_TIMESTAMP, RECIPIENT_LIST_ENDPOINT, REDELIVERED, REDELIVERY_COUNTER, REDELIVERY_DELAY, REDELIVERY_EXHAUSTED, REDELIVERY_MAX_COUNTER, ROLLBACK_ONLY, ROLLBACK_ONLY_LAST, ROUTE_STOP, SKIP_GZIP_ENCODING, SLIP_ENDPOINT, SOAP_ACTION, SPLIT_COMPLETE, SPLIT_INDEX, SPLIT_SIZE, TIMER_COUNTER, TIMER_FIRED_TIME, TIMER_NAME, TIMER_PERIOD, TIMER_TIME, TO_ENDPOINT, TRACE_EVENT, TRACE_EVENT_EXCHANGE, TRACE_EVENT_NODE_ID, TRACE_EVENT_TIMESTAMP, TRANSFER_ENCODING, UNIT_OF_WORK_EXHAUSTED, UNIT_OF_WORK_PROCESS_SYNC, XSLT_FILE_NAME| Constructor and Description |
|---|
DefaultExchange(CamelContext context) |
DefaultExchange(CamelContext context,
ExchangePattern pattern) |
DefaultExchange(Endpoint fromEndpoint) |
DefaultExchange(Endpoint fromEndpoint,
ExchangePattern pattern) |
DefaultExchange(Exchange parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOnCompletion(Synchronization onCompletion)
Adds a
Synchronization to be invoked as callback when
this exchange is completed. |
protected void |
configureMessage(Message message)
Configures the message after it has been set on the exchange
|
boolean |
containsOnCompletion(Synchronization onCompletion)
Checks if the passed
Synchronization instance is
already contained on this exchange. |
Exchange |
copy()
Creates a copy of the current message exchange so that it can be
forwarded to another destination
|
protected String |
createExchangeId() |
CamelContext |
getContext()
Returns the container so that a processor can resolve endpoints from URIs
|
Exception |
getException()
Returns the exception associated with this exchange
|
<T> T |
getException(Class<T> type)
Returns the exception associated with this exchange.
|
String |
getExchangeId()
Returns the exchange id (unique)
|
Endpoint |
getFromEndpoint()
Returns the endpoint which originated this message exchange if a consumer on an endpoint
created the message exchange, otherwise this property will be null
|
String |
getFromRouteId()
Returns the route id which originated this message exchange if a route consumer on an endpoint
created the message exchange, otherwise this property will be null
|
Message |
getIn()
Returns the inbound request message
|
<T> T |
getIn(Class<T> type)
Returns the inbound request message as the given type
|
Message |
getOut()
Returns the outbound message, lazily creating one if one has not already
been associated with this exchange.
|
<T> T |
getOut(Class<T> type)
Returns the outbound request message as the given type
Important: If you want to change the current message, then use Exchange.getIn() instead as it will
ensure headers etc. |
ExchangePattern |
getPattern()
Returns the
ExchangePattern (MEP) of this exchange. |
Map<String,Object> |
getProperties()
Returns all of the properties associated with the exchange
|
Object |
getProperty(String name)
Returns a property associated with this exchange by name
|
<T> T |
getProperty(String name,
Class<T> type)
Returns a property associated with this exchange by name and specifying
the type required
|
Object |
getProperty(String name,
Object defaultValue)
Returns a property associated with this exchange by name
|
<T> T |
getProperty(String name,
Object defaultValue,
Class<T> type)
Returns a property associated with this exchange by name and specifying
the type required
|
UnitOfWork |
getUnitOfWork()
Returns the unit of work that this exchange belongs to; which may map to
zero, one or more physical transactions
|
List<Synchronization> |
handoverCompletions()
Handover all the on completions from this exchange
|
void |
handoverCompletions(Exchange target)
Handover all the on completions from this exchange to the target exchange.
|
boolean |
hasOut()
Returns whether an OUT message has been set or not.
|
boolean |
hasProperties()
Returns whether any properties has been set
|
Boolean |
isExternalRedelivered()
Returns true if this exchange is an external initiated redelivered message (such as a JMS broker).
|
boolean |
isFailed()
Returns true if this exchange failed due to either an exception or fault
|
boolean |
isRollbackOnly()
Returns true if this exchange is marked for rollback
|
boolean |
isTransacted()
Returns true if this exchange is transacted
|
Object |
removeProperty(String name)
Removes the given property on the exchange
|
void |
setException(Throwable t)
Sets the exception associated with this exchange
Camel will wrap
Throwable into Exception type to
accommodate for the Exchange.getException() method returning a plain Exception type. |
void |
setExchangeId(String id)
Set the exchange id
|
void |
setFromEndpoint(Endpoint fromEndpoint)
Sets the endpoint which originated this message exchange.
|
void |
setFromRouteId(String fromRouteId)
Sets the route id which originated this message exchange.
|
void |
setIn(Message in)
Sets the inbound message instance
|
void |
setOut(Message out)
Sets the outbound message
|
void |
setPattern(ExchangePattern pattern)
Allows the
ExchangePattern (MEP) of this exchange to be customized. |
void |
setProperties(Map<String,Object> properties) |
void |
setProperty(String name,
Object value)
Sets a property on the exchange
|
void |
setUnitOfWork(UnitOfWork unitOfWork)
Sets the unit of work that this exchange belongs to; which may map to
zero, one or more physical transactions
|
String |
toString() |
protected final CamelContext context
public DefaultExchange(CamelContext context)
public DefaultExchange(CamelContext context, ExchangePattern pattern)
public DefaultExchange(Exchange parent)
public DefaultExchange(Endpoint fromEndpoint)
public DefaultExchange(Endpoint fromEndpoint, ExchangePattern pattern)
public Exchange copy()
Exchangepublic CamelContext getContext()
ExchangegetContext in interface Exchangepublic Object getProperty(String name)
ExchangegetProperty in interface Exchangename - the name of the propertypublic Object getProperty(String name, Object defaultValue)
ExchangegetProperty in interface Exchangename - the name of the propertydefaultValue - the default value to return if property was absentpublic <T> T getProperty(String name, Class<T> type)
ExchangegetProperty in interface Exchangename - the name of the propertytype - the type of the propertypublic <T> T getProperty(String name, Object defaultValue, Class<T> type)
ExchangegetProperty in interface Exchangename - the name of the propertydefaultValue - the default value to return if property was absenttype - the type of the propertypublic void setProperty(String name, Object value)
ExchangesetProperty in interface Exchangename - of the propertyvalue - to associate with the namepublic Object removeProperty(String name)
ExchangeremoveProperty in interface Exchangename - of the propertypublic Map<String,Object> getProperties()
ExchangegetProperties in interface Exchangepublic boolean hasProperties()
ExchangehasProperties in interface Exchangepublic Message getIn()
Exchangepublic <T> T getIn(Class<T> type)
Exchangepublic void setIn(Message in)
Exchangepublic Message getOut()
ExchangeExchange.getIn() instead as it will
ensure headers etc. is kept and propagated when routing continues. Bottom line end users should rarely use
this method.
Exchange.hasOut() method.
See also the class java doc for this Exchange for more details and this
FAQ entry.getOut in interface ExchangeExchange.getIn()public <T> T getOut(Class<T> type)
ExchangeExchange.getIn() instead as it will
ensure headers etc. is kept and propagated when routing continues. Bottom line end users should rarely use
this method.
Exchange.hasOut() method.
See also the class java doc for this Exchange for more details and this
FAQ entry.getOut in interface Exchangetype - the given typeExchange.getIn(Class)public boolean hasOut()
Exchangepublic void setOut(Message out)
Exchangepublic Exception getException()
ExchangegetException in interface Exchangepublic <T> T getException(Class<T> type)
ExchangegetException in interface Exchangetype - the exception typepublic void setException(Throwable t)
ExchangeThrowable into Exception type to
accommodate for the Exchange.getException() method returning a plain Exception type.setException in interface Exchanget - the caused exceptionpublic ExchangePattern getPattern()
ExchangeExchangePattern (MEP) of this exchange.getPattern in interface Exchangepublic void setPattern(ExchangePattern pattern)
ExchangeExchangePattern (MEP) of this exchange to be customized.
This typically won't be required as an exchange can be created with a specific MEP
by calling Endpoint.createExchange(ExchangePattern) but it is here just in case
it is needed.setPattern in interface Exchangepattern - the patternpublic Endpoint getFromEndpoint()
ExchangegetFromEndpoint in interface Exchangepublic void setFromEndpoint(Endpoint fromEndpoint)
ExchangeEndpoint implementationssetFromEndpoint in interface ExchangefromEndpoint - the endpoint which is originating this message exchangepublic String getFromRouteId()
ExchangegetFromRouteId in interface Exchangepublic void setFromRouteId(String fromRouteId)
ExchangesetFromRouteId in interface ExchangefromRouteId - the from route idpublic String getExchangeId()
ExchangegetExchangeId in interface Exchangepublic void setExchangeId(String id)
ExchangesetExchangeId in interface Exchangepublic boolean isFailed()
ExchangeisFailed in interface ExchangeExchange.getException(),
Message.setFault(boolean),
Message.isFault()public boolean isTransacted()
ExchangeisTransacted in interface Exchangepublic Boolean isExternalRedelivered()
ExchangeisExternalRedelivered in interface Exchangepublic boolean isRollbackOnly()
ExchangeisRollbackOnly in interface Exchangepublic UnitOfWork getUnitOfWork()
ExchangegetUnitOfWork in interface Exchangepublic void setUnitOfWork(UnitOfWork unitOfWork)
ExchangesetUnitOfWork in interface Exchangepublic void addOnCompletion(Synchronization onCompletion)
ExchangeSynchronization to be invoked as callback when
this exchange is completed.addOnCompletion in interface ExchangeonCompletion - the callback to invoke on completion of this exchangepublic boolean containsOnCompletion(Synchronization onCompletion)
ExchangeSynchronization instance is
already contained on this exchange.containsOnCompletion in interface ExchangeonCompletion - the callback instance that is being checked forpublic void handoverCompletions(Exchange target)
ExchangehandoverCompletions in interface Exchangetarget - the target exchangepublic List<Synchronization> handoverCompletions()
ExchangehandoverCompletions in interface Exchangeprotected void configureMessage(Message message)
protected String createExchangeId()
Apache Camel