[exo-jcr-commits] exo-jcr SVN: r1479 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Jan 19 07:56:55 EST 2010
Author: sergiykarpenko
Date: 2010-01-19 07:56:54 -0500 (Tue, 19 Jan 2010)
New Revision: 1479
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java
Log:
EXOJCR-418: InitialContextInitializer recall added
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java 2010-01-19 12:24:19 UTC (rev 1478)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java 2010-01-19 12:56:54 UTC (rev 1479)
@@ -40,7 +40,6 @@
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
import org.exoplatform.services.jcr.impl.core.lock.AbstractLockManager;
-import org.exoplatform.services.jcr.impl.core.lock.LockPersister;
import org.exoplatform.services.jcr.impl.core.lock.LockRemover;
import org.exoplatform.services.jcr.impl.core.lock.SessionLockManager;
import org.exoplatform.services.jcr.impl.dataflow.TransientItemData;
@@ -50,6 +49,7 @@
import org.exoplatform.services.jcr.observation.ExtendedEvent;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.exoplatform.services.naming.InitialContextInitializer;
import org.jboss.cache.Cache;
import org.jboss.cache.CacheFactory;
import org.jboss.cache.DefaultCacheFactory;
@@ -156,19 +156,15 @@
private Map<String, CacheableSessionLockManager> sessionLockManagers;
/**
- * Constructor for workspace without LockPersister
+ * Constructor.
*
- * @param dataManager
- * @param config
+ * @param dataManager - workspace persistent data manager
+ * @param config - workspace entry
+ * @param context InitialContextInitializer, needed to reload context after JBoss cache creation
+ * @throws RepositoryConfigurationException
*/
- public CacheableLockManager(WorkspacePersistentDataManager dataManager, WorkspaceEntry config)
- throws RepositoryConfigurationException
- {
- this(dataManager, config, null);
- }
-
public CacheableLockManager(WorkspacePersistentDataManager dataManager, WorkspaceEntry config,
- LockPersister persister) throws RepositoryConfigurationException
+ InitialContextInitializer context) throws RepositoryConfigurationException
{
List<SimpleParameterEntry> paramenerts = config.getLockManager().getParameters();
@@ -205,6 +201,10 @@
? config.getLockManager().getParameterValue(JBOSSCACCHE_CONFIG) : config.getLockManager()
.getCacheConfig();
CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
+
+ // Context recall is a workaround of JDBCCacheLoader starting.
+ context.recall();
+
cache = factory.createCache(pathToConfig, false);
cache.create();
}
@@ -695,19 +695,19 @@
{
return;
}
-
+
changesLog.add(ItemState.createDeletedState(lockOwner));
ItemData lockIsDeep =
copyItemData((PropertyData)dataManager.getItemData(nData, new QPathEntry(Constants.JCR_LOCKISDEEP, 1)));
-
+
//TODO EXOJCR-412, should be refactored in future.
//Skip removing, because that lock was removed in other node of cluster.
if (lockIsDeep == null)
{
return;
}
-
+
changesLog.add(ItemState.createDeletedState(lockIsDeep));
// lock probably removed by other thread
More information about the exo-jcr-commits
mailing list