jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r791830 - in /jackrabbit/branches/1.x: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/
Date Tue, 07 Jul 2009 13:32:50 GMT
Author: jukka
Date: Tue Jul  7 13:32:50 2009
New Revision: 791830

URL: http://svn.apache.org/viewvc?rev=791830&view=rev
Log:
1.x: Merged revision 789257 (JCR-2168)

Modified:
    jackrabbit/branches/1.x/   (props changed)
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/WorkspaceImpl.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XAWorkspace.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java

Propchange: jackrabbit/branches/1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul  7 13:32:50 2009
@@ -1 +1 @@
-/jackrabbit/trunk:770143-773197,773483,773525-773554,773584,773588,773828,773835-775756,775833,775836,775840,775868,775981,775986,776036,776256,776310,776313,776321-776322,776332,776356-776357,776362,776373,776650-776693,776737,776757,776776-776777,777024,777029,777034,777478,777509,777541,777548,777936,778445,778613,778616,778621,778645,778720,778802,779032,779040,779068-779071,779074,779076,779081,779084,779086-779088,779090-779092,779094-779096,779101,779223,779225,779227-779228,779230,779233-779234,779460,779475-779476,779504,779550,779552,779555,779561,779563,779583,779590,779618,779621-779622,779624,779642,779654,779657-779659,779661,779936,780006,780010,780025,780085,780989,780993,781017,781051,781054,781294-781300,781305-781311,781318,781328,781338,781344,781347,781369,781372,781377,781416-781417,781423,782621-782622,782644,782646,782652,782669,782675,782677,782683,782694,782921,782925,782930,782936,783002,783004-783005,783042-783043,783239,783278,783304,783319-78332
 1,783324,783326,783330-783333,783337-783338,783340-783341,783343,783345-783346,783356,783359,783383,783386,783412,783435,783444,783447,783523,783688,783703,783708,783710,783719,783757,783759,783786,783809,784011,784013,784039,784058,784060-784061,784090-784091,784106,784108-784109,784111,784117-784120,784124,784163,784261,784680,784691,784696,784760,784824,785981,786003,786319,786680,787183,787219,787241,787942,787952,787964,787996,788002,788012-788013,788350-788351,788443,788446,788450,789245
+/jackrabbit/trunk:770143-773197,773483,773525-773554,773584,773588,773828,773835-775756,775833,775836,775840,775868,775981,775986,776036,776256,776310,776313,776321-776322,776332,776356-776357,776362,776373,776650-776693,776737,776757,776776-776777,777024,777029,777034,777478,777509,777541,777548,777936,778445,778613,778616,778621,778645,778720,778802,779032,779040,779068-779071,779074,779076,779081,779084,779086-779088,779090-779092,779094-779096,779101,779223,779225,779227-779228,779230,779233-779234,779460,779475-779476,779504,779550,779552,779555,779561,779563,779583,779590,779618,779621-779622,779624,779642,779654,779657-779659,779661,779936,780006,780010,780025,780085,780989,780993,781017,781051,781054,781294-781300,781305-781311,781318,781328,781338,781344,781347,781369,781372,781377,781416-781417,781423,782621-782622,782644,782646,782652,782669,782675,782677,782683,782694,782921,782925,782930,782936,783002,783004-783005,783042-783043,783239,783278,783304,783319-78332
 1,783324,783326,783330-783333,783337-783338,783340-783341,783343,783345-783346,783356,783359,783383,783386,783412,783435,783444,783447,783523,783688,783703,783708,783710,783719,783757,783759,783786,783809,784011,784013,784039,784058,784060-784061,784090-784091,784106,784108-784109,784111,784117-784120,784124,784163,784261,784680,784691,784696,784760,784824,785981,786003,786319,786680,787183,787219,787241,787942,787952,787964,787996,788002,788012-788013,788350-788351,788443,788446,788450,789245,789257

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/WorkspaceImpl.java?rev=791830&r1=791829&r2=791830&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/WorkspaceImpl.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/WorkspaceImpl.java
Tue Jul  7 13:32:50 2009
@@ -1000,7 +1000,7 @@
      * @return local item state manager
      */
     protected LocalItemStateManager createItemStateManager(SharedItemStateManager shared)
{
-        return new LocalItemStateManager(shared, this, rep.getItemStateCacheFactory());
+        return LocalItemStateManager.createInstance(shared, this, rep.getItemStateCacheFactory());
     }
 
     //------------------------------------------< EventStateCollectionFactory >

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XAWorkspace.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XAWorkspace.java?rev=791830&r1=791829&r2=791830&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XAWorkspace.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/XAWorkspace.java
Tue Jul  7 13:32:50 2009
@@ -45,6 +45,6 @@
      * {@inheritDoc}
      */
     protected LocalItemStateManager createItemStateManager(SharedItemStateManager shared)
{
-        return new XAItemStateManager(shared, this, rep.getItemStateCacheFactory());
+        return XAItemStateManager.createInstance(shared, this, null, rep.getItemStateCacheFactory());
     }
 }

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java?rev=791830&r1=791829&r2=791830&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
Tue Jul  7 13:32:50 2009
@@ -67,13 +67,27 @@
      * @param sharedStateMgr shared state manager
      * @param factory event state collection factory
      */
