org.directwebremoting.impl
Class PurgingDownloadManager

java.lang.Object
  extended by org.directwebremoting.impl.PurgingDownloadManager
All Implemented Interfaces:
DownloadManager
Direct Known Subclasses:
FileStoreDownloadManager, InMemoryDownloadManager

public abstract class PurgingDownloadManager
extends java.lang.Object
implements DownloadManager

A DownloadManager that simply stores downloads in memory until they are requested and then removes them.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Nested Class Summary
 class PurgingDownloadManager.DownloadPurge
          Loop over the known downloads removing the ones that are out of date
 
Constructor Summary
PurgingDownloadManager()
           
 
Method Summary
 java.lang.String addFileTransfer(FileTransfer generator)
          Inject a file into the system for later download.
 void setDownloadHandlerUrl(java.lang.String downloadHandlerUrl)
          The URL part which we attach to the downloads.
 void setIdGenerator(IdGenerator idGenerator)
           
 void setPurgeDownloadsAfter(long purgeDownloadsAfter)
           
 void setScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor executor)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.directwebremoting.extend.DownloadManager
getFileTransfer
 

Constructor Detail

PurgingDownloadManager

public PurgingDownloadManager()
Method Detail

addFileTransfer

public java.lang.String addFileTransfer(FileTransfer generator)
                                 throws java.io.IOException
Description copied from interface: DownloadManager
Inject a file into the system for later download.

Specified by:
addFileTransfer in interface DownloadManager
Parameters:
generator - The representation of the file to inject
Returns:
A URL for how to allow download of this data at a later time
Throws:
java.io.IOException - If there are problems reading from the FileTransfer

setDownloadHandlerUrl

public void setDownloadHandlerUrl(java.lang.String downloadHandlerUrl)
The URL part which we attach to the downloads.

Parameters:
downloadHandlerUrl - The URL for this Handler.

setPurgeDownloadsAfter

public void setPurgeDownloadsAfter(long purgeDownloadsAfter)
Parameters:
purgeDownloadsAfter - the purgeDownloadsAfter to set

setScheduledThreadPoolExecutor

public void setScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor executor)
Parameters:
executor - The DWR provided shutdown system

setIdGenerator

public void setIdGenerator(IdGenerator idGenerator)
Parameters:
idGenerator - The configured ID generator

Copyright 2008