public class LifecycleManagerImpl extends java.lang.Object implements LifecycleManager
| Modifier and Type | Class and Description |
|---|---|
class |
LifecycleManagerImpl.FileDeletor |
| Modifier and Type | Field and Description |
|---|---|
private VMShutdownHook |
hook |
private static org.apache.commons.logging.Log |
log |
private static java.util.Hashtable |
table |
| Constructor and Description |
|---|
LifecycleManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
FileAccessor |
create(java.lang.String attachmentDir)
Create a unique file in the designated directory
|
void |
delete(java.io.File file)
Deletes attachment file
|
void |
deleteOnExit(java.io.File file)
Mark the file for deletion on application/VM exit
|
void |
deleteOnTimeInterval(int interval,
java.io.File file)
Mark attachment file for deletion when designated time interval in seconds
has elapsed.
|
FileAccessor |
getFileAccessor(java.lang.String fileName)
This method will return the file accessor associated with this file.
|
private VMShutdownHook |
RegisterVMShutdownHook() |
private static final org.apache.commons.logging.Log log
private static java.util.Hashtable table
private VMShutdownHook hook
public FileAccessor create(java.lang.String attachmentDir) throws java.io.IOException
LifecycleManagercreate in interface LifecycleManagerFileAccessor for the file created by this methodjava.io.IOExceptionpublic void delete(java.io.File file)
throws java.io.IOException
LifecycleManagerdelete in interface LifecycleManagerjava.io.IOExceptionpublic void deleteOnExit(java.io.File file)
throws java.io.IOException
LifecycleManagerdeleteOnExit in interface LifecycleManagerjava.io.IOExceptionpublic void deleteOnTimeInterval(int interval,
java.io.File file)
throws java.io.IOException
LifecycleManagerdeleteOnTimeInterval in interface LifecycleManagerjava.io.IOExceptionprivate VMShutdownHook RegisterVMShutdownHook() throws java.lang.RuntimeException
java.lang.RuntimeExceptionpublic FileAccessor getFileAccessor(java.lang.String fileName) throws java.io.IOException
LifecycleManagergetFileAccessor in interface LifecycleManagerFileAccessor object for the given filejava.io.IOException