public class SmooksDataFormat extends Object implements org.apache.camel.spi.DataFormat, org.apache.camel.CamelContextAware, org.apache.camel.Service
SmooksComponent
or SmooksProcessor
as they hook
into Camels lifecycle manegment and will close resources correctly.
Constructor and Description |
---|
SmooksDataFormat(String smooksConfig) |
Modifier and Type | Method and Description |
---|---|
org.apache.camel.CamelContext |
getCamelContext() |
protected Object |
getResult(Exports exports,
Result[] results,
org.apache.camel.Exchange exchange) |
void |
marshal(org.apache.camel.Exchange exchange,
Object fromBody,
OutputStream toStream)
Marshals the Object 'fromBody' to an OutputStream 'toStream'
|
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
start() |
void |
stop() |
Object |
unmarshal(org.apache.camel.Exchange exchange,
InputStream fromStream)
Unmarshals the fromStream to an Object.
|
public void marshal(org.apache.camel.Exchange exchange, Object fromBody, OutputStream toStream) throws Exception
MarshalProcessor.process(Exchange)
and it will take care of setting the Out Message's body to the bytes written to the toStream
OutputStream.marshal
in interface org.apache.camel.spi.DataFormat
exchange
- The Camel Exchange
.fromBody
- The object to be marshalled into the output stream.toStream
- The output stream that will be written to.Exception
public Object unmarshal(org.apache.camel.Exchange exchange, InputStream fromStream) throws Exception
UnMarshalProcessor#process(Exchange)
and it will take care of setting the returned Object on the Out Message's body.unmarshal
in interface org.apache.camel.spi.DataFormat
exchange
- The Camel Exchange
.fromStream
- The InputStream that will be unmarshalled into an Object instance.Exception
protected Object getResult(Exports exports, Result[] results, org.apache.camel.Exchange exchange)
public void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext
in interface org.apache.camel.CamelContextAware
public org.apache.camel.CamelContext getCamelContext()
getCamelContext
in interface org.apache.camel.CamelContextAware
public void start() throws Exception
start
in interface org.apache.camel.Service
Exception
Copyright © 2020. All rights reserved.