org.apache.axiom.attachments.lifecycle.impl
Class LifecycleManagerImpl

java.lang.Object
  extended by org.apache.axiom.attachments.lifecycle.impl.LifecycleManagerImpl
All Implemented Interfaces:
LifecycleManager

public class LifecycleManagerImpl
extends java.lang.Object
implements LifecycleManager


Nested Class Summary
 class LifecycleManagerImpl.FileDeletor
           
 
Field Summary
private  VMShutdownHook hook
           
private static org.apache.commons.logging.Log log
           
private static java.util.Hashtable table
           
 
Constructor Summary
LifecycleManagerImpl()
           
 
Method Summary
 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.
private  VMShutdownHook RegisterVMShutdownHook()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

table

private static java.util.Hashtable table

hook

private VMShutdownHook hook
Constructor Detail

LifecycleManagerImpl

public LifecycleManagerImpl()
Method Detail

create

public FileAccessor create(java.lang.String attachmentDir)
                    throws java.io.IOException
Description copied from interface: LifecycleManager
Create a unique file in the designated directory

Specified by:
create in interface LifecycleManager
Returns:
Throws:
java.io.IOException

delete

public void delete(java.io.File file)
            throws java.io.IOException
Description copied from interface: LifecycleManager
Deletes attachment file

Specified by:
delete in interface LifecycleManager
Throws:
java.io.IOException

deleteOnExit

public void deleteOnExit(java.io.File file)
                  throws java.io.IOException
Description copied from interface: LifecycleManager
Mark the file for deletion on application/VM exit

Specified by:
deleteOnExit in interface LifecycleManager
Throws:
java.io.IOException

deleteOnTimeInterval

public void deleteOnTimeInterval(int interval,
                                 java.io.File file)
                          throws java.io.IOException
Description copied from interface: LifecycleManager
Mark attachment file for deletion when designated time interval in seconds has elapsed.

Specified by:
deleteOnTimeInterval in interface LifecycleManager
Throws:
java.io.IOException

RegisterVMShutdownHook

private VMShutdownHook RegisterVMShutdownHook()
                                       throws java.lang.RuntimeException
Throws:
java.lang.RuntimeException