|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.providers.AbstractMessageAdapter
org.mule.providers.streaming.StreamMessageAdapter
public class StreamMessageAdapter
Provides a generic base class for stream based message flows in Mule. This adapter represents the 3 flows of data that Mule identifies, namely inbound, outbound and response flows. These are represented by three streams on the adapter.
Field Summary | |
---|---|
protected OutputHandler |
handler
|
protected InputStream |
in
|
protected OutputStream |
out
|
Fields inherited from class org.mule.providers.AbstractMessageAdapter |
---|
attachments, DEFAULT_FAILFAST, encoding, exceptionPayload, id, logger, properties, READ, WRITE |
Constructor Summary | |
---|---|
|
StreamMessageAdapter(InputStream in)
|
|
StreamMessageAdapter(InputStream in,
OutputStream out)
|
|
StreamMessageAdapter(InputStream in,
OutputStream out,
OutputHandler handler)
|
|
StreamMessageAdapter(OutputHandler handler)
|
|
StreamMessageAdapter(OutputStream out,
OutputHandler handler)
|
protected |
StreamMessageAdapter(StreamMessageAdapter template)
|
Method Summary | |
---|---|
InputStream |
getInputStream()
Gets the input Stream associated with this event |
OutputHandler |
getOutputHandler()
The Output handler is a callback that will handle the writing to an output Stream when the Stream is available |
OutputStream |
getOutputStream()
Gets the output Stream associated with this event |
Object |
getPayload()
This is an InputStream if triggered from an inbound event or response. |
byte[] |
getPayloadAsBytes()
Converts the message implementation into a String representation |
String |
getPayloadAsString(String encoding)
Converts the message implementation into a String representation |
ThreadSafeAccess |
newThreadCopy()
By default we return "this". |
void |
release()
The release method is called by Mule to notify this adapter that it is no longer needed. |
void |
setOutputHandler(OutputHandler handler)
The Output handler is a callback that will handle the writing to an output Stream when the Stream is available |
void |
write(UMOEvent event)
Writes the event to the current outputStream using the OutputHandler set on the StreamAdapter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected InputStream in
protected OutputStream out
protected OutputHandler handler
Constructor Detail |
---|
public StreamMessageAdapter(InputStream in)
public StreamMessageAdapter(InputStream in, OutputStream out)
public StreamMessageAdapter(OutputHandler handler)
public StreamMessageAdapter(OutputStream out, OutputHandler handler)
public StreamMessageAdapter(InputStream in, OutputStream out, OutputHandler handler)
protected StreamMessageAdapter(StreamMessageAdapter template)
Method Detail |
---|
public String getPayloadAsString(String encoding) throws Exception
getPayloadAsString
in interface UMOMessageAdapter
encoding
- The encoding to use when transforming the message (if
necessary). The parameter is used when converting from a byte array
Exception
- Implementation may throw an endpoint specific exceptionpublic byte[] getPayloadAsBytes() throws Exception
getPayloadAsBytes
in interface UMOMessageAdapter
Exception
- Implemetation may throw an endpoint specific exceptionpublic Object getPayload()
getPayload
in interface UMOMessageAdapter
public InputStream getInputStream()
UMOStreamMessageAdapter
getInputStream
in interface UMOStreamMessageAdapter
public OutputStream getOutputStream()
UMOStreamMessageAdapter
getOutputStream
in interface UMOStreamMessageAdapter
public void write(UMOEvent event) throws IOException
UMOStreamMessageAdapter
write
in interface UMOStreamMessageAdapter
event
- the event to write to the stream
IOException
public OutputHandler getOutputHandler()
UMOStreamMessageAdapter
getOutputHandler
in interface UMOStreamMessageAdapter
public void setOutputHandler(OutputHandler handler)
UMOStreamMessageAdapter
setOutputHandler
in interface UMOStreamMessageAdapter
handler
- the handler used to write to the streampublic void release()
release
in interface UMOStreamMessageAdapter
public ThreadSafeAccess newThreadCopy()
AbstractMessageAdapter
newThreadCopy
in interface ThreadSafeAccess
newThreadCopy
in class AbstractMessageAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |