Commits

Anonymous committed 6a13f23

Add a "removePackageConfig" method to Configuration

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1968e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (2)

src/java/com/opensymphony/xwork2/config/Configuration.java

     void addPackageConfig(String name, PackageConfig packageConfig);
 
     /**
+     * Removes a package from the the list of packages. Changes to the configuration won't take effect until buildRuntimeConfiguration
+     * is called.
+     * @param packageName the name of the package to remove
+     * @return the package removed (if any)
+     */
+    PackageConfig removePackageConfig(String packageName);
+
+    /**
      * Allow the Configuration to clean up any resources that have been used.
      */
     void destroy();

src/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java

         packageContexts.put(name, packageContext);
     }
 
+    public PackageConfig removePackageConfig(String packageName) {
+        return packageContexts.remove(packageName);
+    }
+
     /**
      * Allows the configuration to clean up any resources used
      */