Package org.apache.axiom.attachments.lifecycle

## Interface LifecycleManager

- All Known Implementing Classes:
    `LifecycleManagerImpl`

      public interface LifecycleManager

  Lifecycle Manager will be used to manage the lifecycle of attachment files. Axiom forks attachment processing based on the size of attachment to be processed. Attachments are either processed by storing them in memory or by storing them in file system based on the size of the attachment file. Lifecycle Manager provides and organized way of managing attachments, by providing calls to create and delete attachments.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `FileAccessor` | `create​(String attachmentDir)` | Create a unique file in the designated directory
    `void` | `delete​(File file)` | Deletes attachment file
    `void` | `deleteOnExit​(File file)` | Mark the file for deletion on application/VM exit
    `void` | `deleteOnTimeInterval​(int interval, File file)` | Mark attachment file for deletion when designated time interval in seconds has elapsed.
    `FileAccessor` | `getFileAccessor​(String file)` | This method will return the file accessor associated with this file.

- - ### Method Detail

    - #### create

          FileAccessor create​(String attachmentDir)
                       throws IOException

      Create a unique file in the designated directory
      Parameters:
        `attachmentDir` -
      Returns:
        the `FileAccessor` for the file created by this method
      Throws:
        `IOException`

    - #### delete

          void delete​(File file)
               throws IOException

      Deletes attachment file
      Parameters:
        `file` -
      Throws:
        `IOException`

    - #### deleteOnExit

          void deleteOnExit​(File file)
                     throws IOException

      Mark the file for deletion on application/VM exit
      Parameters:
        `file` -
      Throws:
        `IOException`

    - #### deleteOnTimeInterval

          void deleteOnTimeInterval​(int interval,
                                    File file)
                             throws IOException

      Mark attachment file for deletion when designated time interval in seconds has elapsed.
      Parameters:
        `interval` -
        `file` -
      Throws:
        `IOException`

    - #### getFileAccessor

          FileAccessor getFileAccessor​(String file)
                                throws IOException

      This method will return the file accessor associated with this file.
      Parameters:
        `file` -
      Returns:
        the `FileAccessor` object for the given file
      Throws:
        `IOException`