fedora.server.journal.entry
Class CreatorJournalEntry

java.lang.Object
  extended by fedora.server.journal.entry.JournalEntry
      extended by fedora.server.journal.entry.CreatorJournalEntry

public class CreatorJournalEntry
extends JournalEntry

Title: CreatorJournalEntry.java

Description: The JournalEntry to use when creating a journal file. When invoking the management method, take a moment to write to the journal before returning.

Version:
$Id: CreatorJournalEntry.java 6758 2008-03-09 19:05:49 +0000 (Sun, 09 Mar 2008) j2blake $
Author:
jblake@cs.cornell.edu

Constructor Summary
CreatorJournalEntry(java.lang.String methodName, Context context)
          Don't store the Context that was given; store a writable version of it.
 
Method Summary
 java.lang.Object invokeAndClose(ManagementDelegate delegate, JournalWriter writer)
          A convenience method that invokes the management method and then closes the JournalEntry, thereby cleaning up any temp files.
 java.lang.Object invokeMethod(ManagementDelegate delegate, JournalWriter writer)
          Process the management method: Check the operating mode - if we are in Read-Only mode, this check will throw an exception. Prepare the writer in case we need to initialize a new file with a repository hash. Invoke the method on the ManagementDelegate. Write the full journal entry, including any context changes from the Management method. These operations occur within a synchronized block.
 
Methods inherited from class fedora.server.journal.entry.JournalEntry
addArgument, addArgument, addArgument, addArgument, close, getArgumentsMap, getBooleanArgument, getContext, getDateArgument, getDSBindingMapArgument, getIntegerArgument, getMethod, getMethodName, getStreamArgument, getStringArgument, getStringArrayArgument, setRecoveryValue, setRecoveryValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreatorJournalEntry

public CreatorJournalEntry(java.lang.String methodName,
                           Context context)
Don't store the Context that was given; store a writable version of it.

Method Detail

invokeMethod

public java.lang.Object invokeMethod(ManagementDelegate delegate,
                                     JournalWriter writer)
                              throws ServerException,
                                     JournalException
Process the management method: These operations occur within a synchronized block. We must be sure that any pending operations are complete before we get the repository hash, so we are confident that the hash accurately reflects the state of the repository. Since all API-M operations go through this synchronized block, we can be confident that the previous one had completed before the current one started.

There might be a way to enforce the synchronization at a lower level, thus increasing throughput, but we haven't explored it yet.

Throws:
ServerException
JournalException

invokeAndClose

public java.lang.Object invokeAndClose(ManagementDelegate delegate,
                                       JournalWriter writer)
                                throws ServerException,
                                       JournalException
A convenience method that invokes the management method and then closes the JournalEntry, thereby cleaning up any temp files.

Throws:
ServerException
JournalException