Author: pnedonosko
Date: 2010-02-10 12:19:14 -0500 (Wed, 10 Feb 2010)
New Revision: 1756
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/AbstractSessionLockManager.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/WorkspaceLockManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
Log:
EXOJCR-305 move node lock check to AbstractSessionLockManager, it's base class for
SessionLockManager impls
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-02-10
15:48:06 UTC (rev 1755)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-02-10
17:19:14 UTC (rev 1756)
@@ -1355,7 +1355,8 @@
{
checkValid();
- return isLocked((NodeData)this.getData());
+ //TODO return isLocked((NodeData)this.getData());
+ return session.getLockManager().isLocked((NodeData)this.getData());
}
/**
@@ -1365,6 +1366,7 @@
* @return <code>true</code> if the node is locked,
<code>false</code> otherwise
* @throws RepositoryException if an error occurs
*/
+ // TODO
private boolean isLocked(NodeData data) throws RepositoryException
{
if (dataManager.isNew(data.getIdentifier()))
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java 2010-02-10
15:48:06 UTC (rev 1755)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java 2010-02-10
17:19:14 UTC (rev 1756)
@@ -156,8 +156,6 @@
this.systemLocationFactory =
(LocationFactory)container.getComponentInstanceOfType(LocationFactory.class);
this.accessManager =
(AccessManager)container.getComponentInstanceOfType(AccessManager.class);
- this.lockManager =
-
((WorkspaceLockManager)container.getComponentInstanceOfType(WorkspaceLockManager.class)).getSessionLockManager(id);
WorkspaceEntry wsConfig =
(WorkspaceEntry)container.getComponentInstanceOfType(WorkspaceEntry.class);
this.lazyReadThreshold =
@@ -182,6 +180,10 @@
this.dataManager = new SessionDataManager(this, workspaceDataManager);
+ this.lockManager =
+
((WorkspaceLockManager)container.getComponentInstanceOfType(WorkspaceLockManager.class))
+ .getSessionLockManager(id, dataManager);
+
this.nodeTypeManager =
(NodeTypeDataManager)container.getComponentInstanceOfType(NodeTypeDataManager.class);
this.workspace = new WorkspaceImpl(workspaceName, container, this,
observationManager);
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/AbstractSessionLockManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/AbstractSessionLockManager.java
(rev 0)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/AbstractSessionLockManager.java 2010-02-10
17:19:14 UTC (rev 1756)
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.core.lock;
+
+import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.impl.core.SessionDataManager;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.lock.LockException;
+
+/**
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com">Peter
Nedonosko</a>
+ * @version $Id:AbstractSessionLockManager.java 1111 2010-01-01 00:00:01Z pnedonosko $
+ *
+ */
+public abstract class AbstractSessionLockManager implements SessionLockManager
+{
+
+ protected final SessionDataManager transientManager;
+
+ public AbstractSessionLockManager(SessionDataManager transientManager)
+ {
+ this.transientManager = transientManager;
+ }
+
+ /**
+ * Check if the node locked (and lock peristed in internal storage).
+ * @param node NodeData to check
+ * @return boolean, <code>true</code> if the node is locked,
<code>false</code> otherwise
+ * @throws LockException
+ */
+ protected abstract boolean isLockedPersisted(NodeData node) throws LockException;
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isLocked(NodeData data) throws LockException
+ {
+ if (transientManager.isNew(data.getIdentifier()))
+ {
+ // The node is new, so we will check directly its parent instead
+ try
+ {
+ NodeData parentData =
(NodeData)transientManager.getItemData(data.getParentIdentifier());
+ if (parentData == null)
+ {
+ // The node is the root node and is new, so we consider it as unlocked
+ return false;
+ }
+ else
+ {
+ // the node has a parent that we need to test
+ return isLocked(parentData);
+ }
+ }
+ catch (RepositoryException e)
+ {
+ throw new LockException(e);
+ }
+ }
+ else
+ {
+ // The node already exists so we need to check if it is locked
+ return isLockedPersisted(data);
+ }
+ }
+
+}
Property changes on:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/AbstractSessionLockManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java 2010-02-10
15:48:06 UTC (rev 1755)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java 2010-02-10
17:19:14 UTC (rev 1756)
@@ -41,6 +41,7 @@
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
+import org.exoplatform.services.jcr.impl.core.SessionDataManager;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
import org.exoplatform.services.jcr.impl.dataflow.TransientItemData;
import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
@@ -168,12 +169,6 @@
dataManager.addItemPersistenceListener(this);
}
- /*
- * (non-Javadoc)
- * @see
- *
org.exoplatform.services.jcr.impl.core.lock.LockManager#lockTokenAdded(org.exoplatform.services
- * .jcr.impl.core.SessionImpl, java.lang.String)
- */
public synchronized void addLockToken(String sessionId, String lt)
{
LockData currLock = tokensMap.get(lt);
@@ -183,12 +178,6 @@
}
}
- /*
- * (non-Javadoc)
- * @see
- *
org.exoplatform.services.jcr.impl.core.lock.LockManager#addPendingLock(org.exoplatform.services
- * .jcr.impl.core.NodeImpl, boolean, boolean, long)
- */
public synchronized Lock addPendingLock(NodeImpl node, boolean isDeep, boolean
isSessionScoped, long timeOut)
throws LockException
{
@@ -223,12 +212,6 @@
return lock;
}
- /*
- * (non-Javadoc)
- * @see
- *
org.exoplatform.services.jcr.impl.core.lock.LockManager#getLock(org.exoplatform.services.jcr
- * .impl.core.NodeImpl)
- */
public LockImpl getLock(NodeImpl node) throws LockException, RepositoryException
{
@@ -242,10 +225,6 @@
return new LockImpl(node.getSession(), lData);
}
- /*
- * (non-Javadoc)
- * @see
org.exoplatform.services.jcr.impl.core.lock.LockManager#getLockTokens(java.lang.String)
- */
public synchronized String[] getLockTokens(String sessionID)
{
List<String> retval = new ArrayList<String>();
@@ -259,23 +238,11 @@
return retval.toArray(new String[retval.size()]);
}
- /*
- * (non-Javadoc)
- * @see
- *
org.exoplatform.services.jcr.impl.core.lock.LockManager#holdsLock(org.exoplatform.services.
- * jcr.impl.core.NodeImpl)
- */
public boolean holdsLock(NodeData node) throws RepositoryException
{
return getLockData(node, SEARCH_EXECMATCH) != null;
}
- /*
- * (non-Javadoc)
- * @see
- *
org.exoplatform.services.jcr.impl.core.lock.LockManager#isLocked(org.exoplatform.services.jcr
- * .datamodel.NodeData)
- */
public boolean isLocked(NodeData node)
{
LockData lData = getLockData(node, SEARCH_EXECMATCH | SEARCH_CLOSEDPARENT);
@@ -287,24 +254,12 @@
return true;
}
- /*
- * (non-Javadoc)
- * @see
- *
org.exoplatform.services.jcr.impl.core.lock.LockManager#isLockHolder(org.exoplatform.services
- * .jcr.impl.core.NodeImpl)
- */
public boolean isLockHolder(NodeImpl node) throws RepositoryException
{
LockData lData = getLockData((NodeData)node.getData(), SEARCH_EXECMATCH |
SEARCH_CLOSEDPARENT);
return lData != null && lData.isLockHolder(node.getSession().getId());
}
- /*
- * (non-Javadoc)
- * @see
- *
org.exoplatform.services.jcr.core.SessionLifecycleListener#onCloseSession(org.exoplatform.services
- * .jcr.core.ExtendedSession)
- */
public synchronized void onCloseSession(ExtendedSession session)
{
// List<String> deadLocksList = new ArrayList<String>();
@@ -367,10 +322,8 @@
}
}
- /*
- * (non-Javadoc)
- *
@seeorg.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListener#onSaveItems(org.
- * exoplatform.services.jcr.dataflow.ItemStateChangesLog)
+ /**
+ * {@inheritDoc}
*/
public void onSaveItems(ItemStateChangesLog changesLog)
{
@@ -495,11 +448,9 @@
}
}
- /*
- * (non-Javadoc)
- * @see
- *
org.exoplatform.services.jcr.impl.core.lock.LockManager#lockTokenRemoved(org.exoplatform.services
- * .jcr.impl.core.SessionImpl, java.lang.String)
+ /**
+ * @param sessionId
+ * @param lt
*/
public synchronized void removeLockToken(String sessionId, String lt)
{
@@ -510,9 +461,8 @@
}
}
- /*
- * (non-Javadoc)
- * @see org.picocontainer.Startable#start()
+ /**
+ * {@inheritDoc}
*/
public void start()
{
@@ -526,7 +476,7 @@
}
/**
- * Remove expired locks. Used from LockRemover.
+ * {@inheritDoc}
*/
public synchronized void removeExpired()
{
@@ -546,9 +496,8 @@
}
}
- /*
- * (non-Javadoc)
- * @see org.picocontainer.Startable#stop()
+ /**
+ * {@inheritDoc}
*/
public void stop()
{
@@ -794,11 +743,17 @@
return true;
}
- public SessionLockManager getSessionLockManager(String sessionId)
+ /**
+ * {@inheritDoc}
+ */
+ public SessionLockManager getSessionLockManager(String sessionId, SessionDataManager
transientManager)
{
- return new SessionLockManagerImpl(sessionId, this);
+ return new SessionLockManagerImpl(sessionId, this, transientManager);
}
+ /**
+ * {@inheritDoc}
+ */
public void closeSessionLockManager(String sessionId)
{
//do nothing
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java 2010-02-10
15:48:06 UTC (rev 1755)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java 2010-02-10
17:19:14 UTC (rev 1756)
@@ -19,6 +19,7 @@
import org.exoplatform.services.jcr.core.ExtendedSession;
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
+import org.exoplatform.services.jcr.impl.core.SessionDataManager;
import javax.jcr.RepositoryException;
import javax.jcr.lock.Lock;
@@ -30,9 +31,9 @@
* <br/>Date:
*
* @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
- * @version $Id: SessionLockManagerImpl.java 111 2008-11-11 11:11:11Z serg $
+ * @version $Id$
*/
-public class SessionLockManagerImpl implements SessionLockManager
+public class SessionLockManagerImpl extends AbstractSessionLockManager
{
private final String sessionId;
@@ -42,8 +43,9 @@
/**
* Constructor
*/
- public SessionLockManagerImpl(String sessionId, LockManagerImpl lockManager)
+ public SessionLockManagerImpl(String sessionId, LockManagerImpl lockManager,
SessionDataManager transientManager)
{
+ super(transientManager);
this.sessionId = sessionId;
this.lockManager = lockManager;
}
@@ -100,7 +102,7 @@
/**
* {@inheritDoc}
*/
- public boolean isLocked(NodeData node) throws LockException
+ protected boolean isLockedPersisted(NodeData node) throws LockException
{
return lockManager.isLocked(node);
}
Property changes on:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/WorkspaceLockManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/WorkspaceLockManager.java 2010-02-10
15:48:06 UTC (rev 1755)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/WorkspaceLockManager.java 2010-02-10
17:19:14 UTC (rev 1756)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.services.jcr.impl.core.lock;
+import org.exoplatform.services.jcr.impl.core.SessionDataManager;
+
/**
* @author <a href="mailto:Sergey.Kabashnyuk@gmail.com">Sergey
Kabashnyuk</a>
* @version $Id: LockManager.java 11907 2008-03-13 15:36:21Z ksm $
@@ -32,10 +34,10 @@
/**
* Returns session lock manager that interact with this LockManager.
*
- * @param sessionId - session ID
- * @return new SessionLockManager
+ * @param sessionId String, session ID
+ * @return transientManager SessionLockManager
*/
- SessionLockManager getSessionLockManager(String sessionId);
+ SessionLockManager getSessionLockManager(String sessionId, SessionDataManager
transientManager);
/**
* Release all resources associated with CacheableSessionLockManager.
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java 2010-02-10
15:48:06 UTC (rev 1755)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java 2010-02-10
17:19:14 UTC (rev 1756)
@@ -66,15 +66,6 @@
String getLockTokenHash(String lockToken);
/**
- * Return lock holding node.
- *
- * @param node NodeData
- * @return LockData for node or null;
- * @throws RepositoryException
- */
- //LockData getExactNodeLock(NodeData node) throws RepositoryException;
-
- /**
* Return Lock holding node or its parent.
*
* @param node - NodeData
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2010-02-10
15:48:06 UTC (rev 1755)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2010-02-10
17:19:14 UTC (rev 1756)
@@ -40,6 +40,7 @@
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.core.SessionDataManager;
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;
@@ -466,9 +467,9 @@
/**
* Return new instance of session lock manager.
*/
- public SessionLockManager getSessionLockManager(String sessionId)
+ public SessionLockManager getSessionLockManager(String sessionId, SessionDataManager
transientManager)
{
- CacheableSessionLockManager sessionManager = new
CacheableSessionLockManager(sessionId, this);
+ CacheableSessionLockManager sessionManager = new
CacheableSessionLockManager(sessionId, this, transientManager);
sessionLockManagers.put(sessionId, sessionManager);
return sessionManager;
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java 2010-02-10
15:48:06 UTC (rev 1755)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java 2010-02-10
17:19:14 UTC (rev 1756)
@@ -20,9 +20,10 @@
import org.exoplatform.services.jcr.core.ExtendedSession;
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
+import org.exoplatform.services.jcr.impl.core.SessionDataManager;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
+import org.exoplatform.services.jcr.impl.core.lock.AbstractSessionLockManager;
import org.exoplatform.services.jcr.impl.core.lock.LockImpl;
-import org.exoplatform.services.jcr.impl.core.lock.SessionLockManager;
import org.exoplatform.services.jcr.util.IdGenerator;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -44,9 +45,9 @@
* <br/>Date:
*
* @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
- * @version $Id: SessionLockManager.java 111 2008-11-11 11:11:11Z serg $
+ * @version $Id$
*/
-public class CacheableSessionLockManager implements SessionLockManager
+public class CacheableSessionLockManager extends AbstractSessionLockManager
{
/**
* Logger
@@ -86,8 +87,9 @@
* @param sessionID - session identifier
* @param lockManager - workspace lock manager
*/
- public CacheableSessionLockManager(String sessionID, CacheableLockManager
lockManager)
+ public CacheableSessionLockManager(String sessionID, CacheableLockManager lockManager,
SessionDataManager transientManager)
{
+ super(transientManager);
this.sessionID = sessionID;
this.tokens = new HashMap<String, String>();
this.lockedNodes = new HashMap<String, LockData>();
@@ -183,7 +185,7 @@
/**
* {@inheritDoc}
*/
- public boolean isLocked(NodeData node) throws LockException
+ protected boolean isLockedPersisted(NodeData node) throws LockException
{
LockData lData = null;
try
Property changes on:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java 2010-02-10
15:48:06 UTC (rev 1755)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java 2010-02-10
17:19:14 UTC (rev 1756)
@@ -39,6 +39,7 @@
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.core.SessionDataManager;
import org.exoplatform.services.jcr.impl.core.lock.LockRemover;
import org.exoplatform.services.jcr.impl.core.lock.SessionLockManager;
import org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManager;
@@ -178,7 +179,6 @@
RepositoryException
{
this(dataManager, config, context, (TransactionManager)null, cfm);
-
}
/**
@@ -302,9 +302,9 @@
/**
* Return new instance of session lock manager.
*/
- public SessionLockManager getSessionLockManager(String sessionId)
+ public SessionLockManager getSessionLockManager(String sessionId, SessionDataManager
transientManager)
{
- CacheableSessionLockManager sessionManager = new
CacheableSessionLockManager(sessionId, this);
+ CacheableSessionLockManager sessionManager = new
CacheableSessionLockManager(sessionId, this, transientManager);
sessionLockManagers.put(sessionId, sessionManager);
return sessionManager;
}
@@ -335,10 +335,8 @@
return true;
}
- /*
- * (non-Javadoc)
- *
@seeorg.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListener#onSaveItems(org.
- * exoplatform.services.jcr.dataflow.ItemStateChangesLog)
+ /**
+ * {@inheritDoc}
*/
public void onSaveItems(ItemStateChangesLog changesLog)
{
@@ -594,18 +592,16 @@
}
}
- /*
- * (non-Javadoc)
- * @see org.picocontainer.Startable#start()
+ /**
+ * {@inheritDoc}
*/
public void start()
{
lockRemover = new LockRemover(this);
}
- /*
- * (non-Javadoc)
- * @see org.picocontainer.Startable#stop()
+ /**
+ * {@inheritDoc}
*/
public void stop()
{
@@ -638,7 +634,7 @@
}
/**
- * Internal lock
+ * Internal lock.
*
* @param nodeIdentifier
* @throws LockException
@@ -811,64 +807,6 @@
/**
* {@inheritDoc}
*/
- // public LockData getLockData(NodeData data, int searchType) throws LockException
- // {
- // if (data == null)
- // return null;
- // LockData retval = null;
- // try
- // {
- // if ((searchType & SEARCH_EXECMATCH) != 0)
- // {
- // retval = getLockDataById(data.getIdentifier());
- // }
- // if (retval == null && (searchType & SEARCH_CLOSEDPARENT) != 0)
- // {
- //
- // NodeData parentData =
(NodeData)dataManager.getItemData(data.getParentIdentifier());
- // if (parentData != null)
- // {
- // retval = getLockDataById(parentData.getIdentifier());
- // // parent not found try to fo upper
- // if (retval == null)
- // {
- // retval = getLockData(parentData, SEARCH_CLOSEDPARENT);
- // }
- // }
- // }
- // if (retval == null && (searchType & SEARCH_CLOSEDCHILD) != 0)
- // {
- //
- // List<NodeData> childData = dataManager.getChildNodesData(data);
- // for (NodeData nodeData : childData)
- // {
- // retval = getLockDataById(nodeData.getIdentifier());
- // if (retval != null)
- // break;
- // }
- // if (retval == null)
- // {
- // // child not found try to find diper
- // for (NodeData nodeData : childData)
- // {
- // retval = getLockData(nodeData, SEARCH_CLOSEDCHILD);
- // if (retval != null)
- // break;
- // }
- // }
- // }
- // }
- // catch (RepositoryException e)
- // {
- // throw new LockException(e.getMessage(), e);
- // }
- //
- // return retval;
- // }
-
- /**
- * {@inheritDoc}
- */
public LockData getExactNodeOrCloseParentLock(NodeData node) throws
RepositoryException
{
if (node == null)
@@ -889,19 +827,6 @@
/**
* {@inheritDoc}
*/
- // public LockData getExactNodeLock(NodeData node) throws RepositoryException
- // {
- // LockData retval = null;
- // if (node != null)
- // {
- // retval = getLockDataById(node.getIdentifier());
- // }
- // return retval;
- // }
-
- /**
- * {@inheritDoc}
- */
public LockData getClosedChild(NodeData node) throws RepositoryException
{
LockData retval = null;
Modified:
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2010-02-10
15:48:06 UTC (rev 1755)
+++
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2010-02-10
17:19:14 UTC (rev 1756)
@@ -64,8 +64,7 @@
<property name="restore-path"
value="./sv_export_root.xml" />
<property name="restore-path"
value="./src/test/resources/import-export/restore_db1_ws1.xml" />
</properties>
- </initializer
--->
+ </initializer -->
<cache enabled="true"
class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration"
value="conf/standalone/test-jbosscache-config.xml" />