[
https://jira.jboss.org/jira/browse/DNA-194?page=com.atlassian.jira.plugin...
]
Randall Hauch updated DNA-194:
------------------------------
Attachment: dna-194-session-cache.patch
Uploaded a patch file that captures the refactoring to pull the management of the
session's cached and updated state out of the individual Node and Property
implementations and into a new "SessionCache" class.
This class does a couple of different things. First, it centralizes all of the
information about the nodes and properties that have been loaded from the repository
source, making it easier to track the cached information as well as track/manage the
changes made within the session. Remember that some activities, such as
"refresh" or "save" can be performed on one node but could potentially
affect many other objects. By centralizing all the cached and transient state, it's
much easier to manage all this information. It also makes it much easier to alter the
data structure used to manage the cache (for example to make it thread-safe), should that
be required at a later time.
Second, it manages the Node and Property implementation objects (which can be held onto by
clients), ensuring that the same Node and Property instances are always returned for the
same logical instance. These instances are managed by ReferenceMaps, allowing the garbage
collector to remove entries when clients no longer hold onto the Node and Property objects
(with normal references). The implementation classes of Node and Property (e.g.,
AbstractJcrNode and its concrete subclasses, and AbstractJcrProperty and its concrete
subclasses) no longer directly hold onto the detailed node and property information being
cached in SessionCache, but rather hold identifiers and dynamically look up the
information when necessary. This ensures that a particular Node implementation object
obtained for a node will always present the most up-to-date information about the node,
even if that information is changed by the session or other objects.
(Note that it would be very easy for each Node and Property implementation to locally
cache the reference to the SessionCache's node information and/or property
information, saving some repeated lookups using the SessionCache's methods, but since
the SessionCache knows about the implementations it could invalidate these local
references when needed. This could be done at a later time when we've proven that the
current simple approach needs to be improved.)
Implement update JCR capability
-------------------------------
Key: DNA-194
URL:
https://jira.jboss.org/jira/browse/DNA-194
Project: DNA
Issue Type: Sub-task
Components: JCR
Reporter: Johnny Verhaeg
Assignee: Randall Hauch
Fix For: 0.4
Attachments: dna-194-session-cache.patch, DNA-194_move_value_cast.patch
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira