public final class AttachmentCacheMonitor
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private class |
AttachmentCacheMonitor.CleanupFilesTask |
| Modifier and Type | Field and Description |
|---|---|
private static AttachmentCacheMonitor |
_singleton |
static java.lang.String |
ATTACHMENT_TIMEOUT_PROPERTY |
private int |
attachmentTimeoutSeconds |
private java.util.HashMap |
files |
(package private) static org.apache.commons.logging.Log |
log |
private java.lang.Long |
priorDeleteMillis |
private int |
refreshSeconds |
private java.util.Timer |
timer |
| Modifier | Constructor and Description |
|---|---|
private |
AttachmentCacheMonitor()
Constructor
Intentionally private.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
_access(java.lang.String fileName) |
private void |
_checkForAgedFiles() |
private java.lang.Boolean |
_deleteFile(java.lang.String fileName) |
private void |
_register(java.lang.String fileName) |
void |
access(java.lang.String fileName)
Indicates that the file was accessed.
|
void |
checkForAgedFiles()
Check for aged files and remove the aged ones.
|
private boolean |
deleteFile(java.lang.String fileName) |
static AttachmentCacheMonitor |
getAttachmentCacheMonitor()
Get or Create an AttachmentCacheMonitor singleton
|
private java.lang.Long |
getTime() |
int |
getTimeout() |
private boolean |
isExpired(java.lang.Long oldTimeMillis,
java.lang.Long newTimeMillis,
int thresholdSecs) |
void |
register(java.lang.String fileName)
Register a file name with the monitor.
|
void |
setTimeout(int timeout)
This method should
Set a new timeout value
|
static org.apache.commons.logging.Log log
private int attachmentTimeoutSeconds
private int refreshSeconds
public static final java.lang.String ATTACHMENT_TIMEOUT_PROPERTY
private java.util.HashMap files
private java.lang.Long priorDeleteMillis
private java.util.Timer timer
private static AttachmentCacheMonitor _singleton
private AttachmentCacheMonitor()
getAttachmentCacheMonitorpublic static AttachmentCacheMonitor getAttachmentCacheMonitor()
public int getTimeout()
public void setTimeout(int timeout)
timeout - new timeout value in secondspublic void register(java.lang.String fileName)
fileName - public void access(java.lang.String fileName)
fileName - public void checkForAgedFiles()
private void _register(java.lang.String fileName)
private void _access(java.lang.String fileName)
private void _checkForAgedFiles()
private boolean deleteFile(java.lang.String fileName)
private java.lang.Boolean _deleteFile(java.lang.String fileName)
private java.lang.Long getTime()
private boolean isExpired(java.lang.Long oldTimeMillis,
java.lang.Long newTimeMillis,
int thresholdSecs)