gr.uoa.di.madgik.grs.store.buffer
Class BufferStoreReader
java.lang.Object
java.lang.Thread
gr.uoa.di.madgik.grs.store.buffer.BufferStoreReader
- All Implemented Interfaces:
- Runnable
public class BufferStoreReader
- extends Thread
This class accesses the content stored through a IBufferStore, restores the incoming and stored Records
and publishes them in a new IBuffer using a RecordWriter whose locator returns to be used by any interested
reader. The demultiplexing procedure is performed based on the multiplexing type that was set in the respective
IBufferStore
- Author:
- gpapanikos
|
Method Summary |
void |
dispose()
Disposes all managed resources |
URI |
populate()
Starts the background execution of the demultiplex procedure and authors the restored Records
using an RecordWriter whose locator is then returned |
void |
run()
|
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, 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 |
BufferStoreReader
public BufferStoreReader(String key,
IWriterProxy proxy)
throws GRS2BufferStoreInvalidOperationException,
GRS2BufferStoreAccessException,
GRS2BufferStoreInvalidArgumentException,
GRS2WriterException
- Creates a new instance
- Parameters:
key - the key with which the IBufferStore that is to be demultiplexed is associatedproxy - the proxy to use for the RecordWriter that will make the restored Records available
- Throws:
GRS2BufferStoreInvalidOperationException - the IBufferStore did not yield any BufferStoreEntry to use
GRS2BufferStoreAccessException - The RecordDefinitions of the Records could not be found
GRS2BufferStoreInvalidArgumentException - No IBufferStore was found
GRS2WriterException - Could nmot initialize and retrieve the locator of the RecordWriter
populate
public URI populate()
throws GRS2WriterException
- Starts the background execution of the demultiplex procedure and authors the restored
Records
using an RecordWriter whose locator is then returned
- Returns:
- the locator to the authored
IBuffer
- Throws:
GRS2WriterException - the state of the demultiplexing procedure does not permit this operation to be completed
dispose
public void dispose()
- Disposes all managed resources
run
public void run()
-
Once the populate() method is invoked, the execution is performed in a background daemon
thread that depending on the IBufferStore.getMultiplexType() value, will forward the execution on the
appropriate IDemultiplex implementation. Depending on the multiplex type defined, the implementations used
are FifoDemultiplex and FirstAvailableDemultiplex
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
- See Also:
Thread.run()
Copyright © 2012. All Rights Reserved.