Package org.apache.axiom.attachments

# Class AttachmentCacheMonitor

java.lang.Object
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

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ATTACHMENT_TIMEOUT_PROPERTY`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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 Details

  - ### ATTACHMENT_TIMEOUT_PROPERTY

    public static final String ATTACHMENT_TIMEOUT_PROPERTY
    See Also:
      - Constant Field Values

- ## Method Details

  - ### 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.