-    public LocalItemStateManager(SharedItemStateManager sharedStateMgr,
+    protected LocalItemStateManager(SharedItemStateManager sharedStateMgr,
                                  EventStateCollectionFactory factory, ItemStateCacheFactory
cacheFactory) {
         cache = new ItemStateReferenceCache(cacheFactory);
         this.sharedStateMgr = sharedStateMgr;
         this.factory = factory;
+    }
 
-        sharedStateMgr.addListener(this);
+    /**
+     * Creates a new {@code LocalItemStateManager} instance and registers it as an {@link
ItemStateListener}
+     * with the given {@link SharedItemStateManager}. 
+     * 
+     * @param sharedStateMgr the {@link SharedItemStateManager}
+     * @param factory the {@link EventStateCollectionFactory}
+     * @param cacheFactory the {@link ItemStateCacheFactory}
+     * @return a new {@code LocalItemStateManager} instance
+     */
+    public static LocalItemStateManager createInstance(SharedItemStateManager sharedStateMgr,
+            EventStateCollectionFactory factory, ItemStateCacheFactory cacheFactory) {
+        LocalItemStateManager mgr = new LocalItemStateManager(sharedStateMgr, factory, cacheFactory);
+        sharedStateMgr.addListener(mgr);
+        return mgr;
     }
 
     /**

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java?rev=791830&r1=791829&r2=791830&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java
Tue Jul  7 13:32:50 2009
@@ -83,30 +83,39 @@
     private VirtualItemStateProvider virtualProvider;
 
     /**
-     * Creates a new instance of this class.
-     *
-     * @param sharedStateMgr shared state manager
-     * @param factory        event state collection factory
-     */
-    public XAItemStateManager(SharedItemStateManager sharedStateMgr,
-                              EventStateCollectionFactory factory, ItemStateCacheFactory
cacheFactory) {
-        this(sharedStateMgr, factory, DEFAULT_ATTRIBUTE_NAME, cacheFactory);
-    }
-
-    /**
      * Creates a new instance of this class with a custom attribute name.
      *
      * @param sharedStateMgr shared state manager
      * @param factory        event state collection factory
-     * @param attributeName  attribute name
+     * @param attributeName  the attribute name, if {@code null} then a default name is used
      */
-    public XAItemStateManager(SharedItemStateManager sharedStateMgr,
+    private XAItemStateManager(SharedItemStateManager sharedStateMgr,
                               EventStateCollectionFactory factory,
                               String attributeName,
                               ItemStateCacheFactory cacheFactory) {
         super(sharedStateMgr, factory, cacheFactory);
+        if (attributeName != null) {
+            this.attributeName = attributeName;
+        } else {
+            this.attributeName = DEFAULT_ATTRIBUTE_NAME;
+        }
+    }
 
-        this.attributeName = attributeName;
+    /**
+     * Creates a new {@code XAItemStateManager} instance and registers it as an {@link ItemStateListener}
+     * with the given {@link SharedItemStateManager}. 
+     * 
+     * @param sharedStateMgr the {@link SharedItemStateManager}
+     * @param factory the {@link EventStateCollectionFactory}
+     * @param attributeName the attribute name, if {@code null} then a default name is used
+     * @param cacheFactory the {@link ItemStateCacheFactory}
+     * @return a new {@code XAItemStateManager} instance
+     */
+    public static XAItemStateManager createInstance(SharedItemStateManager sharedStateMgr,
+            EventStateCollectionFactory factory, String attributeName, ItemStateCacheFactory
cacheFactory) {
+        XAItemStateManager mgr = new XAItemStateManager(sharedStateMgr, factory, attributeName,
cacheFactory);
+        sharedStateMgr.addListener(mgr);
+        return mgr;
     }
 
     /**

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?rev=791830&r1=791829&r2=791830&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
Tue Jul  7 13:32:50 2009
@@ -159,7 +159,7 @@
             }
             sharedStateMgr = createItemStateManager(pMgr, rootId, ntReg, cacheFactory, ismLocking);
 
-            stateMgr = new LocalItemStateManager(sharedStateMgr, escFactory, cacheFactory);
+            stateMgr = LocalItemStateManager.createInstance(sharedStateMgr, escFactory, cacheFactory);
             stateMgr.addListener(this);
 
             NodeState nodeState = (NodeState) stateMgr.getItemState(rootId);

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java?rev=791830&r1=791829&r2=791830&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java
Tue Jul  7 13:32:50 2009
@@ -106,7 +106,7 @@
         super(ntReg);
         this.vMgr = vMgr;
         this.session = session;
-        this.stateMgr = new XAItemStateManager(vMgr.getSharedStateMgr(),
+        this.stateMgr = XAItemStateManager.createInstance(vMgr.getSharedStateMgr(),
                 this, CHANGE_LOG_ATTRIBUTE_NAME, cacheFactory);
 
         NodeState state;



Mime
View raw message