geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r216281 - in /geronimo/branches/v1_0_M4-QA/modules: deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/ deploy-tool/src/java/org/apache/geronimo/deployment/cli/ deployment/src/java/org/apache/geronimo/deployment/ kernel/src/j...
Date Wed, 13 Jul 2005 22:54:35 GMT
Author: ammulder
Date: Wed Jul 13 15:54:33 2005
New Revision: 216281

URL: http://svn.apache.org/viewcvs?rev=216281&view=rev
Log:
Merge recent deployment changes into the M4 branch

Modified:
    geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/DistributeCommand.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/AbstractCommand.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
    geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
    geronimo/branches/v1_0_M4-QA/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java
    geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
    geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
    geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanServerDelegate.java

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
Wed Jul 13 15:54:33 2005
@@ -103,7 +103,7 @@
         }
     }
 
-    protected void doDeploy(ObjectName deployer, Target target) throws Exception {
+    protected void doDeploy(ObjectName deployer, Target target, boolean finished) throws
Exception {
         Object[] args = {moduleArchive, deploymentPlan};
         List objectNames = (List) kernel.invoke(deployer, "deploy", args, DEPLOY_SIG);
         if (objectNames == null || objectNames.isEmpty()) {
@@ -119,6 +119,8 @@
 
         TargetModuleID moduleID = new TargetModuleIDImpl(target, parentName.toString(), childIDs);
         addModule(moduleID);
-        complete("Completed with id " + parentName);
+        if(finished) {
+            complete("Completed with id " + parentName);
+        }
     }
 }

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
Wed Jul 13 15:54:33 2005
@@ -62,6 +62,10 @@
         moduleIDs.add(moduleID);
     }
 
+    protected synchronized int getModuleCount() {
+        return moduleIDs.size();
+    }
+
     public synchronized TargetModuleID[] getResultTargetModuleIDs() {
         return (TargetModuleID[]) moduleIDs.toArray(new TargetModuleID[moduleIDs.size()]);
     }
@@ -113,6 +117,10 @@
         sendEvent(message, StateType.COMPLETED);
     }
 
