org.apache.axiom.attachments
Class AttachmentCacheMonitor

java.lang.Object
  extended by org.apache.axiom.attachments.AttachmentCacheMonitor

public final class AttachmentCacheMonitor
extends Object

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
static String ATTACHMENT_TIMEOUT_PROPERTY
           
 
Method Summary
 void access(String fileName)
          Indicates that the file was accessed.
 void checkForAgedFiles()
          Check for aged files and remove the aged ones.
static AttachmentCacheMonitor getAttachmentCacheMonitor()
          Get or Create an AttachmentCacheMonitor singleton
 int getTimeout()
           
 void register(String fileName)
          Register a file name with the monitor.
 void setTimeout(int timeout)
          This method should Set a new timeout value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTACHMENT_TIMEOUT_PROPERTY

public static final String ATTACHMENT_TIMEOUT_PROPERTY
See Also:
Constant Field Values
Method Detail

getAttachmentCacheMonitor

public static AttachmentCacheMonitor 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

public void register(String fileName)
Register a file name with the monitor. This will allow the Monitor to remove the file after the timeout period.

Parameters:
fileName -

access

public void access(String fileName)
Indicates that the file was accessed.

Parameters:
fileName -

checkForAgedFiles

public void checkForAgedFiles()
Check for aged files and remove the aged ones.



Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.