roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r495666 - in /incubator/roller/trunk: src/org/apache/roller/business/hibernate/ src/org/apache/roller/business/runnable/ tests/org/apache/roller/business/
Date Fri, 12 Jan 2007 18:00:55 GMT
Author: agilliland
Date: Fri Jan 12 10:00:53 2007
New Revision: 495666

URL: http://svn.apache.org/viewvc?view=rev&rev=495666
Log:
a little bit of renaming to use the term "lease" instead of "lock" when dealing with task
leasing.  this is more consistent with JINI's terminology as suggested by Elias.


Modified:
    incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java
    incubator/roller/trunk/src/org/apache/roller/business/runnable/RollerTaskWithLeasing.java
    incubator/roller/trunk/src/org/apache/roller/business/runnable/ThreadManager.java
    incubator/roller/trunk/src/org/apache/roller/business/runnable/ThreadManagerImpl.java
    incubator/roller/trunk/tests/org/apache/roller/business/TaskLockTest.java

Modified: incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java?view=diff&rev=495666&r1=495665&r2=495666
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/business/hibernate/HibernateThreadManagerImpl.java
Fri Jan 12 10:00:53 2007
@@ -37,7 +37,7 @@
  * Hibernate implementation of the TaskLockManager interface.
  *
  * This implementation extends the base ThreadManagerImpl class and provides
- * locking abilities which are managed through the database.
+ * leasing abilities which are managed through the database.
  */
 public class HibernateThreadManagerImpl extends ThreadManagerImpl {
     
@@ -58,7 +58,7 @@
     /**
      * Try to aquire a lock for a given RollerTask.
      */
-    public boolean acquireLock(RollerTask task) {
+    public boolean registerLease(RollerTask task) {
         
         // query for existing lease record first
         TaskLockData taskLock = null;
@@ -123,7 +123,7 @@
     /**
      * Try to release the lock for a given RollerTask.
      */
-    public boolean releaseLock(RollerTask task) {
+    public boolean unregisterLease(RollerTask task) {
         
         // query for existing lease record first
         TaskLockData taskLock = null;

Modified: incubator/roller/trunk/src/org/apache/roller/business/runnable/RollerTaskWithLeasing.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/business/runnable/RollerTaskWithLeasing.java?view=diff&rev=495666&r1=495665&r2=495666
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/business/runnable/RollerTaskWithLeasing.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/business/runnable/RollerTaskWithLeasing.java
Fri Jan 12 10:00:53 2007
@@ -57,7 +57,7 @@
         try {
             log.debug("Attempting to acquire lock");
             
-            lockAcquired = mgr.acquireLock(this);
+            lockAcquired = mgr.registerLease(this);
             
             // now if we have a lock then run the task
             if(lockAcquired) {
@@ -76,7 +76,7 @@
                 
                 log.debug("Attempting to release lock");
                 
-                boolean lockReleased = mgr.releaseLock(this);
+                boolean lockReleased = mgr.unregisterLease(this);
                 
                 if(lockReleased) {
                     log.debug("Lock released, time to sleep");

Modified: incubator/roller/trunk/src/org/apache/roller/business/runnable/ThreadManager.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/business/runnable/ThreadManager.java?view=diff&rev=495666&r1=495665&r2=495666
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/business/runnable/ThreadManager.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/business/runnable/ThreadManager.java Fri
Jan 12 10:00:53 2007
@@ -19,7 +19,6 @@
 package org.apache.roller.business.runnable;
 
 import java.util.Date;
-import java.util.TimerTask;
 
 
 /**
@@ -57,21 +56,21 @@
     
     
     /**
-     * Try to aquire a lock for a given RollerTask.
+     * Try to register a lease for a given RollerTask.
      *
-     * @param task The RollerTask to aquire the lock for.
-     * @return boolean True if lock was acquired, False otherwise.
+     * @param task The RollerTask to register the lease for.
+     * @return boolean True if lease was registered, False otherwise.
      */
-    public boolean acquireLock(RollerTask task);
+    public boolean registerLease(RollerTask task);
     
     
     /**
-     * Try to release the lock for a given RollerTask.
+     * Try to unregister the lease for a given RollerTask.
      *
-     * @param task The RollerTask to release the lock for.
-     * @return boolean True if lock was released (or was not locked), False otherwise.
+     * @param task The RollerTask to unregister the lease for.
+     * @return boolean True if lease was unregistered (or was not leased), False otherwise.
      */
-    public boolean releaseLock(RollerTask task);
+    public boolean unregisterLease(RollerTask task);
     
     
     /**

Modified: incubator/roller/trunk/src/org/apache/roller/business/runnable/ThreadManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/business/runnable/ThreadManagerImpl.java?view=diff&rev=495666&r1=495665&r2=495666
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/business/runnable/ThreadManagerImpl.java
(original)
+++ incubator/roller/trunk/src/org/apache/roller/business/runnable/ThreadManagerImpl.java
Fri Jan 12 10:00:53 2007
@@ -107,11 +107,11 @@
     }
     
     
-    public boolean acquireLock(RollerTask task) {
+    public boolean registerLease(RollerTask task) {
         return true;
     }
     
-    public boolean releaseLock(RollerTask task) {
+    public boolean unregisterLease(RollerTask task) {
         return true;
     }
     

Modified: incubator/roller/trunk/tests/org/apache/roller/business/TaskLockTest.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/business/TaskLockTest.java?view=diff&rev=495666&r1=495665&r2=495666
==============================================================================
--- incubator/roller/trunk/tests/org/apache/roller/business/TaskLockTest.java (original)
+++ incubator/roller/trunk/tests/org/apache/roller/business/TaskLockTest.java Fri Jan 12 10:00:53
2007
@@ -66,15 +66,15 @@
         RollerTask task = new TestTask();
         
         // try to acquire a lock
-        assertTrue(mgr.acquireLock(task));
+        assertTrue(mgr.registerLease(task));
         TestUtils.endSession(true);
         
         // make sure task is locked
-        assertFalse(mgr.acquireLock(task));
+        assertFalse(mgr.registerLease(task));
         TestUtils.endSession(true);
         
         // try to release a lock
-        assertTrue(mgr.releaseLock(task));
+        assertTrue(mgr.unregisterLease(task));
         TestUtils.endSession(true);
     }
     



Mime
View raw message