Package org.apache.axiom.attachments
Class AttachmentCacheMonitor
java.lang.Object
org.apache.axiom.attachments.AttachmentCacheMonitor
The CacheMonitor is responsible for deleting temporary attachment files
after a timeout period has expired.
The register method is invoked when the attachment file is created.
The access method is invoked whenever the attachment file is accessed.
The checkForAgedFiles method is invoked whenever the monitor should look for
files to cleanup (delete).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Indicates that the file was accessed.void
Check for aged files and remove the aged ones.static AttachmentCacheMonitor
Get or Create an AttachmentCacheMonitor singletonint
void
Register a file name with the monitor.void
setTimeout
(int timeout) This method should Set a new timeout value
-
Field Details
-
ATTACHMENT_TIMEOUT_PROPERTY
- See Also:
-
-
Method Details
-
getAttachmentCacheMonitor
Get or Create an AttachmentCacheMonitor singleton- Returns:
- the singleton instance
-
getTimeout
public int getTimeout()- Returns:
- timeout value in seconds
-
setTimeout
public void setTimeout(int timeout) This method should Set a new timeout value- Parameters:
timeout
- new timeout value in seconds
-
register
Register a file name with the monitor. This will allow the Monitor to remove the file after the timeout period.- Parameters:
fileName
-
-
access
Indicates that the file was accessed.- Parameters:
fileName
-
-
checkForAgedFiles
public void checkForAgedFiles()Check for aged files and remove the aged ones.
-