org.fcrepo.server.journal.entry
Class CreatorJournalEntry

java.lang.Object
  extended by org.fcrepo.server.journal.entry.JournalEntry
      extended by org.fcrepo.server.journal.entry.CreatorJournalEntry

public class CreatorJournalEntry
extends JournalEntry

The JournalEntry to use when creating a journal file.

When invoking the management method, take a moment to write to the journal before returning.

Author:
Jim Blake

Constructor Summary
CreatorJournalEntry(String methodName, Context context)
          Don't store the Context that was given; store a writable version of it.
 
Method Summary
 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.
 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 org.fcrepo.server.journal.entry.JournalEntry
addArgument, addArgument, addArgument, addArgument, close, getArgumentsMap, getBooleanArgument, getContext, getDateArgument, 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(String methodName,
                           Context context)
Don't store the Context that was given; store a writable version of it.

Method Detail

invokeMethod

public 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 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


Copyright © 2011 DuraSpace. All Rights Reserved.