+    protected final void updateStatus(String message) {
+        sendEvent(message, state);
+    }
+
     protected void doFail(Exception e) {
         if (e instanceof InternalKernelException) {
             e = (Exception)((InternalKernelException)e).getCause();
@@ -155,6 +163,13 @@
         for (int i = 0; i < toNotify.length; i++) {
             toNotify[i].handleProgressEvent(event);
         }
+    }
+
+    protected static String clean(String value) {
+        if(value.startsWith("\"") && value.endsWith("\"")) {
+            return value.substring(1, value.length()-1);
+        }
+        return value;
     }
 
     private static class Status implements DeploymentStatus {

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/DistributeCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/DistributeCommand.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/DistributeCommand.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/DistributeCommand.java
Wed Jul 13 15:54:33 2005
@@ -59,9 +59,7 @@
             if (deployer == null) {
                 return;
             }
-
-            doDeploy(deployer, targetList[0]);
-
+            doDeploy(deployer, targetList[0], true);
         } catch (Exception e) {
             doFail(e);
         } finally {

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
Wed Jul 13 15:54:33 2005
@@ -19,6 +19,7 @@
 import java.io.File;
 import java.io.InputStream;
 import java.net.URI;
+import java.util.List;
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.management.ObjectName;
@@ -27,9 +28,12 @@
 import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
 
 /**
  * @version $Rev$ $Date$
@@ -72,14 +76,42 @@
 
                 URI configID = URI.create(module.getModuleID());
                 ObjectName configName = Configuration.getConfigurationObjectName(configID);
-                kernel.stopGBean(configName);
-                configurationManager.unload(configID);
+                try {
+                    kernel.stopGBean(configName);
+                    updateStatus("Stopped "+configID);
+                } catch (GBeanNotFoundException e) {
+                    if(e.getGBeanName().equals(configName)) {
+                        // The module isn't running -- that's OK
+                    } else throw e;
+                }
+                try {
+                    configurationManager.unload(configID);
+                    updateStatus("Unloaded "+configID);
+                } catch(InternalKernelException e) {
+                    Exception cause = (Exception)e.getCause();
+                    if(cause instanceof NoSuchConfigException) {
+                        // The modules isn't loaded -- that's OK
+                    } else {
+                        throw cause;
+                    }
+                } catch (NoSuchConfigException e) {
+                    // The modules isn't loaded -- that's OK
+                }
 
                 TargetImpl target = (TargetImpl) module.getTarget();
                 ObjectName storeName = target.getObjectName();
                 kernel.invoke(storeName, "uninstall", new Object[]{configID}, UNINSTALL_SIG);
+                updateStatus("Uninstalled "+configID);
 
-                doDeploy(deployer, module.getTarget());
+                doDeploy(deployer, module.getTarget(), false);
+                updateStatus("Deployed "+configID);
+
+                List list = configurationManager.loadRecursive(configID);
+                for (int j = 0; j < list.size(); j++) {
+                    ObjectName name = (ObjectName) list.get(j);
+                    kernel.startRecursiveGBean(name);
+                    updateStatus("Started "+clean(name.getKeyProperty("name")));
+                }
             }
             complete("Completed");
         } catch (Exception e) {

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
Wed Jul 13 15:54:33 2005
@@ -18,6 +18,7 @@
 package org.apache.geronimo.deployment.plugin.local;
 
 import java.net.URI;
+import java.util.List;
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.management.ObjectName;
@@ -25,6 +26,7 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
 
 /**
  *
@@ -48,10 +50,13 @@
                 TargetModuleID module = modules[i];
 
                 URI moduleID = URI.create(module.getModuleID());
-                ObjectName configName = configurationManager.load(moduleID);
-                kernel.startRecursiveGBean(configName);
-
-                addModule(module);
+                List list = configurationManager.loadRecursive(moduleID);
+                for (int j = 0; j < list.size(); j++) {
+                    ObjectName name = (ObjectName) list.get(j);
+                    kernel.startRecursiveGBean(name);
+                    String configName = name.getKeyProperty("name");
+                    addModule(new TargetModuleIDImpl(modules[i].getTarget(), configName));
+                }
             }
             complete("Completed");
         } catch (Exception e) {

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StopCommand.java
Wed Jul 13 15:54:33 2005
@@ -18,12 +18,16 @@
 package org.apache.geronimo.deployment.plugin.local;
 
 import java.net.URI;
+import java.util.Map;
+import java.util.HashMap;
 
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.management.ObjectName;
 
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
@@ -49,11 +53,25 @@
 
                 URI moduleID = URI.create(module.getModuleID());
                 ObjectName configName = Configuration.getConfigurationObjectName(moduleID);
-                kernel.stopGBean(configName);
+                try {
+                    kernel.stopGBean(configName);
+                } catch (GBeanNotFoundException e) {
+                    if(clean(e.getGBeanName().getKeyProperty("name")).equals(moduleID.toString()))
{
+                        updateStatus("Module "+moduleID+" is not running.");
+                        continue;
+                    } else {
+                        System.out.println("Unmatched name '"+clean(e.getGBeanName().getKeyProperty("name"))+"'");
+                        throw e;
+                    }
+                }
                 configurationManager.unload(moduleID);
                 addModule(module);
             }
-            complete("Completed");
+            if(getModuleCount() < modules.length) {
+                fail("Some modules could not be stopped");
+            } else {
+                complete("Completed");
+            }
         } catch (Exception e) {
             doFail(e);
         }

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/UndeployCommand.java
Wed Jul 13 15:54:33 2005
@@ -30,6 +30,7 @@
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.InternalKernelException;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
 
 /**
  * @version $Rev$ $Date$
@@ -54,8 +55,18 @@
                 URI moduleID = URI.create(module.getModuleID());
                 try {
                     ObjectName configName = Configuration.getConfigurationObjectName(moduleID);
-                    kernel.stopGBean(configName);
+                    try {
+                        kernel.stopGBean(configName);
+                        updateStatus("Module "+moduleID+" stopped.");
+                    } catch (GBeanNotFoundException e) {
+                        if(clean(e.getGBeanName().getKeyProperty("name")).equals(moduleID.toString()))
{
+                            // the module is not running
+                        } else {
+                            throw e;
+                        }
+                    }
                     configurationManager.unload(moduleID);
+                    updateStatus("Module "+moduleID+" unloaded.");
                 } catch (InternalKernelException e) {
                     // this is cause by the kernel being already shutdown
                 } catch (NoSuchConfigException e) {
@@ -67,11 +78,14 @@
                     ObjectName storeName = target.getObjectName();
                     URI configID = URI.create(module.getModuleID());
                     kernel.invoke(storeName, "uninstall", new Object[]{configID}, UNINSTALL_SIG);
+                    updateStatus("Module "+moduleID+" uninstalled.");
+                    addModule(module);
                 } catch (NoSuchConfigException e) {
                     // module was already undeployed - just continue
                 }
-
-                addModule(module);
+            }
+            if(getModuleCount() < modules.length) {
+                updateStatus("Some of the modules to undeploy were not previously deployed.
 This is not treated as an error.");
             }
             complete("Completed");
         } catch (Exception e) {

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/AbstractCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/AbstractCommand.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/AbstractCommand.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/AbstractCommand.java
Wed Jul 13 15:54:33 2005
@@ -20,6 +20,8 @@
 import org.apache.geronimo.common.DeploymentException;
 
 import javax.enterprise.deploy.spi.status.ProgressObject;
+import javax.enterprise.deploy.spi.status.ProgressListener;
+import javax.enterprise.deploy.spi.status.ProgressEvent;
 import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.enterprise.deploy.spi.Target;
 import javax.enterprise.deploy.spi.DeploymentManager;
@@ -79,6 +81,16 @@
      * @param po a <code>ProgressObject</code> value
      */
     protected static void waitForProgress(PrintWriter out, ProgressObject po) {
+        po.addProgressListener(new ProgressListener() {
+            String last = null;
+            public void handleProgressEvent(ProgressEvent event) {
+                String msg = event.getDeploymentStatus().getMessage();
+                if(last != null && !last.equals(msg)) {
+                    System.out.println(DeployUtils.reformat(last,8,72)); //todo: use the
same writer as DeployTool
+                }
+                last = msg;
+            }
+        });
         while(po.getDeploymentStatus().isRunning()) {
             try {
                 Thread.sleep(100);
@@ -144,7 +156,7 @@
             }
         }
         if(list.isEmpty()) {
-            throw new DeploymentException(name+" does not appear to be a module name or a
TargetModuleID.  For a TargetModuleID, specify it as TargetName|ModuleName");
+            throw new DeploymentException(name+" does not appear to be a TargetModuleID or
the name of a module available on the selected server.  For a TargetModuleID, specify it as
TargetName|ModuleName");
         }
         return list;
     }

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
Wed Jul 13 15:54:33 2005
@@ -148,13 +148,13 @@
         results = po.getResultTargetModuleIDs();
         for (int i = 0; i < results.length; i++) {
             TargetModuleID result = results[i];
-            out.println(getAction()+" "+result.getModuleID()+(multipleTargets ? " to "+result.getTarget().getName()
: ""));
+            out.println(DeployUtils.reformat(getAction()+" "+result.getModuleID()+(multipleTargets
? " to "+result.getTarget().getName() : ""), 4, 72));
         }
 
         // if any results failed then throw so that we'll return non-0
         // to the operating system
         if(po.getDeploymentStatus().isFailed()) {
-            throw new DeploymentException("Deployment failed, Server reports: "+po.getDeploymentStatus().getMessage());
+            throw new DeploymentException("Operation failed: "+po.getDeploymentStatus().getMessage());
         }
     }
 

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
Wed Jul 13 15:54:33 2005
@@ -108,6 +108,12 @@
         for(int i=2; i<args.length; i++) {
             modules.addAll(identifyTargetModuleIDs(allModules, args[i]));
         }
+        if(module != null) {
+            module = module.getAbsoluteFile();
+        }
+        if(plan != null) {
+            plan = plan.getAbsoluteFile();
+        }
         TargetModuleID[] ids = (TargetModuleID[]) modules.toArray(new TargetModuleID[modules.size()]);
         boolean multiple = isMultipleTargets(ids);
         ProgressObject po = mgr.redeploy(ids, module, plan);
@@ -115,10 +121,10 @@
         TargetModuleID[] done = po.getResultTargetModuleIDs();
         for(int i = 0; i < done.length; i++) {
             TargetModuleID id = done[i];
-            out.println("Redeployed "+id.getModuleID()+(multiple ? " on "+id.getTarget().getName()
: ""));
+            out.println(DeployUtils.reformat("Redeployed "+id.getModuleID()+(multiple ? "
on "+id.getTarget().getName() : ""), 4, 72));
         }
         if(po.getDeploymentStatus().isFailed()) {
-            throw new DeploymentException("Deployment failed, Server reports: "+po.getDeploymentStatus().getMessage());
+            throw new DeploymentException("Operation failed: "+po.getDeploymentStatus().getMessage());
         }
     }
 }

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
Wed Jul 13 15:54:33 2005
@@ -74,10 +74,10 @@
         TargetModuleID[] done = po.getResultTargetModuleIDs();
         for(int i = 0; i < done.length; i++) {
             TargetModuleID id = done[i];
-            out.println(getAction()+" "+id.getModuleID()+(multiple ? " on "+id.getTarget().getName()
: ""));
+            out.println(DeployUtils.reformat(getAction()+" "+id.getModuleID()+(multiple ?
" on "+id.getTarget().getName() : ""),4, 72));
         }
         if(po.getDeploymentStatus().isFailed()) {
-            throw new DeploymentException("Deployment failed, Server reports: "+po.getDeploymentStatus().getMessage());
+            throw new DeploymentException("Operation failed: "+po.getDeploymentStatus().getMessage());
         }
     }
 

Modified: geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/ServerConnection.java
Wed Jul 13 15:54:33 2005
@@ -181,7 +181,7 @@
             if(authPrompt && (user == null || password == null)) {
                 doAuthPromptAndRetry(uri, commandContext, user, password);
             } else {
-                throw new DeploymentException("Unable to connect to server", e);
+                throw new DeploymentException("Login Failed");
             }
         } catch(DeploymentManagerCreationException e) {
             if(uri != null) {
@@ -320,7 +320,7 @@
                 }
                 out.print(clearline.toString());
                 out.flush();
-                out.print('\r');
+                out.println();
                 out.flush();
             } catch (InterruptedException e) {
             } finally {

Modified: geronimo/branches/v1_0_M4-QA/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java
Wed Jul 13 15:54:33 2005
@@ -45,7 +45,7 @@
     public synchronized GBeanData getGBeanInstance(ObjectName name) throws GBeanNotFoundException
{
         GBeanData gbeanData = (GBeanData) registry.get(name);
         if (gbeanData == null) {
-            throw new GBeanNotFoundException(name.getCanonicalName());
+            throw new GBeanNotFoundException(name);
         }
         return gbeanData;
     }

Modified: geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Wed Jul 13 15:54:33 2005
@@ -323,7 +323,7 @@
         synchronized (this) {
             if (dead) {
                 // someone beat us to the punch... this instance should have never been found
in the first place
-                throw new GBeanNotFoundException(name);
+                throw new GBeanNotFoundException(objectName);
             }
             dead = true;
         }

Modified: geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
Wed Jul 13 15:54:33 2005
@@ -16,22 +16,26 @@
  */
 package org.apache.geronimo.kernel;
 
+import javax.management.ObjectName;
+
+
 /**
  * @version $Rev$ $Date$
  */
 public class GBeanNotFoundException extends KernelException {
-    public GBeanNotFoundException() {
-    }
+    private ObjectName gBeanName;
 
-    public GBeanNotFoundException(String message) {
-        super(message);
+    public GBeanNotFoundException(ObjectName gBeanName) {
+        super(gBeanName+" not found");
+        this.gBeanName = gBeanName;
     }
 
-    public GBeanNotFoundException(String message, Throwable cause) {
-        super(message, cause);
+    public GBeanNotFoundException(ObjectName gBeanName, Throwable cause) {
+        super(gBeanName+" not found", cause);
+        this.gBeanName = gBeanName;
     }
 
-    public GBeanNotFoundException(Throwable cause) {
-        super(cause);
+    public ObjectName getGBeanName() {
+        return gBeanName;
     }
 }

Modified: geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
Wed Jul 13 15:54:33 2005
@@ -23,6 +23,7 @@
 import java.util.Iterator;
 
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
@@ -87,7 +88,11 @@
      */
     public synchronized void unregister(GBeanName name) throws GBeanNotFoundException, InternalKernelException
{
         if (registry.remove(name) == null) {
-            throw new GBeanNotFoundException("No GBean registered: " + name);
+            try {
+                throw new GBeanNotFoundException(name.getObjectName());
+            } catch (MalformedObjectNameException e) {
+                throw new InternalKernelException(e);
+            }
         }
     }
 
@@ -101,7 +106,11 @@
     public synchronized GBeanInstance getGBeanInstance(GBeanName name) throws GBeanNotFoundException
{
         GBeanInstance instance = (GBeanInstance) registry.get(name);
         if (instance == null) {
-            throw new GBeanNotFoundException("No GBean registered: " + name);
+            try {
+                throw new GBeanNotFoundException(name.getObjectName());
+            } catch (MalformedObjectNameException e) {
+                throw new InternalKernelException(e);
+            }
         }
         return instance;
     }

Modified: geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanServerDelegate.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanServerDelegate.java?rev=216281&r1=216280&r2=216281&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanServerDelegate.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanServerDelegate.java
Wed Jul 13 15:54:33 2005
@@ -118,7 +118,10 @@
         } catch (NoSuchOperationException e) {
             throw new ReflectionException(new NoSuchMethodException(e.getMessage()));
         } catch (GBeanNotFoundException e) {
-            throw new InstanceNotFoundException(name.getCanonicalName());
+            if(name.equals(e.getGBeanName())) {
+                throw new InstanceNotFoundException(name.getCanonicalName());
+            }
+            throw new MBeanException(e);
         } catch (InternalKernelException e) {
             throw new MBeanException(unwrapInternalKernelException(e));
         } catch (Exception e) {



Mime
View raw message