|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
gr.uoa.di.madgik.grs.store.buffer.CacheBufferStore
public class CacheBufferStore
Implementation of the IBufferStore
which utilizes FileRecordStore
instances to store
the Record
s accessed through the incoming locators
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Nested classes/interfaces inherited from interface gr.uoa.di.madgik.grs.store.buffer.IBufferStore |
---|
IBufferStore.MultiplexType |
Field Summary | |
---|---|
static IBufferStore.MultiplexType |
DefaultMultiplexType
The default IBufferStore.MultiplexType currently set to IBufferStore.MultiplexType.FIFO |
static CacheManager |
manager
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
CacheBufferStore()
Create new instance |
Method Summary | |
---|---|
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 |
java.util.ArrayList<BufferStoreEntry> |
getEntries()
Retrieves the BufferStoreEntry s that represent the status for all incoming locators and their respective
readers and status as well as their persistency location and IRecordStore s |
long |
getInactivityTimeout()
The timeout of the inactivity period after which the IBufferStore is eligible for disposal. |
java.util.concurrent.TimeUnit |
getInactivityTimeUnit()
The time unit used to define the timeout of the inactivity period after which the IBufferStore is
eligible for disposal. |
java.lang.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 |
java.net.URI[] |
getLocators()
Retrieves the locators over which the IBufferStore operates |
java.lang.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. |
java.util.concurrent.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(java.lang.String key)
Sets the key by which this IBufferStore is registered and referenced through a GRSRegistry |
void |
setLocators(java.net.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(java.util.concurrent.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 |
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 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final IBufferStore.MultiplexType DefaultMultiplexType
IBufferStore.MultiplexType
currently set to IBufferStore.MultiplexType.FIFO
public static CacheManager manager
Constructor Detail |
---|
public CacheBufferStore()
Method Detail |
---|
public void associateStoreReader(BufferStoreReader reader)
BufferStoreReader
with the IBufferStore
that is has been initialized to access. On
disposal of the IBufferStore
, the associated BufferStoreReader
s are also disposed
associateStoreReader
in interface IBufferStore
reader
- the reader to associateIBufferStore.associateStoreReader(gr.uoa.di.madgik.grs.store.buffer.BufferStoreReader)
public void setKey(java.lang.String key)
IBufferStore
is registered and referenced through a GRSRegistry
setKey
in interface IBufferStore
key
- the keyIBufferStore.setKey(java.lang.String)
public java.lang.String getKey()
IBufferStore
is registered and referenced through a GRSRegistry
getKey
in interface IBufferStore
IBufferStore.getKey()
public java.lang.Object getModificationObject()
getModificationObject
in interface IBufferStore
IBufferStore.getModificationObject()
public java.util.ArrayList<BufferStoreEntry> getEntries()
BufferStoreEntry
s that represent the status for all incoming locators and their respective
readers and status as well as their persistency location and IRecordStore
s
getEntries
in interface IBufferStore
IBufferStore.getEntries()
public IBufferStore.MultiplexType getMultiplexType()
IBufferStore.MultiplexType
indicating the way the input locators are used and in which order their data is received
getMultiplexType
in interface IBufferStore
IBufferStore.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 received
setMultiplexType
in interface IBufferStore
multiplex
- the type of multiplex
GRS2BufferStoreInvalidOperationException
IBufferStore.setMultiplexType(gr.uoa.di.madgik.grs.store.buffer.IBufferStore.MultiplexType)
public long getReaderTimeout()
IBufferStore.getReaderTimeoutTimeUnit()
getReaderTimeout
in interface IBufferStore
IBufferStore.getReaderTimeout()
public void setReaderTimeout(long timeout)
IBufferStore.setReaderTimeoutTimeUnit(TimeUnit)
setReaderTimeout
in interface IBufferStore
timeout
- the timeoutIBufferStore.setReaderTimeout(long)
public java.util.concurrent.TimeUnit getReaderTimeoutTimeUnit()
IBufferStore.getReaderTimeout()
getReaderTimeoutTimeUnit
in interface IBufferStore
IBufferStore.getReaderTimeoutTimeUnit()
public void setReaderTimeoutTimeUnit(java.util.concurrent.TimeUnit unit)
IBufferStore.setReaderTimeout(long)
setReaderTimeoutTimeUnit
in interface IBufferStore
unit
- 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 IBufferStore
IBufferStore.getInactivityTimeout()
public java.util.concurrent.TimeUnit getInactivityTimeUnit()
IBufferStore
is
eligible for disposal. This value is to be interpreted in conjunction with the value of
IBufferStore.getInactivityTimeout()
getInactivityTimeUnit
in interface IBufferStore
IBufferStore.getInactivityTimeUnit()
public java.net.URI[] getLocators()
IBufferStore
operates
getLocators
in interface IBufferStore
IBufferStore.getLocators()
public long getLastActivityTime()
IBufferStore
getLastActivityTime
in interface IBufferStore
IBufferStore.getLastActivityTime()
public void markActivity()
markActivity
in interface IBufferStore
IBufferStore.markActivity()
public void setLocators(java.net.URI[] locators) throws GRS2BufferStoreInvalidOperationException
setLocators
in interface IBufferStore
locators
- the locators which data should be stored
GRS2BufferStoreInvalidOperationException
IBufferStore.setLocators(java.net.URI[])
public void initialize() throws GRS2BufferStoreInvalidOperationException
IBufferStore.store()
is called to start the storing procedure
initialize
in interface IBufferStore
GRS2BufferStoreInvalidOperationException
IBufferStore.initialize()
public void store()
IBufferStore
implementation
Starts the execution in a daemon background thread
store
in interface IBufferStore
IBufferStore.store()
public void dispose()
IBufferStore
dispose
in interface IBufferStore
IBufferStore.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 java.lang.Runnable
run
in class java.lang.Thread
Thread.run()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |