|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object akka.camel.internal.CamelExchangeAdapter
public class CamelExchangeAdapter
INTERNAL API
Adapter for converting an org.apache.camel.Exchange
to and from CamelMessage
and akka.camel.Failure
objects.
The org.apache.camel.Message is mutable and not suitable to be used directly as messages between Actors.
This adapter is used to convert to immutable messages to be used with Actors, and convert the immutable messages back
to org.apache.camel.Message when using Camel.
Constructor Summary | |
---|---|
CamelExchangeAdapter(org.apache.camel.Exchange exchange)
|
Method Summary | |
---|---|
org.apache.camel.Exchange |
exchange()
|
java.lang.String |
getExchangeId()
Returns the exchange id |
boolean |
isOutCapable()
Returns if the exchange is out capable. |
void |
setFailure(FailureResult msg)
Sets Exchange.getException from the given FailureResult message. |
void |
setRequest(CamelMessage msg)
Sets Exchange.getIn from the given CamelMessage object. |
void |
setResponse(CamelMessage msg)
Depending on the exchange pattern, sets Exchange.getIn or Exchange.getOut from the given CamelMessage object. |
AkkaCamelException |
toAkkaCamelException()
Creates an AkkaCamelException object from the adapted Exchange. |
AkkaCamelException |
toAkkaCamelException(scala.collection.immutable.Map<java.lang.String,java.lang.Object> headers)
Creates an AkkaCamelException object from the adapted Exchange. |
FailureResult |
toFailureMessage()
Creates an immutable Failure object from the adapted Exchange so it can be used internally between Actors. |
FailureResult |
toFailureResult(scala.collection.immutable.Map<java.lang.String,java.lang.Object> headers)
Creates an immutable FailureResult object from the adapted Exchange so it can be used internally between Actors. |
CamelMessage |
toRequestMessage()
Creates an immutable CamelMessage object from Exchange.getIn so it can be used with Actors. |
CamelMessage |
toRequestMessage(scala.collection.immutable.Map<java.lang.String,java.lang.Object> headers)
Creates an immutable CamelMessage object from Exchange.getIn so it can be used with Actors. |
CamelMessage |
toResponseMessage()
Depending on the exchange pattern, creates an immutable CamelMessage object from Exchange.getIn or Exchange.getOut so it can be used with Actors. |
CamelMessage |
toResponseMessage(scala.collection.immutable.Map<java.lang.String,java.lang.Object> headers)
Depending on the exchange pattern, creates an immutable CamelMessage object from Exchange.getIn or Exchange.getOut so it can be used with Actors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CamelExchangeAdapter(org.apache.camel.Exchange exchange)
Method Detail |
---|
public org.apache.camel.Exchange exchange()
public java.lang.String getExchangeId()
public boolean isOutCapable()
public void setRequest(CamelMessage msg)
msg
- (undocumented)public void setResponse(CamelMessage msg)
msg
- (undocumented)public void setFailure(FailureResult msg)
msg
- (undocumented)public CamelMessage toRequestMessage()
public CamelMessage toResponseMessage()
public AkkaCamelException toAkkaCamelException()
Depending on the exchange pattern, puts the headers from Exchange.getIn or Exchange.getOut on the AkkaCamelException.
If the exchange is out-capable then the headers of Exchange.getOut are used, otherwise the headers of Exchange.getIn are used.
AkkaCamelException
public AkkaCamelException toAkkaCamelException(scala.collection.immutable.Map<java.lang.String,java.lang.Object> headers)
Depending on the exchange pattern, adds the supplied headers and the headers from Exchange.getIn or Exchange.getOut together and passes these to the AkkaCamelException.
If the exchange is out-capable then the headers of Exchange.getOut are used, otherwise the headers of Exchange.getIn are used.
headers
- additional headers to set on the exception in addition to those
in the exchange.
AkkaCamelException
public FailureResult toFailureMessage()
Failure
public FailureResult toFailureResult(scala.collection.immutable.Map<java.lang.String,java.lang.Object> headers)
headers
- additional headers to set on the created CamelMessage in addition to those
in the Camel message.
Failure
public CamelMessage toRequestMessage(scala.collection.immutable.Map<java.lang.String,java.lang.Object> headers)
headers
- additional headers to set on the created CamelMessage in addition to those
in the Camel message.
public CamelMessage toResponseMessage(scala.collection.immutable.Map<java.lang.String,java.lang.Object> headers)
headers
- additional headers to set on the created CamelMessage in addition to those
in the Camel message.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |