org.fcrepo.server.journal.readerwriter.multicast.rmi
Class RmiTransportWriter

java.lang.Object
  extended by java.io.Writer
      extended by org.fcrepo.server.journal.readerwriter.multicast.rmi.RmiTransportWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class RmiTransportWriter
extends Writer

Title: RmiTransportWriter.java

Description: A writer that passes characters on to an RmiTransportSink. You should wrap this in a BufferedWriter to reduce network traffic to something manageable.

Version:
$Id: RmiTransportWriter.java,v 1.3 2007/06/01 17:21:32 jblake Exp $
Author:
jblake

Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
RmiTransportWriter(RmiJournalReceiverInterface receiver, String repositoryHash, String filename)
          When the writer is created, open the connection to the receiver.
 
Method Summary
 void close()
          Time to close the file? Tell the receiver.
 void flush()
          Flush has no effect.
 void write(char[] cbuf, int off, int len)
          Each time characters are written, send them to the receiver.
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RmiTransportWriter

public RmiTransportWriter(RmiJournalReceiverInterface receiver,
                          String repositoryHash,
                          String filename)
                   throws JournalException
When the writer is created, open the connection to the receiver.

Throws:
JournalException
Method Detail

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException
Each time characters are written, send them to the receiver. Keep track of how many writes, so we can create a proper item hash.

Specified by:
write in class Writer
Throws:
IOException

close

public void close()
           throws IOException
Time to close the file? Tell the receiver.

Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
IOException

flush

public void flush()
           throws IOException
Flush has no effect. Everything is written as it comes in.

Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
IOException


Copyright © 2012 DuraSpace. All Rights Reserved.