public class CacheBufferStore extends Thread implements IBufferStore
IBufferStore which utilizes FileRecordStore instances to store
the Records accessed through the incoming locatorsThread.State, Thread.UncaughtExceptionHandlerIBufferStore.MultiplexType| Modifier and Type | Field and Description |
|---|---|
static IBufferStore.MultiplexType |
DefaultMultiplexType
The default
IBufferStore.MultiplexType currently set to IBufferStore.MultiplexType.FIFO |
static net.sf.ehcache.CacheManager |
manager |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
CacheBufferStore()
Create new instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
associateStoreReader(BufferStoreReader reader)
Associates a
BufferStoreReader with the IBufferStore that is has been initialized to access. |
void |
dispose()
Disposes all the resources that are internally managed by the
IBufferStore |
ArrayList<BufferStoreEntry> |
getEntries()
Retrieves the
BufferStoreEntrys that represent the status for all incoming locators and their respective
readers and status as well as their persistency location and IRecordStores |
long |
getInactivityTimeout()
The timeout of the inactivity period after which the
IBufferStore is eligible for disposal. |
TimeUnit |
getInactivityTimeUnit()
The time unit used to define the timeout of the inactivity period after which the
IBufferStore is
eligible for disposal. |
String |
getKey()
Retrieves the key by which this
IBufferStore is registered and referenced through a GRSRegistry |
long |
getLastActivityTime()
Retrieves the last activity time over this
IBufferStore |
URI[] |
getLocators()
Retrieves the locators over which the
IBufferStore operates |
Object |
getModificationObject()
Retrieves a synchronization object that can be used in a standard wait / notify block to notify requesters of when
an additional object has been made available in the underlying storage from the input readers
|
IBufferStore.MultiplexType |
getMultiplexType()
Retrieves the
IBufferStore.MultiplexType indicating the way the input locators are used and in which order their data is received |
long |
getReaderTimeout()
Retrieves the timeout that should be used by the readers utilized to access the input locators.
|
TimeUnit |
getReaderTimeoutTimeUnit()
Retrieves the timeout unit that should be used by the readers utilized to access the input locators.
|
void |
initialize()
Make any needed initialization before the
IBufferStore.store() is called to start the storing procedure |
void |
markActivity()
Update the last activity time to the current time
|
void |
run() |
void |
setKey(String key)
Sets the key by which this
IBufferStore is registered and referenced through a GRSRegistry |
void |
setLocators(URI[] locators)
Sets the incoming locators that should be stored
|
void |
setMultiplexType(IBufferStore.MultiplexType multiplex)
Sets the
IBufferStore.MultiplexType indicating the way the input locators are used and in which order their data is received |
void |
setReaderTimeout(long timeout)
Sets the timeout that should be used by the readers utilized to access the input locators.
|
void |
setReaderTimeoutTimeUnit(TimeUnit unit)
Sets the timeout unit that should be used by the readers utilized to access the input locators.
|
void |
store()
Start retrieving data from the input locators and storing them according to the specific
IBufferStore implementation |
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, yieldpublic static final IBufferStore.MultiplexType DefaultMultiplexType
IBufferStore.MultiplexType currently set to IBufferStore.MultiplexType.FIFOpublic static net.sf.ehcache.CacheManager manager
public void associateStoreReader(BufferStoreReader reader)
BufferStoreReader with the IBufferStore that is has been initialized to access. On
disposal of the IBufferStore, the associated BufferStoreReaders are also disposedassociateStoreReader in interface IBufferStorereader - the reader to associateIBufferStore.associateStoreReader(gr.uoa.di.madgik.grs.store.buffer.BufferStoreReader)public void setKey(String key)
IBufferStore is registered and referenced through a GRSRegistrysetKey in interface IBufferStorekey - the keyIBufferStore.setKey(java.lang.String)public String getKey()
IBufferStore is registered and referenced through a GRSRegistrygetKey in interface IBufferStoreIBufferStore.getKey()public Object getModificationObject()
getModificationObject in interface IBufferStoreIBufferStore.getModificationObject()public ArrayList<BufferStoreEntry> getEntries()
BufferStoreEntrys that represent the status for all incoming locators and their respective
readers and status as well as their persistency location and IRecordStoresgetEntries in interface IBufferStoreIBufferStore.getEntries()public IBufferStore.MultiplexType getMultiplexType()
IBufferStore.MultiplexType indicating the way the input locators are used and in which order their data is receivedgetMultiplexType in interface IBufferStoreIBufferStore.getMultiplexType()public void setMultiplexType(IBufferStore.MultiplexType multiplex) throws GRS2BufferStoreInvalidOperationException
IBufferStore.MultiplexType indicating the way the input locators are used and in which order their data is receivedsetMultiplexType in interface IBufferStoremultiplex - the type of multiplexGRS2BufferStoreInvalidOperationExceptionIBufferStore.setMultiplexType(gr.uoa.di.madgik.grs.store.buffer.IBufferStore.MultiplexType)public long getReaderTimeout()
IBufferStore.getReaderTimeoutTimeUnit()getReaderTimeout in interface IBufferStoreIBufferStore.getReaderTimeout()public void setReaderTimeout(long timeout)
IBufferStore.setReaderTimeoutTimeUnit(TimeUnit)setReaderTimeout in interface IBufferStoretimeout - the timeoutIBufferStore.setReaderTimeout(long)public TimeUnit getReaderTimeoutTimeUnit()
IBufferStore.getReaderTimeout()getReaderTimeoutTimeUnit in interface IBufferStoreIBufferStore.getReaderTimeoutTimeUnit()public void setReaderTimeoutTimeUnit(TimeUnit unit)
IBufferStore.setReaderTimeout(long)setReaderTimeoutTimeUnit in interface IBufferStoreunit - the timeout time unitIBufferStore.setReaderTimeoutTimeUnit(java.util.concurrent.TimeUnit)public long getInactivityTimeout()
IBufferStore is eligible for disposal. This
value is to be interpreted in conjunction with the value of IBufferStore.getInactivityTimeUnit()getInactivityTimeout in interface IBufferStoreIBufferStore.getInactivityTimeout()public TimeUnit getInactivityTimeUnit()
IBufferStore is
eligible for disposal. This value is to be interpreted in conjunction with the value of
IBufferStore.getInactivityTimeout()getInactivityTimeUnit in interface IBufferStoreIBufferStore.getInactivityTimeUnit()public URI[] getLocators()
IBufferStore operatesgetLocators in interface IBufferStoreIBufferStore.getLocators()public long getLastActivityTime()
IBufferStoregetLastActivityTime in interface IBufferStoreIBufferStore.getLastActivityTime()public void markActivity()
markActivity in interface IBufferStoreIBufferStore.markActivity()public void setLocators(URI[] locators) throws GRS2BufferStoreInvalidOperationException
setLocators in interface IBufferStorelocators - the locators which data should be storedGRS2BufferStoreInvalidOperationExceptionIBufferStore.setLocators(java.net.URI[])public void initialize()
throws GRS2BufferStoreInvalidOperationException
IBufferStore.store() is called to start the storing procedureinitialize in interface IBufferStoreGRS2BufferStoreInvalidOperationExceptionIBufferStore.initialize()public void store()
IBufferStore implementation
Starts the execution in a daemon background thread
store in interface IBufferStoreIBufferStore.store()public void dispose()
IBufferStoredispose in interface IBufferStoreIBufferStore.dispose()public void run()
In the context of the execution thread initiated by store() procedure, the thread loads in its
thread of execution the defined IMultiplex implementation and forwards the execution to it. The multiplexing
implementations used are FifoMultiplex and FirstAvailableMultiplex depending on the value of
getMultiplexType()
run in interface Runnablerun in class ThreadThread.run()Copyright © 2014. All Rights Reserved.