|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tuscany.sca.core.event.BaseEventPublisher org.apache.tuscany.sca.core.store.MemoryStore
public class MemoryStore
Implements a non-durable, non-transactional store using a simple in-memory map
Field Summary |
---|
Fields inherited from class org.apache.tuscany.sca.core.event.BaseEventPublisher |
---|
listeners, TRUE_FILTER |
Fields inherited from interface org.apache.tuscany.sca.store.Store |
---|
DEFAULT_EXPIRATION_OFFSET, NEVER |
Constructor Summary | |
---|---|
MemoryStore(StoreMonitor monitor)
|
Method Summary | |
---|---|
void |
destroy()
|
long |
getDefaultExpirationOffset()
Returns the maximum default expiration offset for records in the store |
long |
getReaperInterval()
|
void |
init()
|
void |
insertRecord(RuntimeComponent owner,
java.lang.String id,
java.lang.Object object,
long expiration)
Adds the given record to the store. |
java.lang.Object |
readRecord(RuntimeComponent owner,
java.lang.String id)
Returns the deserialized object in the store corresponding to the given id |
void |
recover(RecoveryListener listener)
Initiates a recovery operation, for example during restart after a crash |
void |
removeRecord(RuntimeComponent owner,
java.lang.String id)
Removes a record from the store |
void |
removeRecords()
Removes all records from the store |
void |
setDefaultExpirationOffset(long defaultExpirationOffset)
Sets the maximum default expiration offset for records in the store |
void |
setReaperInterval(long reaperInterval)
Sets the interval for expired entry scanning to be performed |
void |
updateRecord(RuntimeComponent owner,
java.lang.String id,
java.lang.Object object,
long expiration)
Updates a given record in the store, overwriting previous information. |
Methods inherited from class org.apache.tuscany.sca.core.event.BaseEventPublisher |
---|
addListener, addListener, getListeners, publish, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.tuscany.sca.event.EventPublisher |
---|
addListener, addListener, publish, removeListener |
Constructor Detail |
---|
public MemoryStore(StoreMonitor monitor)
Method Detail |
---|
public long getDefaultExpirationOffset()
public void setDefaultExpirationOffset(long defaultExpirationOffset)
public void setReaperInterval(long reaperInterval)
public long getReaperInterval()
public void init()
public void destroy()
public void insertRecord(RuntimeComponent owner, java.lang.String id, java.lang.Object object, long expiration) throws StoreWriteException
Store
insertRecord
in interface Store
owner
- the instance ownerid
- the unique id of the recordobject
- the object representing the data to writeexpiration
- the time in milliseconds when the entry expires
StoreWriteException
- if an error occurs during the write operationpublic void updateRecord(RuntimeComponent owner, java.lang.String id, java.lang.Object object, long expiration) throws StoreWriteException
Store
updateRecord
in interface Store
owner
- the instance ownerid
- the unique id of the recordobject
- the object representing the data to writeexpiration
- the time in milliseconds when the entry expires
StoreWriteException
public java.lang.Object readRecord(RuntimeComponent owner, java.lang.String id)
Store
readRecord
in interface Store
owner
- the instance ownerid
- the unique id of the record
public void removeRecords()
Store
removeRecords
in interface Store
public void removeRecord(RuntimeComponent owner, java.lang.String id) throws StoreWriteException
Store
removeRecord
in interface Store
owner
- the instance ownerid
- the unique id of the record
StoreWriteException
public void recover(RecoveryListener listener)
Store
recover
in interface Store
listener
- the listener to receive recovery callback events
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |