Skip to content
This repository
Browse code

Allow the container and test suites to trigger a clean exit for async…

… cache
  • Loading branch information...
commit 0b50fa863215f8b6c60ef47b9ece436735313326 1 parent 1a3fd5a
Tim Freeman authored June 13, 2011
6  service/service/java/source/src/org/globus/workspace/async/AsyncRequestManager.java
@@ -31,5 +31,9 @@
31 31
      * @throws ResourceRequestDeniedException If this type of request is disabled
32 32
      */
33 33
     public void addRequest(AsyncRequest request) throws ResourceRequestDeniedException;
34  
-    
  34
+
  35
+    /**
  36
+     * Allow container shutdown and test suites to signal a clean exit.
  37
+     */
  38
+    public void shutdownImmediately();
35 39
 }
10  service/service/java/source/src/org/globus/workspace/async/AsyncRequestManagerImpl.java
@@ -1216,4 +1216,14 @@ public synchronized Integer getMaxVMs() {
1216 1216
         return maxVMs;
1217 1217
     }
1218 1218
 
  1219
+
  1220
+    // -----------------------------------------------------------------------------------------
  1221
+    // LIFECYCLE
  1222
+    // -----------------------------------------------------------------------------------------
  1223
+
  1224
+    public void shutdownImmediately() {
  1225
+        if (this.asyncRequestMap != null) {
  1226
+            this.asyncRequestMap.shutdownImmediately();
  1227
+        }
  1228
+    }
1219 1229
 }
6  service/service/java/source/src/org/globus/workspace/async/AsyncRequestMap.java
@@ -139,4 +139,10 @@ private void loadAllFromDisk() throws IOException {
139 139
         }
140 140
         logger.info("Found " + count + " spot requests on disk.");
141 141
     }
  142
+
  143
+    void shutdownImmediately() {
  144
+        if (this.cache != null) {
  145
+            this.cache.removeAll();
  146
+        }
  147
+    }
142 148
 }
3  service/service/java/source/src/org/globus/workspace/manager/DelegatingManager.java
@@ -189,7 +189,7 @@ public void setCreation(CreationManager creationImpl) {
189 189
     // -------------------------------------------------------------------------
190 190
 
191 191
     public String report() {
192  
-        final StringBuffer buf = new StringBuffer("Class: ");
  192
+        final StringBuilder buf = new StringBuilder("Class: ");
193 193
         buf.append(this.getClass().getName())
194 194
            .append("\n")
195 195
            .append("Workspace Service Manager");
@@ -225,6 +225,7 @@ public void recover_initialize() throws Exception {
225 225
 
226 226
     public void shutdownImmediately() {
227 227
         this.home.shutdownImmediately();
  228
+        this.asyncHome.shutdownImmediately();
228 229
     }
229 230
 
230 231
     

0 notes on commit 0b50fa8

Please sign in to comment.
Something went wrong with that request. Please try again.