Add a shutdown() method

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/jcs/trunk@1782349 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs/JCS.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs/JCS.java
index 304df37..a51da23 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs/JCS.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs/JCS.java
@@ -130,6 +130,22 @@
     }
 
     /**
+     * Shut down the cache manager and set the instance to null
+     */
+    public static void shutdown()
+    {
+        synchronized ( JCS.class )
+        {
+            if ( cacheMgr != null && cacheMgr.isInitialized())
+            {
+            	cacheMgr.shutDown();
+            }
+
+            cacheMgr = null;
+        }
+    }
+
+    /**
      * Helper method which checks to make sure the cacheMgr class field is set, and if not requests
      * an instance from CacheManagerFactory.
      *