geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r396071 - /geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java
Date Sat, 22 Apr 2006 04:04:42 GMT
Author: ammulder
Date: Fri Apr 21 21:04:40 2006
New Revision: 396071

URL: http://svn.apache.org/viewcvs?rev=396071&view=rev
Log:
Print errors if any, because otherwise they just silently disappear

Modified:
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java

Modified: geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java?rev=396071&r1=396070&r2=396071&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java
(original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/ConfigCopier.java
Fri Apr 21 21:04:40 2006
@@ -98,29 +98,33 @@
         this.targetRepositoryLocation = targetRepositoryLocation;
     }
 
-    public void execute() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException, InstantiationException, InvalidConfigException, IOException, NoSuchConfigException
{
-        ClassLoader cl = this.getClass().getClassLoader();
+    public void execute() throws Exception {
+        try {
+            ClassLoader cl = this.getClass().getClassLoader();
 
-        Class sourceRepoClass = cl.loadClass(sourceRepositoryClass);
-        WritableListableRepository sourceRepository = (WritableListableRepository) sourceRepoClass.getDeclaredConstructor(REPO_ARGS).newInstance(new
Object[] {sourceRepositoryLocation});
-        Class sourceConfigStoreClass = cl.loadClass(sourceConfigurationStoreClass);
-        ConfigurationStore sourceConfigStore = (ConfigurationStore) sourceConfigStoreClass.getDeclaredConstructor(STORE_ARGS).newInstance(new
Object[] {sourceRepository});
+            Class sourceRepoClass = cl.loadClass(sourceRepositoryClass);
+            WritableListableRepository sourceRepository = (WritableListableRepository) sourceRepoClass.getDeclaredConstructor(REPO_ARGS).newInstance(new
Object[] {sourceRepositoryLocation});
+            Class sourceConfigStoreClass = cl.loadClass(sourceConfigurationStoreClass);
+            ConfigurationStore sourceConfigStore = (ConfigurationStore) sourceConfigStoreClass.getDeclaredConstructor(STORE_ARGS).newInstance(new
Object[] {sourceRepository});
 
-        Class targetRepoClass = cl.loadClass(targetRepositoryClass);
-        WritableListableRepository targetRepository = (WritableListableRepository) targetRepoClass.getDeclaredConstructor(REPO_ARGS).newInstance(new
Object[] {targetRepositoryLocation});
-        Class targetConfigStoreClass = cl.loadClass(targetConfigurationStoreClass);
-        ConfigurationStore targetConfigStore = (ConfigurationStore) targetConfigStoreClass.getDeclaredConstructor(STORE_ARGS).newInstance(new
Object[] {targetRepository});
+            Class targetRepoClass = cl.loadClass(targetRepositoryClass);
+            WritableListableRepository targetRepository = (WritableListableRepository) targetRepoClass.getDeclaredConstructor(REPO_ARGS).newInstance(new
Object[] {targetRepositoryLocation});
+            Class targetConfigStoreClass = cl.loadClass(targetConfigurationStoreClass);
+            ConfigurationStore targetConfigStore = (ConfigurationStore) targetConfigStoreClass.getDeclaredConstructor(STORE_ARGS).newInstance(new
Object[] {targetRepository});
 
-        List configs = sourceConfigStore.listConfigurations();
-        for (Iterator iterator = configs.iterator(); iterator.hasNext();) {
-            ConfigurationInfo configInfo = (ConfigurationInfo) iterator.next();
-            Artifact configId = configInfo.getConfigID();
-            ConfigurationData configData = sourceConfigStore.loadConfiguration(configId);
-            if (targetConfigStore.containsConfiguration(configId)) {
-                targetConfigStore.uninstall(configId);
+            List configs = sourceConfigStore.listConfigurations();
+            for (Iterator iterator = configs.iterator(); iterator.hasNext();) {
+                ConfigurationInfo configInfo = (ConfigurationInfo) iterator.next();
+                Artifact configId = configInfo.getConfigID();
+                ConfigurationData configData = sourceConfigStore.loadConfiguration(configId);
+                if (targetConfigStore.containsConfiguration(configId)) {
+                    targetConfigStore.uninstall(configId);
+                }
+                targetConfigStore.install(configData);
             }
-            targetConfigStore.install(configData);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw e;
         }
-
     }
 }



Mime
View raw message