You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by oz...@apache.org on 2004/10/26 22:34:48 UTC

cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/method MkworkspaceMethod.java UpdateMethod.java BindMethod.java AbstractWebdavMethod.java LabelMethod.java UnbindMethod.java RebindMethod.java

ozeigermann    2004/10/26 13:34:48

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        MkworkspaceMethod.java UpdateMethod.java
                        BindMethod.java AbstractWebdavMethod.java
                        LabelMethod.java UnbindMethod.java
                        RebindMethod.java
  Log:
  Added fine grained locking as global write locks as accuracy is
  more important than concurrency
  
  TODO:
  - find a less strict locking which still is accurate
  
  Revision  Changes    Path
  1.14      +12 -4     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MkworkspaceMethod.java
  
  Index: MkworkspaceMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MkworkspaceMethod.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- MkworkspaceMethod.java	5 Aug 2004 14:43:29 -0000	1.13
  +++ MkworkspaceMethod.java	26 Oct 2004 20:34:47 -0000	1.14
  @@ -40,7 +40,7 @@
    *
    */
   public class MkworkspaceMethod extends AbstractWebdavMethod
  -implements DeltavConstants, WriteMethod {
  +implements DeltavConstants, WriteMethod, FineGrainedLockingMethod {
       
       /**
        * Resource to be created.
  @@ -62,6 +62,14 @@
           super(token, config);
       }
       
  +    /**
  +     * @see org.apache.slide.webdav.method.FineGrainedLockingMethod#acquireFineGrainLocks()
  +     */
  +    public void acquireFineGrainLocks() {
  +        // TODO a global write lock is certainly too much, but I have no better idea (OZ)
  +        acquireLock("/", WRITE_LOCK);
  +    }
  +
       /**
        * Parse WebDAV XML query.
        *
  
  
  
  1.33      +12 -4     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java
  
  Index: UpdateMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UpdateMethod.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- UpdateMethod.java	2 Aug 2004 16:36:01 -0000	1.32
  +++ UpdateMethod.java	26 Oct 2004 20:34:47 -0000	1.33
  @@ -66,7 +66,7 @@
    *
    */
   public class UpdateMethod extends AbstractMultistatusResponseMethod
  -    implements DeltavConstants, WriteMethod {
  +    implements DeltavConstants, WriteMethod, FineGrainedLockingMethod {
   
       /** The update target */
       private String resourcePath;
  @@ -108,6 +108,14 @@
       public UpdateMethod(NamespaceAccessToken token,
                           WebdavServletConfig config) {
           super(token, config);
  +    }
  +
  +    /**
  +     * @see org.apache.slide.webdav.method.FineGrainedLockingMethod#acquireFineGrainLocks()
  +     */
  +    public void acquireFineGrainLocks() {
  +        // TODO a global write lock is certainly too much, but I have no better idea (OZ)
  +        acquireLock("/", WRITE_LOCK);
       }
   
       /**
  
  
  
  1.19      +13 -4     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/BindMethod.java
  
  Index: BindMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/BindMethod.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- BindMethod.java	2 Aug 2004 16:36:02 -0000	1.18
  +++ BindMethod.java	26 Oct 2004 20:34:47 -0000	1.19
  @@ -47,7 +47,8 @@
    * BIND method.
    *
    */
  -public class BindMethod extends AbstractWebdavMethod implements BindConstants, WriteMethod {
  +public class BindMethod extends AbstractWebdavMethod implements BindConstants, WriteMethod,
  +        FineGrainedLockingMethod {
   
       private String sourceUri;
       private String collectionUri;
  @@ -65,6 +66,14 @@
        */
       public BindMethod(NamespaceAccessToken token, WebdavServletConfig config) {
           super(token, config);
  +    }
  +
  +    /**
  +     * @see org.apache.slide.webdav.method.FineGrainedLockingMethod#acquireFineGrainLocks()
  +     */
  +    public void acquireFineGrainLocks() {
  +        // TODO a global write lock is certainly too much, but I have no better idea (OZ)
  +        acquireLock("/", WRITE_LOCK);
       }
   
       /**
  
  
  
  1.56      +4 -4      jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
  
  Index: AbstractWebdavMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- AbstractWebdavMethod.java	26 Oct 2004 20:06:00 -0000	1.55
  +++ AbstractWebdavMethod.java	26 Oct 2004 20:34:48 -0000	1.56
  @@ -177,7 +177,7 @@
       // causes two SEARCH methods
       // to execute concurrently which is what we want - the highest lock level
       // will never be acquired
  -    private static final GenericLock SEARCH_LOCK = new GenericLock("global",
  +    private static final GenericLock SEARCH_LOCK = new GenericLock("GLOBAL",
               WRITE_LOCK + 1, new PrintWriterLogger(new PrintWriter(System.out),
                       LOG_CHANNEL, false));
       
  
  
  
  1.29      +14 -5     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LabelMethod.java
  
  Index: LabelMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LabelMethod.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- LabelMethod.java	2 Aug 2004 16:36:02 -0000	1.28
  +++ LabelMethod.java	26 Oct 2004 20:34:48 -0000	1.29
  @@ -62,7 +62,8 @@
    * @version $Revision$
    *
    */
  -public class LabelMethod extends AbstractMultistatusResponseMethod implements DeltavConstants, WriteMethod {
  +public class LabelMethod extends AbstractMultistatusResponseMethod implements DeltavConstants,
  +        WriteMethod, FineGrainedLockingMethod {
       /**
        ** String constant for <code>Label missing</code>.
        **/
  @@ -125,6 +126,14 @@
           super(token, config);
       }
       
  +    /**
  +     * @see org.apache.slide.webdav.method.FineGrainedLockingMethod#acquireFineGrainLocks()
  +     */
  +    public void acquireFineGrainLocks() {
  +        // TODO a global write lock is certainly too much, but I have no better idea (OZ)
  +        acquireLock("/", WRITE_LOCK);
  +    }
  +
       /**
        * Parse WebDAV XML query.
        *
  
  
  
  1.16      +13 -4     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnbindMethod.java
  
  Index: UnbindMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/UnbindMethod.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- UnbindMethod.java	2 Aug 2004 16:36:01 -0000	1.15
  +++ UnbindMethod.java	26 Oct 2004 20:34:48 -0000	1.16
  @@ -46,7 +46,8 @@
    * UNBIND method.
    *
    */
  -public class UnbindMethod extends AbstractWebdavMethod implements BindConstants, WriteMethod {
  +public class UnbindMethod extends AbstractWebdavMethod implements BindConstants, WriteMethod,
  +        FineGrainedLockingMethod {
       
       private String collectionUri;
       private String segment;
  @@ -64,6 +65,14 @@
           super(token, config);
       }
       
  +    /**
  +     * @see org.apache.slide.webdav.method.FineGrainedLockingMethod#acquireFineGrainLocks()
  +     */
  +    public void acquireFineGrainLocks() {
  +        // TODO a global write lock is certainly too much, but I have no better idea (OZ)
  +        acquireLock("/", WRITE_LOCK);
  +    }
  +
       /**
        * Parse WebDAV XML query.
        *
  
  
  
  1.17      +13 -4     jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/RebindMethod.java
  
  Index: RebindMethod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/RebindMethod.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- RebindMethod.java	2 Aug 2004 16:36:01 -0000	1.16
  +++ RebindMethod.java	26 Oct 2004 20:34:48 -0000	1.17
  @@ -47,7 +47,8 @@
    * REBIND method.
    *
    */
  -public class RebindMethod extends AbstractWebdavMethod implements BindConstants, WriteMethod {
  +public class RebindMethod extends AbstractWebdavMethod implements BindConstants, WriteMethod,
  +        FineGrainedLockingMethod {
   
       private String sourceUri;
       private String sourceSegment;
  @@ -68,6 +69,14 @@
        */
       public RebindMethod(NamespaceAccessToken token, WebdavServletConfig config) {
           super(token, config);
  +    }
  +
  +    /**
  +     * @see org.apache.slide.webdav.method.FineGrainedLockingMethod#acquireFineGrainLocks()
  +     */
  +    public void acquireFineGrainLocks() {
  +        // TODO a global write lock is certainly too much, but I have no better idea (OZ)
  +        acquireLock("/", WRITE_LOCK);
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org