[java-opensaml COMMIT] in /trunk/opensaml-util/src: main/java/org/opensaml/util/storage/AbstractStorageService.java t...

noreply at shibboleth.net noreply at shibboleth.net
Tue Apr 30 21:46:22 EDT 2013


Author: scantor
Date: Tue Apr 30 21:46:22 2013
New Revision: 3328

URL: http://svn.shibboleth.net/view/java-opensaml?rev=3328&view=rev
Log:
Change unit and default for background interval, and fix tests.

Modified:
    trunk/opensaml-util/src/main/java/org/opensaml/util/storage/AbstractStorageService.java
    trunk/opensaml-util/src/test/java/org/opensaml/util/storage/impl/MemoryStorageServiceTest.java

Modified: trunk/opensaml-util/src/main/java/org/opensaml/util/storage/AbstractStorageService.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-util/src/main/java/org/opensaml/util/storage/AbstractStorageService.java?rev=3328&r1=3327&r2=3328&view=diff
==============================================================================
--- trunk/opensaml-util/src/main/java/org/opensaml/util/storage/AbstractStorageService.java (original)
+++ trunk/opensaml-util/src/main/java/org/opensaml/util/storage/AbstractStorageService.java Tue Apr 30 21:46:22 2013
@@ -41,9 +41,9 @@
     implements StorageService {
 
     /**
-     * Number of milliseconds between cleanup checks. Default value: {@value} (5 minutes)
-     */
-    private long cleanupInterval = 300000;
+     * Number of seconds between cleanup checks. Default value: (0)
+     */
+    private long cleanupInterval;
 
     /** Timer used to schedule cleanup tasks. */
     private Timer cleanupTaskTimer;
@@ -60,22 +60,22 @@
     }
 
     /**
-     * Gets the number of milliseconds between one cleanup and another. A value of 0 or less indicates that no
+     * Gets the number of seconds between one cleanup and another. A value of 0 or less indicates that no
      * cleanup will be performed.
      * 
-     * @return number of milliseconds between one cleanup and another
+     * @return number of seconds between one cleanup and another
      */
     public long getCleanupInterval() {
         return cleanupInterval;
     }
 
     /**
-     * Sets the number of milliseconds between one cleanup and another. A value of 0 or less indicates that no
+     * Sets the number of seconds between one cleanup and another. A value of 0 or less indicates that no
      * cleanup will be performed.
      * 
      * This setting cannot be changed after the service has been initialized.
      * 
-     * @param interval number of milliseconds between one cleanup and another
+     * @param interval number of seconds between one cleanup and another
      */
     public synchronized void setCleanupInterval(long interval) {
         if (isInitialized()) {
@@ -130,7 +130,7 @@
                 throw new ComponentInitializationException(
                         "Cleanup task and timer cannot be null if cleanupInterval is set.");
             }
-            cleanupTaskTimer.schedule(cleanupTask, cleanupInterval, cleanupInterval);
+            cleanupTaskTimer.schedule(cleanupTask, cleanupInterval * 1000, cleanupInterval * 1000);
         }
     }
     

Modified: trunk/opensaml-util/src/test/java/org/opensaml/util/storage/impl/MemoryStorageServiceTest.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-util/src/test/java/org/opensaml/util/storage/impl/MemoryStorageServiceTest.java?rev=3328&r1=3327&r2=3328&view=diff
==============================================================================
--- trunk/opensaml-util/src/test/java/org/opensaml/util/storage/impl/MemoryStorageServiceTest.java (original)
+++ trunk/opensaml-util/src/test/java/org/opensaml/util/storage/impl/MemoryStorageServiceTest.java Tue Apr 30 21:46:22 2013
@@ -36,7 +36,7 @@
     /** {@inheritDoc} */
     @Nonnull protected StorageService getStorageService() {
         MemoryStorageService ss = new MemoryStorageService();
-        ss.setCleanupInterval(1000);
+        ss.setCleanupInterval(1);
         ss.setCleanupTaskTimer(new Timer());
         return ss;
     }
@@ -44,6 +44,7 @@
     @Test
     public void invalidConfig() {
         MemoryStorageService ss = new MemoryStorageService();
+        ss.setCleanupInterval(1);
         
         try {
             ss.initialize();
@@ -58,7 +59,6 @@
     @Test
     public void validConfig() throws ComponentInitializationException {
         MemoryStorageService ss = new MemoryStorageService();
-        ss.setCleanupTaskTimer(new Timer());
         
         ss.initialize();
         ss.destroy();



More information about the commits mailing list