|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.impl.DefaultExchange
public final class DefaultExchange
A default implementation of Exchange
Field Summary | |
---|---|
protected CamelContext |
context
|
Constructor Summary | |
---|---|
DefaultExchange(CamelContext context)
|
|
DefaultExchange(CamelContext context,
ExchangePattern pattern)
|
|
DefaultExchange(Endpoint fromEndpoint)
|
|
DefaultExchange(Endpoint fromEndpoint,
ExchangePattern pattern)
|
|
DefaultExchange(Exchange parent)
|
Method Summary | ||
---|---|---|
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 |
|
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 |
|
|
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 |
|
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. |
|
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 |
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(Exception exception)
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 |
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()
|
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 Object
public Exchange copy()
Exchange
copy
in interface Exchange
public CamelContext getContext()
Exchange
getContext
in interface Exchange
public Object getProperty(String name)
Exchange
getProperty
in interface Exchange
name
- the name of the property
public <T> T getProperty(String name, Class<T> type)
Exchange
getProperty
in interface Exchange
name
- the name of the propertytype
- the type of the property
public void setProperty(String name, Object value)
Exchange
setProperty
in interface Exchange
name
- of the propertyvalue
- to associate with the namepublic Object removeProperty(String name)
Exchange
removeProperty
in interface Exchange
name
- of the property
public Map<String,Object> getProperties()
Exchange
getProperties
in interface Exchange
public boolean hasProperties()
Exchange
hasProperties
in interface Exchange
public void setProperties(Map<String,Object> properties)
public Message getIn()
Exchange
getIn
in interface Exchange
public void setIn(Message in)
Exchange
setIn
in interface Exchange
in
- the inbound messagepublic Message getOut()
Exchange
Exchange.hasOut()
method.
getOut
in interface Exchange
public boolean hasOut()
Exchange
hasOut
in interface Exchange
public void setOut(Message out)
Exchange
setOut
in interface Exchange
out
- the outbound messagepublic Exception getException()
Exchange
getException
in interface Exchange
public <T> T getException(Class<T> type)
Exchange
getException
in interface Exchange
type
- the exception type
public void setException(Exception exception)
Exchange
setException
in interface Exchange
exception
- the caused exceptionpublic ExchangePattern getPattern()
Exchange
ExchangePattern
(MEP) of this exchange.
getPattern
in interface Exchange
public void setPattern(ExchangePattern pattern)
Exchange
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.
setPattern
in interface Exchange
pattern
- the patternpublic Endpoint getFromEndpoint()
Exchange
getFromEndpoint
in interface Exchange
public void setFromEndpoint(Endpoint fromEndpoint)
Exchange
Endpoint
implementations
setFromEndpoint
in interface Exchange
fromEndpoint
- the endpoint which is originating this message exchangepublic String getExchangeId()
Exchange
getExchangeId
in interface Exchange
public void setExchangeId(String id)
Exchange
setExchangeId
in interface Exchange
public boolean isFailed()
Exchange
isFailed
in interface Exchange
Exchange.getException()
,
Exchange#getFault()
public boolean isTransacted()
Exchange
isTransacted
in interface Exchange
public boolean isRollbackOnly()
Exchange
isRollbackOnly
in interface Exchange
public UnitOfWork getUnitOfWork()
Exchange
getUnitOfWork
in interface Exchange
public void setUnitOfWork(UnitOfWork unitOfWork)
Exchange
setUnitOfWork
in interface Exchange
public void addOnCompletion(Synchronization onCompletion)
Exchange
Synchronization
to be invoked as callback when
this exchange is completed.
addOnCompletion
in interface Exchange
onCompletion
- the callback to invoke on completion of this exchangeprotected void configureMessage(Message message)
protected String createExchangeId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |