|
||||||||||
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.
Field Summary | |
---|---|
static String |
AGGREGATED_SIZE
|
static String |
BEAN_HOLDER
|
static String |
BEAN_METHOD_NAME
|
static String |
BEAN_MULTI_PARAMETER_ARRAY
|
static String |
CHARSET_NAME
|
static String |
DATASET_INDEX
|
static String |
EXCEPTION_CAUGHT
|
static String |
EXCEPTION_HANDLED
|
static String |
FAILURE_HANDLED
|
static String |
FILE_BATCH_INDEX
|
static String |
FILE_BATCH_SIZE
|
static String |
FILE_LOCAL_WORK_PATH
|
static String |
FILE_NAME
|
static String |
FILE_NAME_ONLY
|
static String |
FILE_NAME_PRODUCED
|
static String |
LOOP_INDEX
|
static String |
LOOP_SIZE
|
static String |
PROCESSED_SYNC
|
static String |
REDELIVERED
|
static String |
REDELIVERY_COUNTER
|
static String |
SPLIT_INDEX
|
static String |
SPLIT_SIZE
|
static String |
TIMER_FIRED_TIME
|
static String |
TIMER_NAME
|
static String |
TIMER_PERIOD
|
static String |
TIMER_TIME
|
static String |
TRANSACTED
|
Method Summary | ||
---|---|---|
Exchange |
copy()
Creates a copy of the current message exchange so that it can be forwarded to another destination |
|
void |
copyFrom(Exchange source)
Copies the data into this exchange from the given exchange |
|
CamelContext |
getContext()
Returns the container so that a processor can resolve endpoints from URIs |
|
Exception |
getException()
Returns the exception associated with this exchange |
|
String |
getExchangeId()
Returns the exchange id (unique) |
|
Message |
getFault()
Returns the fault message |
|
Message |
getFault(boolean lazyCreate)
Returns the fault message; optionally lazily creating one if one has not been associated with this exchange |
|
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 |
|
Message |
getIn()
Returns the inbound request message |
|
Message |
getOut()
Returns the outbound message, lazily creating one if one has not already been associated with this exchange. |
|
Message |
getOut(boolean lazyCreate)
Returns the outbound message; optionally lazily creating one if one has not been associated with this exchange |
|
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 |
|
UnitOfWork |
getUnitOfWork()
Returns the unit of work that this exchange belongs to; which may map to zero, one or more physical transactions |
|
boolean |
isFailed()
Returns true if this exchange failed due to either an exception or fault |
|
boolean |
isTransacted()
Returns true if this exchange is transacted |
|
Exchange |
newInstance()
Creates a new exchange instance with empty messages, headers and properties |
|
Object |
removeProperty(String name)
Removes the given property on the exchange |
|
void |
setException(Exception e)
Sets the exception associated with this exchange |
|
void |
setExchangeId(String id)
Set the exchange id |
|
void |
setFromEndpoint(Endpoint fromEndpoint)
Sets the endpoint 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 BEAN_METHOD_NAME
static final String BEAN_HOLDER
static final String BEAN_MULTI_PARAMETER_ARRAY
static final String AGGREGATED_SIZE
static final String CHARSET_NAME
static final String DATASET_INDEX
static final String EXCEPTION_CAUGHT
static final String EXCEPTION_HANDLED
static final String FAILURE_HANDLED
static final String FILE_BATCH_INDEX
static final String FILE_BATCH_SIZE
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 LOOP_INDEX
static final String LOOP_SIZE
static final String PROCESSED_SYNC
static final String REDELIVERED
static final String REDELIVERY_COUNTER
static final String SPLIT_INDEX
static final String SPLIT_SIZE
static final String TIMER_NAME
static final String TIMER_FIRED_TIME
static final String TIMER_PERIOD
static final String TIMER_TIME
static final String TRANSACTED
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
<T> T getProperty(String name, Class<T> type)
name
- the name of the propertytype
- 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()
Message getIn()
void setIn(Message in)
in
- the inbound messageMessage getOut()
getOut(boolean)
method passing in false
Message getOut(boolean lazyCreate)
lazyCreate
- true will lazy create the out message
void setOut(Message out)
out
- the outbound messageMessage getFault()
Message getFault(boolean lazyCreate)
lazyCreate
- true will lazy create the fault message
Exception getException()
void setException(Exception e)
e
- the caused exceptionboolean isFailed()
getException()
,
getFault()
boolean isTransacted()
CamelContext getContext()
Exchange newInstance()
Exchange copy()
void copyFrom(Exchange source)
source
- is the source from which headers and messages will be copiedEndpoint getFromEndpoint()
void setFromEndpoint(Endpoint fromEndpoint)
Endpoint
implementations
fromEndpoint
- the endpoint which is originating this message exchangeUnitOfWork getUnitOfWork()
void setUnitOfWork(UnitOfWork unitOfWork)
String getExchangeId()
void setExchangeId(String id)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |