public class DefaultExchangeHolder extends Object implements Serializable
File
or WrappedFile
is not supported and a
RuntimeExchangeException
is thrown. marshal(Exchange, boolean)
method. 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,
boolean allowSerializedHeaders)
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,
boolean allowSerializedHeaders)
We only want to store header values of primitive and String related types.
|
static DefaultExchangeHolder |
marshal(org.apache.camel.Exchange exchange)
Creates a payload object with the information from the given exchange.
|
static DefaultExchangeHolder |
marshal(org.apache.camel.Exchange exchange,
boolean includeProperties)
Creates a payload object with the information from the given exchange.
|
static DefaultExchangeHolder |
marshal(org.apache.camel.Exchange exchange,
boolean includeProperties,
boolean allowSerializedHeaders)
Creates a payload object with the information from the given exchange.
|
static DefaultExchangeHolder |
marshal(org.apache.camel.Exchange exchange,
boolean includeProperties,
boolean allowSerializedHeaders,
boolean preserveExchangeId)
Creates a payload object with the information from the given exchange.
|
String |
toString() |
static void |
unmarshal(org.apache.camel.Exchange exchange,
DefaultExchangeHolder payload)
Transfers the information from the payload to the exchange.
|
public static DefaultExchangeHolder marshal(org.apache.camel.Exchange exchange)
exchange
- the exchange, must not be nullpublic static DefaultExchangeHolder marshal(org.apache.camel.Exchange exchange, boolean includeProperties)
exchange
- the exchange, must not be nullincludeProperties
- whether or not to include exchange propertiespublic static DefaultExchangeHolder marshal(org.apache.camel.Exchange exchange, boolean includeProperties, boolean allowSerializedHeaders)
exchange
- the exchange, must not be nullincludeProperties
- whether or not to include exchange propertiesallowSerializedHeaders
- whether or not to include serialized headerspublic static DefaultExchangeHolder marshal(org.apache.camel.Exchange exchange, boolean includeProperties, boolean allowSerializedHeaders, boolean preserveExchangeId)
exchange
- the exchange, must not be nullincludeProperties
- whether or not to include exchange propertiesallowSerializedHeaders
- whether or not to include serialized headerspreserveExchangeId
- whether to preserve exchange idpublic static void unmarshal(org.apache.camel.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, boolean allowSerializedHeaders)
headerName
- the header nameheaderValue
- the header valueallowSerializedHeaders
- the header valueprotected static Object getValidExchangePropertyValue(String propertyName, Object propertyValue, boolean allowSerializedHeaders)
getValidHeaderValue(String, Object, boolean)
and in addition any value of type Throwable
.propertyName
- the property namepropertyValue
- the property valueApache Camel