com.sun.jini.mercury
Class EventWriter

java.lang.Object
  extended by com.sun.jini.mercury.EventWriter

 class EventWriter
extends Object

This class provides the interface for writing RemoteEvents to a given LogOutputStream.

Since:
1.1
Author:
Sun Microsystems, Inc.

Nested Class Summary
private static class EventWriter.EventOutputStream
          This class extends ObjectOutputStream in order to obtain object writing methods.
private static class EventWriter.SwitchOutputStream
          This class is intended to be the OutputStream provided to EventOutputStream's constructor.
 
Field Summary
private  EventWriter.EventOutputStream eout
          Reference to EventOutputStream for this class
private  EventWriter.SwitchOutputStream sout
          Reference to SwitchOutputStream for this class
 
Constructor Summary
EventWriter()
          Simple constructor that creates the appropriate internal objects.
 
Method Summary
 void write(RemoteEvent ev, LogOutputStream out)
          Writes the given RemoteEvent to the provided LogOutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eout

private EventWriter.EventOutputStream eout
Reference to EventOutputStream for this class


sout

private EventWriter.SwitchOutputStream sout
Reference to SwitchOutputStream for this class

Constructor Detail

EventWriter

public EventWriter()
            throws IOException
Simple constructor that creates the appropriate internal objects.

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

write

public void write(RemoteEvent ev,
                  LogOutputStream out)
           throws IOException,
                  SyncFailedException
Writes the given RemoteEvent to the provided LogOutputStream. It also attempts to synchronize the write with the underlying storage mechanism.

Throws:
IOException - Thrown if an I/O error occurs
SyncFailedException - Thrown when the buffers cannot be flushed, or because the system cannot guarantee that all the buffers have been synchronized with physical media.


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