Interface LifecycleManager
-
- All Known Implementing Classes:
LifecycleManagerImpl
public interface LifecycleManagerLifecycle 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 FileAccessorcreate(String attachmentDir)Create a unique file in the designated directoryvoiddelete(File file)Deletes attachment filevoiddeleteOnExit(File file)Mark the file for deletion on application/VM exitvoiddeleteOnTimeInterval(int interval, File file)Mark attachment file for deletion when designated time interval in seconds has elapsed.FileAccessorgetFileAccessor(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
FileAccessorfor 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 IOExceptionMark 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
FileAccessorobject for the given file - Throws:
IOException
-
-