jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Session-local versioning component?
Date Mon, 11 Sep 2006 08:11:20 GMT

Prompted by the architectural problems Nicolas ran into with restoring
version histories I've recently been looking at the VersionManager
implementation, trying to look for ways to make the design more
flexible for such extensions.

The key problem I've identified is that the VersionManagerImpl uses a
SharedItemStateManager directly for reading and writing versioning
information. This forces the implementation to bend quite a lot for
example to properly implement observation. A good example of this
effect is the DynamicESCFactory class within VersionManagerImpl that
makes all versioning operations synchronized just to enable firing of
correct observation events.

At first I thought that this bending was caused by a problem in the
EventStateCollectionFactory interface, that it shouldn't need a
reference to the source session, but after enough experimenting I
started wondering why we don't have a session-local versioning
component that would make both observation and a number of other
things quite a bit cleaner.

As a background, here's the stack of ItemStateManagers for a normal workspace:

    * SessionItemStateManager: associated with a session, handles the
transient space
    * LocalItemStateManager: associated with a session, handles
observation, etc.
        * XAItemStateManager: subclass of LocaltemStateManager, adds
transaction support
    * SharedItemStateManager: associated with the workspace persistence manager

The versioning implementation works directly on the
"SharedItemStateManager" level. There is no need for the highest level
with versioning since versioning operations are not transient, but
adding a "LocalItemStateManager" level to versioning would likely
simplify the design, and might even remove the need to globally
synchronize versioning operations.

Incidentally, there already is a "XAItemStateManager" level
implemented in the XAVersionManager class, so making this change
shouldn't introduce too big problems.

Any thoughts?


Jukka Zitting

Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

View raw message