org.apache.derby.impl.io
Class DirRandomAccessFile4

java.lang.Object
  extended byjava.io.RandomAccessFile
      extended byorg.apache.derby.impl.io.DirRandomAccessFile
          extended byorg.apache.derby.impl.io.DirRandomAccessFile4
All Implemented Interfaces:
java.io.DataInput, java.io.DataOutput, StorageRandomAccessFile

class DirRandomAccessFile4
extends DirRandomAccessFile

This class provides a disk based implementation of the StIRandomAccess File interface. It is used by the database engine to access persistent data and transaction logs under the directory (default) subsubprotocol. This class extends DirRandomAccessFile to use the java.nio.channels.FileChannel.force() method to implement sync(). Java.nio.channels.FileChannel was introduced in Java 1.4; it was not available in Java 1.3.


Field Summary
 
Fields inherited from class java.io.RandomAccessFile
 
Constructor Summary
(package private) DirRandomAccessFile4(java.io.File name, java.lang.String mode)
          Construct a StorageRandomAccessFileImpl.
 
Method Summary
 void sync(boolean metaData)
          Force any changes out to the persistent store.
 
Methods inherited from class java.io.RandomAccessFile
close, getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.derby.io.StorageRandomAccessFile
close, getFilePointer, length, seek, setLength
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 
Methods inherited from interface java.io.DataOutput
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 

Constructor Detail

DirRandomAccessFile4

DirRandomAccessFile4(java.io.File name,
                     java.lang.String mode)
               throws java.io.FileNotFoundException
Construct a StorageRandomAccessFileImpl.

Parameters:
name - The file name.
mode - The file open mode: "r", "rw", "rws", or "rwd". The "rws" and "rwd" modes specify that the file is to be synchronized, consistent with the java.io.RandomAccessFile class. However the StorageRandomAccessFile.sync() method will be called even if the file was opened in "rws" or "rwd" mode. If the "rws" or "rwd" modes are supported then the implementation of StorageRandomAccessFile.sync need not do anything.
Throws:
java.lang.IllegalArgumentException - if the mode argument is not equal to one of "r", "rw".
java.io.FileNotFoundException - if the file exists but is a directory rather than a regular file, or cannot be opened or created for any other reason .
Method Detail

sync

public void sync(boolean metaData)
          throws java.io.IOException
Force any changes out to the persistent store.

Specified by:
sync in interface StorageRandomAccessFile
Overrides:
sync in class DirRandomAccessFile
Parameters:
metaData - If true then this method is required to force changes to both the file's content and metadata to be written to storage; otherwise, it need only force content changes to be written.
Throws:
java.io.IOException - If an IO error occurs.

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.