|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Exchange
The base message exchange interface providing access to the request, response
and fault Message
instances. Different providers such as JMS, JBI,
CXF and HTTP can provide their own derived API to expose the underlying
transport semantics to avoid the leaky abstractions of generic APIs.
Method Summary | ||
---|---|---|
void |
addOnCompletion(Synchronization onCompletion)
Adds a Synchronization to be invoked as callback when
this exchange is completed. |
|
Exchange |
copy()
Creates a copy of the current message exchange so that it can be forwarded to another destination |
|
CamelContext |
getContext()
Returns the container so that a processor can resolve endpoints from URIs |
|
Exception |
getException()
Returns the exception associated with this exchange |
|
|
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 |
|
|
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. |
|
|
getOut(Class<T> type)
Returns the outbound request message as the given type |
|
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 |
|
|
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 |
|
|
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 |
|
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 |
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 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 |
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 |
Field Detail |
---|
static final String AUTHENTICATION
static final String AUTHENTICATION_FAILURE_POLICY_ID
static final String ACCEPT_CONTENT_TYPE
static final String AGGREGATED_SIZE
static final String AGGREGATED_COMPLETED_BY
static final String AGGREGATED_CORRELATION_KEY
static final String AGGREGATION_STRATEGY
static final String ASYNC_WAIT
static final String BATCH_INDEX
static final String BATCH_SIZE
static final String BATCH_COMPLETE
static final String BEAN_METHOD_NAME
static final String BEAN_MULTI_PARAMETER_ARRAY
static final String BINDING
static final String CHARSET_NAME
static final String CONTENT_ENCODING
static final String CONTENT_TYPE
static final String CORRELATION_ID
static final String DATASET_INDEX
static final String DEFAULT_CHARSET_PROPERTY
static final String DISABLE_HTTP_STREAM_CACHE
static final String EXCEPTION_CAUGHT
static final String ERRORHANDLER_HANDLED
static final String FAILURE_HANDLED
static final String FAILURE_ENDPOINT
static final String FILTER_NON_XML_CHARS
static final String FILE_LOCAL_WORK_PATH
static final String FILE_NAME
static final String FILE_NAME_ONLY
static final String FILE_NAME_PRODUCED
static final String FILE_PATH
static final String FILE_PARENT
static final String FILE_LAST_MODIFIED
static final String GROUPED_EXCHANGE
static final String HTTP_BASE_URI
static final String HTTP_CHARACTER_ENCODING
static final String HTTP_METHOD
static final String HTTP_PATH
static final String HTTP_QUERY
static final String HTTP_RESPONSE_CODE
static final String HTTP_URI
static final String HTTP_URL
static final String HTTP_CHUNKED
static final String HTTP_SERVLET_REQUEST
static final String HTTP_SERVLET_RESPONSE
static final String INTERCEPTED_ENDPOINT
static final String LOG_DEBUG_BODY_MAX_CHARS
static final String LOG_DEBUG_BODY_STREAMS
static final String LOOP_INDEX
static final String LOOP_SIZE
static final String MAXIMUM_CACHE_POOL_SIZE
static final String MULTICAST_INDEX
static final String MULTICAST_COMPLETE
static final String ON_COMPLETION
static final String REDELIVERED
static final String REDELIVERY_COUNTER
static final String REDELIVERY_EXHAUSTED
static final String ROLLBACK_ONLY
static final String ROLLBACK_ONLY_LAST
static final String ROUTE_STOP
static final String SOAP_ACTION
static final String SKIP_GZIP_ENCODING
static final String SPLIT_INDEX
static final String SPLIT_COMPLETE
static final String SPLIT_SIZE
static final String TIMER_FIRED_TIME
static final String TIMER_NAME
static final String TIMER_PERIOD
static final String TIMER_TIME
static final String TO_ENDPOINT
static final String TRACE_EVENT
static final String TRACE_EVENT_NODE_ID
static final String TRACE_EVENT_TIMESTAMP
static final String TRACE_EVENT_EXCHANGE
static final String TRANSFER_ENCODING
static final String XSLT_FILE_NAME
Method Detail |
---|
ExchangePattern getPattern()
ExchangePattern
(MEP) of this exchange.
void setPattern(ExchangePattern pattern)
ExchangePattern
(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.
pattern
- the patternObject getProperty(String name)
name
- the name of the property
Object getProperty(String name, Object defaultValue)
name
- the name of the propertydefaultValue
- the default value to return if property was absent
<T> T getProperty(String name, Class<T> type)
name
- the name of the propertytype
- the type of the property
<T> T getProperty(String name, Object defaultValue, Class<T> type)
name
- the name of the propertydefaultValue
- the default value to return if property was absenttype
- the type of the property
void setProperty(String name, Object value)
name
- of the propertyvalue
- to associate with the nameObject removeProperty(String name)
name
- of the property
Map<String,Object> getProperties()
boolean hasProperties()
Message getIn()
<T> T getIn(Class<T> type)
type
- the given type
void setIn(Message in)
in
- the inbound messageMessage getOut()
hasOut()
method.
<T> T getOut(Class<T> type)
type
- the given type
boolean hasOut()
void setOut(Message out)
out
- the outbound messageException getException()
<T> T getException(Class<T> type)
type
- the exception type
void setException(Throwable t)
Throwable
into Exception
type to
accommodate for the getException()
method returning a plain Exception
type.
t
- the caused exceptionboolean isFailed()
getException()
,
Message.setFault(boolean)
,
Message.isFault()
boolean isTransacted()
boolean isRollbackOnly()
CamelContext getContext()
Exchange copy()
Endpoint getFromEndpoint()
void setFromEndpoint(Endpoint fromEndpoint)
Endpoint
implementations
fromEndpoint
- the endpoint which is originating this message exchangeString getFromRouteId()
void setFromRouteId(String fromRouteId)
fromRouteId
- the from route idUnitOfWork getUnitOfWork()
void setUnitOfWork(UnitOfWork unitOfWork)
String getExchangeId()
void setExchangeId(String id)
void addOnCompletion(Synchronization onCompletion)
Synchronization
to be invoked as callback when
this exchange is completed.
onCompletion
- the callback to invoke on completion of this exchangevoid handoverCompletions(Exchange target)
target
- the target exchange
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |