|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.pageStore.AsynchronousDataStore
public class AsynchronousDataStore
Facade for IDataStore that does the actual saving in worker thread.
Creates an Entry for each triple (sessionId, pageId, data) and puts it in
entries queue if there is room. Acts as producer.
Later PageSavingRunnable reads in blocking manner from entries and saves each
entry. Acts as consumer.
PageSavingRunnable because all we need is to make the page
storing asynchronous. We don't want to write concurrently in the wrapped IDataStore,
though it may happen in the extreme case when the queue is full. These cases should be avoided.
| Constructor Summary | |
|---|---|
AsynchronousDataStore(IDataStore dataStore,
int capacity)
Construct. |
|
| Method Summary | |
|---|---|
void |
destroy()
Properly close the data store and possibly open resource handles |
byte[] |
getData(String sessionId,
int id)
Get data associated with the session id and page id. |
boolean |
isReplicated()
|
void |
removeData(String sessionId)
Remove all page data for the session id |
void |
removeData(String sessionId,
int id)
Remove all persisted data related to the session id and page id |
void |
storeData(String sessionId,
int id,
byte[] data)
Save the entry in the queue if there is a room or directly pass it to the wrapped IDataStore if there is no such |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsynchronousDataStore(IDataStore dataStore,
int capacity)
dataStore - the wrapped IDataStore that actually saved the datacapacity - the capacity of the queue that delays the saving| Method Detail |
|---|
public void destroy()
IDataStore
destroy in interface IDataStoreIDataStore.destroy()
public byte[] getData(String sessionId,
int id)
IDataStore
getData in interface IDataStoresessionId - Session IDid - Page ID
IDataStore.getData(java.lang.String, int)public boolean isReplicated()
isReplicated in interface IDataStoreIDataStore.isReplicated()
public void removeData(String sessionId,
int id)
IDataStore
removeData in interface IDataStoresessionId - Session IDid - Page IDIDataStore.removeData(java.lang.String, int)public void removeData(String sessionId)
IDataStore
removeData in interface IDataStoresessionId - Session IDIDataStore.removeData(java.lang.String)
public void storeData(String sessionId,
int id,
byte[] data)
IDataStore if there is no such
storeData in interface IDataStoresessionId - Session IDid - Page IDdata - Page dataIDataStore.storeData(java.lang.String, int, byte[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||