com.sun.jini.mercury
Class ControlLog

java.lang.Object
  extended by java.io.RandomAccessFile
      extended by com.sun.jini.mercury.ControlLog
All Implemented Interfaces:
LogStream, Closeable, DataInput, DataOutput

 class ControlLog
extends RandomAccessFile
implements LogStream

Class that implements the interface for a ControlLog. This class extends java.io.RandomAccessFile and relies on LogStream interface for the actual reading/writing of control data. The only added (convenience) method is sync which allows the user to force synchronization with the underlying device.

Since:
1.1
Author:
Sun Microsystems, Inc.

Field Summary
private  StreamKey key
          Key associated with this stream.
 
Constructor Summary
ControlLog(File file, StreamKey key)
          Constructor that takes a File and StreamKey argument.
 
Method Summary
 Object getKey()
          Returns the associated key for this LogStream.
(package private)  void sync()
          Forces system buffers to synchronize with the underlying device.
 
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 com.sun.jini.mercury.LogStream
close
 

Field Detail

key

private final StreamKey key
Key associated with this stream.

Constructor Detail

ControlLog

ControlLog(File file,
           StreamKey key)
     throws IOException
Constructor that takes a File and StreamKey argument. The file argument is passed through to the superclass and is always opened in read/write mode. The key argument is assigned to the appropriate internal field.

Throws:
IOException - if an I/O error occurs
Method Detail

sync

void sync()
    throws IOException,
           SyncFailedException
Forces system buffers to synchronize with the underlying device.

Throws:
IOException - if an I/O error occurs
SyncFailedException - if the buffers cannot be guaranteed to have synchronized with physical media.

getKey

public Object getKey()
Description copied from interface: LogStream
Returns the associated key for this LogStream. This key is intended to be used as the key in a java.util.Collection.

Specified by:
getKey in interface LogStream


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.