org.entityfs.util.io
Class LockAwareRandomAccessFileFactoryImpl

java.lang.Object
  extended by org.entityfs.util.io.LockAwareRandomAccessFileFactoryImpl
All Implemented Interfaces:
RandomAccessFileFactory

public class LockAwareRandomAccessFileFactoryImpl
extends Object
implements RandomAccessFileFactory

A RandomAccessFileFactory that creates LockAwareRandomAccessFile:s.

Instances of this class should only be used once.

Since:
1.0
Author:
Karl Gustafsson
See Also:
LockAwareFileInputStream

Constructor Summary
LockAwareRandomAccessFileFactoryImpl(EntityLock lock)
           
 
Method Summary
 RandomAccessFile createRandomAccessFile(File f, RandomAccessMode mode)
          Does not unlock the lock in case of errors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockAwareRandomAccessFileFactoryImpl

public LockAwareRandomAccessFileFactoryImpl(EntityLock lock)
Method Detail

createRandomAccessFile

public RandomAccessFile createRandomAccessFile(File f,
                                               RandomAccessMode mode)
                                        throws FileNotFoundException
Does not unlock the lock in case of errors.

Specified by:
createRandomAccessFile in interface RandomAccessFileFactory
Parameters:
f - The file to open.
mode - The file mode.
Returns:
A RandomAccessFile.
Throws:
FileNotFoundException - If the file is not found.