org.mule.impl.model.streaming
Class DeferredOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.mule.impl.model.streaming.DeferredOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class DeferredOutputStream
extends OutputStream

This outputStream allows a stream to be choosen after this has been created. It is used by Mule when using streaming to pass to the Streaming component. The actual output stream is choosen at the point where the first byte is written. At this point an outbound router can be chosen and values set on the event context can affect which stream is choosen.


Field Summary
protected  Log logger
           
 
Constructor Summary
DeferredOutputStream(UMOEventContext event)
           
DeferredOutputStream(UMOEventContext event, int buffer)
           
 
Method Summary
 void close()
           
 void flush()
           
 int getBuffer()
           
protected  OutputStream getOutputStream()
           
protected  OutputStream getOutputStreamFromRouter()
           
 void setBuffer(int buffer)
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Log logger
Constructor Detail

DeferredOutputStream

public DeferredOutputStream(UMOEventContext event)

DeferredOutputStream

public DeferredOutputStream(UMOEventContext event,
                            int buffer)
Method Detail

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

getOutputStream

protected OutputStream getOutputStream()
                                throws IOException
Throws:
IOException

getBuffer

public int getBuffer()

setBuffer

public void setBuffer(int buffer)

getOutputStreamFromRouter

protected OutputStream getOutputStreamFromRouter()
                                          throws IOException
Throws:
IOException


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.