|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.DefaultExchange
public class DefaultExchange
A default implementation of Exchange
| Field Summary | |
|---|---|
protected CamelContext |
context
|
| Fields inherited from interface org.apache.camel.Exchange |
|---|
AGGREGATED_SIZE, BEAN_HOLDER, BEAN_METHOD_NAME, BEAN_MULTI_PARAMETER_ARRAY, CHARSET_NAME, DATASET_INDEX, EXCEPTION_CAUGHT, EXCEPTION_HANDLED, FAILURE_HANDLED, FILE_BATCH_INDEX, FILE_BATCH_SIZE, FILE_LOCAL_WORK_PATH, FILE_NAME, FILE_NAME_ONLY, FILE_NAME_PRODUCED, LOOP_INDEX, LOOP_SIZE, PROCESSED_SYNC, REDELIVERED, REDELIVERY_COUNTER, SPLIT_INDEX, SPLIT_SIZE, TIMER_FIRED_TIME, TIMER_NAME, TIMER_PERIOD, TIMER_TIME, TRANSACTED |
| Constructor Summary | |
|---|---|
DefaultExchange(CamelContext context)
|
|
DefaultExchange(CamelContext context,
ExchangePattern pattern)
|
|
DefaultExchange(Endpoint fromEndpoint)
|
|
DefaultExchange(Endpoint fromEndpoint,
ExchangePattern pattern)
|
|
DefaultExchange(Exchange parent)
|
|
| Method Summary | ||
|---|---|---|
protected void |
configureMessage(Message message)
Configures the message after it has been set on the exchange |
|
Exchange |
copy()
Creates a copy of the current message exchange so that it can be forwarded to another destination |
|
void |
copyFrom(Exchange exchange)
Copies the data into this exchange from the given exchange |
|
protected String |
createExchangeId()
|
|
protected Message |
createFaultMessage()
Factory method to lazily create the FAULT message |
|
protected Message |
createInMessage()
Factory method used to lazily create the IN message |
|
protected Message |
createOutMessage()
Factory method to lazily create the OUT message |
|
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 exception)
Sets the exception associated with this exchange |
|
void |
setExchangeId(String id)
Set the exchange id |
|
void |
setFault(Message fault)
|
|
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 |
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 |
|
void |
throwException()
|
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final CamelContext context
| Constructor Detail |
|---|
public DefaultExchange(CamelContext context)
public DefaultExchange(CamelContext context,
ExchangePattern pattern)
public DefaultExchange(Exchange parent)
public DefaultExchange(Endpoint fromEndpoint)
public DefaultExchange(Endpoint fromEndpoint,
ExchangePattern pattern)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic Exchange copy()
Exchange
copy in interface Exchangepublic void copyFrom(Exchange exchange)
Exchange
copyFrom in interface Exchangeexchange - is the source from which headers and messages will be copiedpublic Exchange newInstance()
Exchange
newInstance in interface Exchangepublic CamelContext getContext()
Exchange
getContext in interface Exchangepublic Object getProperty(String name)
Exchange
getProperty in interface Exchangename - the name of the property
public <T> T getProperty(String name,
Class<T> type)
Exchange
getProperty in interface Exchangename - the name of the propertytype - the type of the property
public void setProperty(String name,
Object value)
Exchange
setProperty in interface Exchangename - of the propertyvalue - to associate with the namepublic Object removeProperty(String name)
Exchange
removeProperty in interface Exchangename - of the property
public Map<String,Object> getProperties()
Exchange
getProperties in interface Exchangepublic void setProperties(Map<String,Object> properties)
public Message getIn()
Exchange
getIn in interface Exchangepublic void setIn(Message in)
Exchange
setIn in interface Exchangein - the inbound messagepublic Message getOut()
ExchangeExchange.getOut(boolean)
method passing in false
getOut in interface Exchangepublic Message getOut(boolean lazyCreate)
Exchange
getOut in interface ExchangelazyCreate - true will lazy create the out message
public void setOut(Message out)
Exchange
setOut in interface Exchangeout - the outbound messagepublic Exception getException()
Exchange
getException in interface Exchangepublic void setException(Exception exception)
Exchange
setException in interface Exchangeexception - 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()
Exchange
getFromEndpoint in interface Exchangepublic void setFromEndpoint(Endpoint fromEndpoint)
ExchangeEndpoint implementations
setFromEndpoint in interface ExchangefromEndpoint - the endpoint which is originating this message exchange
public void throwException()
throws Exception
Exceptionpublic Message getFault()
Exchange
getFault in interface Exchangepublic Message getFault(boolean lazyCreate)
Exchange
getFault in interface ExchangelazyCreate - true will lazy create the fault message
public void setFault(Message fault)
public String getExchangeId()
Exchange
getExchangeId in interface Exchangepublic void setExchangeId(String id)
Exchange
setExchangeId in interface Exchangepublic boolean isFailed()
Exchange
isFailed in interface ExchangeExchange.getException(),
Exchange.getFault()public boolean isTransacted()
Exchange
isTransacted in interface Exchangepublic UnitOfWork getUnitOfWork()
Exchange
getUnitOfWork in interface Exchangepublic void setUnitOfWork(UnitOfWork unitOfWork)
Exchange
setUnitOfWork in interface Exchangeprotected Message createInMessage()
protected Message createOutMessage()
protected Message createFaultMessage()
protected void configureMessage(Message message)
protected String createExchangeId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||