Author: bcarothers
Date: 2009-11-25 10:20:46 -0500 (Wed, 25 Nov 2009)
New Revision: 1349
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/LockBranchRequest.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/UnlockBranchRequest.java
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/processor/RequestProcessor.java
trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/WorkspaceLockManager.java
Log:
DNA-457 Add JSR-170 Locking Optional Feature
Removed dangling Javadoc references to RepositorySourceCapabilities.supportsLocks()
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/LockBranchRequest.java
===================================================================
---
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/LockBranchRequest.java 2009-11-25
13:36:11 UTC (rev 1348)
+++
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/LockBranchRequest.java 2009-11-25
15:20:46 UTC (rev 1349)
@@ -27,12 +27,10 @@
import org.jboss.dna.common.util.HashCode;
import org.jboss.dna.graph.GraphI18n;
import org.jboss.dna.graph.Location;
-import org.jboss.dna.graph.connector.RepositorySourceCapabilities;
import org.jboss.dna.graph.property.Path;
/**
- * Instruction to lock an existing node or branch. Connectors that do not support locking
(as defined in
- * {@link RepositorySourceCapabilities#supportsLocks()}) must ignore this request.
+ * Instruction to lock an existing node or branch. Connectors that do not support locking
must ignore this request.
*/
public class LockBranchRequest extends ChangeRequest {
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/UnlockBranchRequest.java
===================================================================
---
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/UnlockBranchRequest.java 2009-11-25
13:36:11 UTC (rev 1348)
+++
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/UnlockBranchRequest.java 2009-11-25
15:20:46 UTC (rev 1349)
@@ -27,12 +27,10 @@
import org.jboss.dna.common.util.HashCode;
import org.jboss.dna.graph.GraphI18n;
import org.jboss.dna.graph.Location;
-import org.jboss.dna.graph.connector.RepositorySourceCapabilities;
import org.jboss.dna.graph.property.Path;
/**
- * Instruction to unlock an existing node or branch. Connectors that do not support
locking (as defined in
- * {@link RepositorySourceCapabilities#supportsLocks()}) must ignore this request.
+ * Instruction to unlock an existing node or branch. Connectors that do not support
locking must ignore this request.
*/
public class UnlockBranchRequest extends ChangeRequest {
Modified:
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/processor/RequestProcessor.java
===================================================================
---
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/processor/RequestProcessor.java 2009-11-25
13:36:11 UTC (rev 1348)
+++
trunk/dna-graph/src/main/java/org/jboss/dna/graph/request/processor/RequestProcessor.java 2009-11-25
15:20:46 UTC (rev 1349)
@@ -856,9 +856,8 @@
/**
* Process a request to lock a node or branch within a workspace
* <p>
- * The default implementation of this method does nothing, as most connectors will
not support locking (as defined in
- * {@link RepositorySourceCapabilities#supportsLocks()}). Any implementation of this
method should do nothing if the request
- * is null.
+ * The default implementation of this method does nothing, as most connectors will
not support locking. Any implementation of
+ * this method should do nothing if the request is null.
* </p>
* <p>
* Implementations that do support locking should throw a {@link LockFailedException}
if the request could not be fulfilled.
@@ -887,9 +886,8 @@
/**
* Process a request to unlock a node or branch within a workspace
* <p>
- * The default implementation of this method does nothing, as most connectors will
not support locking (as defined in
- * {@link RepositorySourceCapabilities#supportsLocks()}). Any implementation of this
method should do nothing if the request
- * is null.
+ * The default implementation of this method does nothing, as most connectors will
not support locking. Any implementation of
+ * this method should do nothing if the request is null.
* </p>
*
* @param request the request
Modified: trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/WorkspaceLockManager.java
===================================================================
--- trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/WorkspaceLockManager.java 2009-11-25
13:36:11 UTC (rev 1348)
+++ trunk/dna-jcr/src/main/java/org/jboss/dna/jcr/WorkspaceLockManager.java 2009-11-25
15:20:46 UTC (rev 1349)
@@ -16,7 +16,6 @@
import org.jboss.dna.graph.Graph;
import org.jboss.dna.graph.Location;
import org.jboss.dna.graph.connector.LockFailedException;
-import org.jboss.dna.graph.connector.RepositorySourceCapabilities;
import org.jboss.dna.graph.property.Path;
import org.jboss.dna.graph.property.PathFactory;
import org.jboss.dna.graph.property.PathNotFoundException;
@@ -133,9 +132,8 @@
* {@link Item#refresh(boolean) item} level.
* <p>
* This method will also attempt to {@link Graph#lock(Location) lock the node in the
underlying repository}. If the underlying
- * repository {@link RepositorySourceCapabilities#supportsLocks() supports locks} and
{@link LockFailedException the lock
- * attempt fails}, this method will cancel the lock attempt by calling {@link
#unlock(DnaLock)} and will throw a {@code
- * RepositoryException}.
+ * repository supports locks and {@link LockFailedException the lock attempt fails},
this method will cancel the lock attempt
+ * by calling {@link #unlock(DnaLock)} and will throw a {@code RepositoryException}.
* </p>
* <p>
* This method does not modify the system graph. In other words, it will not create
the record for the lock in the {@code
@@ -243,9 +241,8 @@
ValueFactory<Boolean> booleanFactory =
context.getValueFactories().getBooleanFactory();
PathFactory pathFactory = context.getValueFactories().getPathFactory();
- org.jboss.dna.graph.Node lockNode = repository.createSystemGraph()
-
.getNodeAt(pathFactory.create(locksPath,
-
pathFactory.createSegment(lockToken)));
+ org.jboss.dna.graph.Node lockNode =
repository.createSystemGraph().getNodeAt(pathFactory.create(locksPath,
+
pathFactory.createSegment(lockToken)));
return
booleanFactory.create(lockNode.getProperty(DnaLexicon.IS_HELD_BY_SESSION).getFirstValue());
@@ -266,9 +263,8 @@
PropertyFactory propFactory = context.getPropertyFactory();
PathFactory pathFactory = context.getValueFactories().getPathFactory();
- repository.createSystemGraph()
- .set(propFactory.create(DnaLexicon.IS_HELD_BY_SESSION, value))
- .on(pathFactory.create(locksPath,
pathFactory.createSegment(lockToken)));
+
repository.createSystemGraph().set(propFactory.create(DnaLexicon.IS_HELD_BY_SESSION,
value)).on(pathFactory.create(locksPath,
+
pathFactory.createSegment(lockToken)));
}
/**
Show replies by date