com.atlassian.core.spool
Class DeferredSpool

java.lang.Object
  extended bycom.atlassian.core.spool.DeferredSpool
All Implemented Interfaces:
FileSpool, Spool, ThresholdingSpool

public class DeferredSpool
extends java.lang.Object
implements FileSpool, ThresholdingSpool

Thresholding spool that uses a DeferredSpoolFileOutputStream for spooling, allowing for a balance between memory usage and speed.


Constructor Summary
DeferredSpool()
           
 
Method Summary
 FileFactory getFileFactory()
           
protected  DeferredSpoolFileOutputStream getNewDeferredSpoolFileOutputStream()
           
 int getThresholdBytes()
           
 void setFileFactory(FileFactory fileFactory)
           
 void setThresholdBytes(int bytes)
           
 java.io.InputStream spool(java.io.InputStream is)
          Return a new InputStream to the data provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeferredSpool

public DeferredSpool()
Method Detail

getFileFactory

public FileFactory getFileFactory()
Specified by:
getFileFactory in interface FileSpool

setFileFactory

public void setFileFactory(FileFactory fileFactory)
Specified by:
setFileFactory in interface FileSpool

setThresholdBytes

public void setThresholdBytes(int bytes)
Specified by:
setThresholdBytes in interface ThresholdingSpool

getThresholdBytes

public int getThresholdBytes()
Specified by:
getThresholdBytes in interface ThresholdingSpool

spool

public java.io.InputStream spool(java.io.InputStream is)
                          throws java.io.IOException
Description copied from interface: Spool
Return a new InputStream to the data provided. Implementations should guarantee that the returned input stream is independent of the stream passed in. For example, the returned InputStream should still be useable once the original InputStream is closed and its associated resources are released.

Specified by:
spool in interface Spool
Parameters:
is - - Source stream to be spooled
Returns:
Spooled stream
Throws:
java.io.IOException

getNewDeferredSpoolFileOutputStream

protected DeferredSpoolFileOutputStream getNewDeferredSpoolFileOutputStream()
Returns:
a new DeferredSpoolFileOutputStream


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.