|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.access.DataRowStore
public class DataRowStore
A fixed size cache of DataRows keyed by ObjectId.
Synchronization Note: DataRowStore synchronizes most operations on its own instance.
Field Summary | |
---|---|
static java.lang.String |
EVENT_BRIDGE_FACTORY_DEFAULT
|
static java.lang.String |
EVENT_BRIDGE_FACTORY_PROPERTY
|
protected EventManager |
eventManager
|
protected EventSubject |
eventSubject
|
protected java.lang.String |
name
|
protected boolean |
notifyingRemoteListeners
|
static boolean |
REMOTE_NOTIFICATION_DEFAULT
|
static java.lang.String |
REMOTE_NOTIFICATION_PROPERTY
|
protected EventBridge |
remoteNotificationsHandler
|
static int |
SNAPSHOT_CACHE_SIZE_DEFAULT
|
static java.lang.String |
SNAPSHOT_CACHE_SIZE_PROPERTY
|
static long |
SNAPSHOT_EXPIRATION_DEFAULT
|
static java.lang.String |
SNAPSHOT_EXPIRATION_PROPERTY
|
protected org.apache.commons.collections.map.LRUMap |
snapshotLists
|
protected org.apache.commons.collections.map.LRUMap |
snapshots
|
Constructor Summary | |
---|---|
DataRowStore(java.lang.String name)
Creates new named DataRowStore with default configuration. |
|
DataRowStore(java.lang.String name,
java.util.Map properties)
Creates new DataRowStore with a specified name and a set of properties. |
|
DataRowStore(java.lang.String name,
java.util.Map properties,
EventManager eventManager)
Creates new DataRowStore with a specified name and a set of properties. |
Method Summary | |
---|---|
void |
cacheSnapshots(java.lang.String key,
java.util.List snapshots)
Registers a list of snapshots with internal cache, using a String key. |
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. |
java.util.List |
getCachedSnapshots(java.lang.String key)
Returns a list of previously cached snapshots. |
EventManager |
getEventManager()
Returns an EventManager associated with this DataRowStore. |
java.lang.String |
getName()
Returns the name of this DataRowStore. |
DataRow |
getSnapshot(ObjectId oid,
QueryEngine engine)
Deprecated. since 1.2 unused, as DataRowStore no longer performs queries on its own. |
EventSubject |
getSnapshotEventSubject()
Returns EventSubject used by this SnapshotCache to notify of snapshot changes. |
protected void |
initWithProperties(java.util.Map properties)
|
boolean |
isNotifyingRemoteListeners()
|
int |
maximumSize()
Returns maximum allowed cache size. |
void |
processRemoteEvent(SnapshotEvent event)
Handles remote events received via EventBridge. |
void |
processSnapshotChanges(java.lang.Object source,
java.util.Map updatedSnapshots,
java.util.Collection deletedSnapshotIds,
java.util.Collection indirectlyModifiedIds)
Deprecated. |
void |
processSnapshotChanges(java.lang.Object postedBy,
java.util.Map updatedSnapshots,
java.util.Collection deletedSnapshotIds,
java.util.Collection invalidatedSnapshotIds,
java.util.Collection indirectlyModifiedIds)
Processes changes made to snapshots. |
void |
setEventManager(EventManager eventManager)
Sets an EventManager associated with this DataRowStore. |
void |
setName(java.lang.String name)
Sets the name of this DataRowStore. |
void |
setNotifyingRemoteListeners(boolean notifyingRemoteListeners)
|
void |
shutdown()
Shuts down any remote notification connections, and clears internal cache. |
int |
size()
Returns current cache size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SNAPSHOT_EXPIRATION_PROPERTY
public static final java.lang.String SNAPSHOT_CACHE_SIZE_PROPERTY
public static final java.lang.String REMOTE_NOTIFICATION_PROPERTY
public static final java.lang.String EVENT_BRIDGE_FACTORY_PROPERTY
public static final long SNAPSHOT_EXPIRATION_DEFAULT
public static final int SNAPSHOT_CACHE_SIZE_DEFAULT
public static final boolean REMOTE_NOTIFICATION_DEFAULT
public static final java.lang.String EVENT_BRIDGE_FACTORY_DEFAULT
protected java.lang.String name
protected org.apache.commons.collections.map.LRUMap snapshots
protected org.apache.commons.collections.map.LRUMap snapshotLists
protected boolean notifyingRemoteListeners
protected transient EventManager eventManager
protected transient EventBridge remoteNotificationsHandler
protected transient EventSubject eventSubject
Constructor Detail |
---|
public DataRowStore(java.lang.String name)
public DataRowStore(java.lang.String name, java.util.Map properties)
name
- DataRowStore name. Used to idenitfy this DataRowStore in events, etc.
Can't be null.properties
- Properties map used to configure DataRowStore parameters. Can be
null.public DataRowStore(java.lang.String name, java.util.Map properties, EventManager eventManager)
name
- DataRowStore name. Used to idenitfy 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.Method Detail |
---|
protected void initWithProperties(java.util.Map properties)
public int size()
public int maximumSize()
public void shutdown()
public java.lang.String getName()
public void setName(java.lang.String name)
public EventManager getEventManager()
public void setEventManager(EventManager eventManager)
public DataRow getCachedSnapshot(ObjectId oid)
public DataRow getSnapshot(ObjectId oid, QueryEngine engine)
public void cacheSnapshots(java.lang.String key, java.util.List snapshots)
public java.util.List getCachedSnapshots(java.lang.String key)
public EventSubject getSnapshotEventSubject()
public void clear()
public void forgetSnapshot(ObjectId id)
public void processRemoteEvent(SnapshotEvent event)
public void processSnapshotChanges(java.lang.Object source, java.util.Map updatedSnapshots, java.util.Collection deletedSnapshotIds, java.util.Collection indirectlyModifiedIds)
public void processSnapshotChanges(java.lang.Object postedBy, java.util.Map updatedSnapshots, java.util.Collection deletedSnapshotIds, java.util.Collection invalidatedSnapshotIds, java.util.Collection indirectlyModifiedIds)
public boolean isNotifyingRemoteListeners()
public void setNotifyingRemoteListeners(boolean notifyingRemoteListeners)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |