public class DataRowStore extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected EventManager |
eventManager |
protected EventSubject |
eventSubject |
protected String |
name |
protected EventBridge |
remoteNotificationsHandler |
static int |
SNAPSHOT_CACHE_SIZE_DEFAULT |
static long |
SNAPSHOT_EXPIRATION_DEFAULT |
protected ConcurrentMap<ObjectId,DataRow> |
snapshots |
Constructor and Description |
---|
DataRowStore(String name,
RuntimeProperties properties,
EventManager eventManager)
Creates new DataRowStore with a specified name and a set of properties.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Expires and removes all stored snapshots without sending any notification events.
|
void |
forgetSnapshot(ObjectId id)
Evicts a snapshot from cache without generating any SnapshotEvents.
|
DataRow |
getCachedSnapshot(ObjectId oid)
Returns cached snapshot or null if no snapshot is currently cached for the given
ObjectId.
|
protected EventBridge |
getEventBridge() |
EventManager |
getEventManager()
Returns an EventManager associated with this DataRowStore.
|
String |
getName()
Returns the name of this DataRowStore.
|
EventSubject |
getSnapshotEventSubject()
Returns EventSubject used by this SnapshotCache to notify of snapshot changes.
|
protected void |
initWithProperties(RuntimeProperties properties) |
int |
maximumSize()
Returns maximum allowed cache size.
|
void |
processRemoteEvent(SnapshotEvent event)
Handles remote events received via EventBridge.
|
void |
processSnapshotChanges(Object postedBy,
Map<ObjectId,DataRow> updatedSnapshots,
Collection<ObjectId> deletedSnapshotIds,
Collection<ObjectId> invalidatedSnapshotIds,
Collection<ObjectId> indirectlyModifiedIds)
Processes changes made to snapshots.
|
protected void |
setEventBridge(EventBridge eventBridge) |
void |
setEventManager(EventManager eventManager)
Sets an EventManager associated with this DataRowStore.
|
void |
setName(String name)
Sets the name of this DataRowStore.
|
void |
shutdown()
Shuts down any remote notification connections, and clears internal cache.
|
int |
size()
Returns current cache size.
|
public static final long SNAPSHOT_EXPIRATION_DEFAULT
public static final int SNAPSHOT_CACHE_SIZE_DEFAULT
protected String name
protected ConcurrentMap<ObjectId,DataRow> snapshots
protected transient EventManager eventManager
protected transient EventBridge remoteNotificationsHandler
protected transient EventSubject eventSubject
public DataRowStore(String name, RuntimeProperties properties, EventManager eventManager)
name
- DataRowStore name. Used to identify this DataRowStore in events, etc.
Can't be null.properties
- Properties map used to configure DataRowStore parameters. Can be
null.eventManager
- EventManager that should be used for posting and receiving
events.protected void initWithProperties(RuntimeProperties properties)
protected void setEventBridge(EventBridge eventBridge)
protected EventBridge getEventBridge()
public int size()
public int maximumSize()
public void shutdown()
public String getName()
public void setName(String name)
public EventManager getEventManager()
public void setEventManager(EventManager eventManager)
public DataRow getCachedSnapshot(ObjectId oid)
public EventSubject getSnapshotEventSubject()
public void clear()
public void forgetSnapshot(ObjectId id)
public void processRemoteEvent(SnapshotEvent event)
public void processSnapshotChanges(Object postedBy, Map<ObjectId,DataRow> updatedSnapshots, Collection<ObjectId> deletedSnapshotIds, Collection<ObjectId> invalidatedSnapshotIds, Collection<ObjectId> indirectlyModifiedIds)
Copyright © 2001–2019 Apache Cayenne. All rights reserved.