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

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.fcrepo.server.journal.readerwriter.multicast.rmi.RmiJournalReceiver
All Implemented Interfaces:
Serializable, Remote, RmiJournalReceiverInterface

public class RmiJournalReceiver
extends UnicastRemoteObject
implements RmiJournalReceiverInterface

A free-standing RMI server that receives journal messages from an RmiTransport and writes them to files in a specified directory.

Note: command-line arguments are specified in RmiJournalReceiverArguments.

Version:
$Id: RmiJournalReceiver.java,v 1.4 2007/06/21 15:59:53 jblake Exp $
Author:
jblake
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface org.fcrepo.server.journal.readerwriter.multicast.rmi.RmiJournalReceiverInterface
RMI_BINDING_NAME
 
Constructor Summary
RmiJournalReceiver(RmiJournalReceiverArguments arguments)
          On creation, parse the arguments.
 
Method Summary
 void closeFile()
          Request to close a file.
 void exportAndBind()
          Create an RMI registry, and bind this object to the expected name.
static void main(String[] args)
          Main routine: create the receiver from the arguments, and bind the receiver in the registry.
 void openFile(String repositoryHash, String filename)
          Request to open a file.
 void writeText(String indexedHash, String text)
          Request to write text to the current journal file.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RmiJournalReceiver

public RmiJournalReceiver(RmiJournalReceiverArguments arguments)
                   throws RemoteException
On creation, parse the arguments.

Throws:
RemoteException
Method Detail

exportAndBind

public void exportAndBind()
                   throws RemoteException,
                          AlreadyBoundException,
                          InterruptedException
Create an RMI registry, and bind this object to the expected name.

Throws:
RemoteException
AlreadyBoundException
InterruptedException

openFile

public void openFile(String repositoryHash,
                     String filename)
              throws JournalException
Request to open a file. Check that:

Specified by:
openFile in interface RmiJournalReceiverInterface
Throws:
JournalException

writeText

public void writeText(String indexedHash,
                      String text)
               throws JournalException
Request to write text to the current journal file. Check that: Increment the itemIndex after a successful write.

Specified by:
writeText in interface RmiJournalReceiverInterface
Throws:
JournalException

closeFile

public void closeFile()
               throws JournalException
Request to close a file. Check that:

Specified by:
closeFile in interface RmiJournalReceiverInterface
Throws:
JournalException

main

public static void main(String[] args)
Main routine: create the receiver from the arguments, and bind the receiver in the registry.



Copyright © 2011 DuraSpace. All Rights Reserved.