public class DefaultExchangeHolder extends Object implements Serializable
File
or WrappedFile
is not supported and
a RuntimeExchangeException
is thrown.
Constructor and Description |
---|
DefaultExchangeHolder() |
Modifier and Type | Method and Description |
---|---|
static void |
addProperty(DefaultExchangeHolder payload,
String key,
Serializable property)
Adds a property to the payload.
|
protected static Object |
getValidExchangePropertyValue(String propertyName,
Object propertyValue)
We only want to store exchange property values of primitive and String related types, and
as well any caught exception that Camel routing engine has caught.
|
protected static Object |
getValidHeaderValue(String headerName,
Object headerValue)
We only want to store header values of primitive and String related types.
|
static DefaultExchangeHolder |
marshal(Exchange exchange)
Creates a payload object with the information from the given exchange.
|
static DefaultExchangeHolder |
marshal(Exchange exchange,
boolean includeProperties)
Creates a payload object with the information from the given exchange.
|
String |
toString() |
static void |
unmarshal(Exchange exchange,
DefaultExchangeHolder payload)
Transfers the information from the payload to the exchange.
|
public DefaultExchangeHolder()
public static DefaultExchangeHolder marshal(Exchange exchange)
exchange
- the exchange, must not be nullpublic static DefaultExchangeHolder marshal(Exchange exchange, boolean includeProperties)
exchange
- the exchange, must not be nullincludeProperties
- whether or not to include exchange propertiespublic static void unmarshal(Exchange exchange, DefaultExchangeHolder payload)
exchange
- the exchange to set values from the payload, must not be nullpayload
- the payload with the values, must not be nullpublic static void addProperty(DefaultExchangeHolder payload, String key, Serializable property)
payload
- the serialized payloadkey
- the property key to addproperty
- the property value to addprotected static Object getValidHeaderValue(String headerName, Object headerValue)
headerName
- the header nameheaderValue
- the header valueprotected static Object getValidExchangePropertyValue(String propertyName, Object propertyValue)
getValidHeaderValue(String, Object)
and in addition any value of type Throwable
.propertyName
- the property namepropertyValue
- the property valueApache Camel