org.fcrepo.server.journal
Class JournalConsumerThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.fcrepo.server.journal.JournalConsumerThread
All Implemented Interfaces:
Runnable

public class JournalConsumerThread
extends Thread

Process the journal entries as a separate Thread, while the JournalConsumer is blocking all calls from outside.

Author:
Jim Blake

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
JournalConsumerThread(Map<String,String> parameters, String role, ServerInterface server, JournalReader reader, JournalRecoveryLog recoveryLog)
          Store references to all of this stuff, but we can't start work without a ManagementDelegate is provided, and we won't get that until the post-initialization stage.
 
Method Summary
 void run()
          Wait until the server completes its initialization, then process journal entries until the reader says there are no more, or until a shutdown is requested.
 void setManagementDelegate(ManagementDelegate delegate)
          Now that we have a ManagementDelegate to perform the operations, we can start working.
 void shutdown()
          Set the flag saying that it's time to quit.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JournalConsumerThread

public JournalConsumerThread(Map<String,String> parameters,
                             String role,
                             ServerInterface server,
                             JournalReader reader,
                             JournalRecoveryLog recoveryLog)
Store references to all of this stuff, but we can't start work without a ManagementDelegate is provided, and we won't get that until the post-initialization stage.

Method Detail

setManagementDelegate

public void setManagementDelegate(ManagementDelegate delegate)
Now that we have a ManagementDelegate to perform the operations, we can start working.


run

public void run()
Wait until the server completes its initialization, then process journal entries until the reader says there are no more, or until a shutdown is requested.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

shutdown

public void shutdown()
Set the flag saying that it's time to quit.



Copyright © 2011 DuraSpace. All Rights Reserved.