public class DataRowStore extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
EVENT_BRIDGE_FACTORY_DEFAULT
Deprecated.
since 4.0 does nothing.
|
static String |
EVENT_BRIDGE_FACTORY_PROPERTY
Deprecated.
since 4.0
DataRowStoreFactory establishes EventBridge . |
protected EventManager |
eventManager |
protected EventSubject |
eventSubject |
protected String |
name |
protected boolean |
notifyingRemoteListeners
Deprecated.
since 4.0 does nothing. Previously it used to check if need to create
EventBridge . |
static boolean |
REMOTE_NOTIFICATION_DEFAULT
Deprecated.
|
static String |
REMOTE_NOTIFICATION_PROPERTY
Deprecated.
since 4.0 does nothing. Previously it used to check if need to create
EventBridge . |
protected EventBridge |
remoteNotificationsHandler |
static int |
SNAPSHOT_CACHE_SIZE_DEFAULT |
static String |
SNAPSHOT_CACHE_SIZE_PROPERTY
Deprecated.
since 4.0, use
Constants.SNAPSHOT_CACHE_SIZE_PROPERTY |
static long |
SNAPSHOT_EXPIRATION_DEFAULT |
static String |
SNAPSHOT_EXPIRATION_PROPERTY
Deprecated.
since 4.0, never used actually
|
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) |
boolean |
isNotifyingRemoteListeners()
Deprecated.
|
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 |
setNotifyingRemoteListeners(boolean notifyingRemoteListeners)
Deprecated.
|
void |
shutdown()
Shuts down any remote notification connections, and clears internal cache.
|
int |
size()
Returns current cache size.
|
@Deprecated public static final String SNAPSHOT_EXPIRATION_PROPERTY
@Deprecated public static final String SNAPSHOT_CACHE_SIZE_PROPERTY
Constants.SNAPSHOT_CACHE_SIZE_PROPERTY
@Deprecated public static final String REMOTE_NOTIFICATION_PROPERTY
EventBridge
.@Deprecated public static final String EVENT_BRIDGE_FACTORY_PROPERTY
DataRowStoreFactory
establishes EventBridge
.public static final long SNAPSHOT_EXPIRATION_DEFAULT
public static final int SNAPSHOT_CACHE_SIZE_DEFAULT
@Deprecated public static final boolean REMOTE_NOTIFICATION_DEFAULT
@Deprecated public static final String EVENT_BRIDGE_FACTORY_DEFAULT
protected String name
protected ConcurrentMap<ObjectId,DataRow> snapshots
@Deprecated protected boolean notifyingRemoteListeners
EventBridge
.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)
@Deprecated public boolean isNotifyingRemoteListeners()
@Deprecated public void setNotifyingRemoteListeners(boolean notifyingRemoteListeners)
Copyright © 2001–2017 Apache Cayenne. All rights reserved.