geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r392164 - in /geronimo/branches/1.1/modules: deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/ deploy-tool/src/java/org/apache/geronimo/deployment/cli/ kernel/src/java/org/apache/geronimo/kernel/
Date Fri, 07 Apr 2006 02:38:31 GMT
Author: ammulder
Date: Thu Apr  6 19:38:29 2006
New Revision: 392164

URL: http://svn.apache.org/viewcvs?rev=392164&view=rev
Log:
Work on fixing JSR-88 and the deploy tool

Modified:
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
    geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
    geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployUtils.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java

Modified: geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java?rev=392164&r1=392163&r2=392164&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
(original)
+++ geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
Thu Apr  6 19:38:29 2006
@@ -113,7 +113,9 @@
             listeners.add(pol);
             event = this.event;
         }
-        pol.handleProgressEvent(event);
+        if(event != null) {
+            pol.handleProgressEvent(event);
+        }
     }
 
     public synchronized void removeProgressListener(ProgressListener pol) {

Modified: geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java?rev=392164&r1=392163&r2=392164&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
(original)
+++ geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
Thu Apr  6 19:38:29 2006
@@ -37,10 +37,10 @@
 import java.net.URI;
 
 /**
- * @version $Rev: 383519 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class RedeployCommand extends AbstractDeployCommand {
-    private static final String[] UNINSTALL_SIG = {URI.class.getName()};
+    private static final String[] UNINSTALL_SIG = {Artifact.class.getName()};
     private final TargetModuleID[] modules;
 
     public RedeployCommand(Kernel kernel, TargetModuleID[] moduleIDList, File moduleArchive,
File deploymentPlan) {
@@ -76,14 +76,16 @@
                     TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
 
                     Artifact configID = Artifact.create(module.getModuleID());
-                    AbstractName configName = Configuration.getConfigurationAbstractName(configID);
                     try {
-                        kernel.stopGBean(configName);
+                        configurationManager.stopConfiguration(configID);
                         updateStatus("Stopped "+configID);
-                    } catch (GBeanNotFoundException e) {
-                        if(e.getGBeanName().equals(configName)) {
-                            // The module isn't running -- that's OK
-                        } else throw e;
+                    } catch (InternalKernelException e) {
+                        Exception cause = (Exception)e.getCause();
+                        if(cause instanceof NoSuchConfigException) {
+                            // The modules isn't loaded -- that's OK
+                        } else {
+                            throw cause;
+                        }
                     }
                     try {
                         configurationManager.unloadConfiguration(configID);

Modified: geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java?rev=392164&r1=392163&r2=392164&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
(original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
Thu Apr  6 19:38:29 2006
@@ -63,7 +63,7 @@
         }
         DeploymentManager mgr = connection.getDeploymentManager();
         Target[] allTargets = mgr.getTargets();
-        TargetModuleID[] allModules = new TargetModuleID[0];
+        TargetModuleID[] allModules;
         try {
             allModules = mgr.getAvailableModules(null, allTargets);
         } catch(TargetException e) {
@@ -80,14 +80,8 @@
             throw new DeploymentException("Cannot read file "+test.getAbsolutePath());
         }
         if(DeployUtils.isJarFile(test) || test.isDirectory()) {
-            if(module != null) {
-                throw new DeploymentSyntaxException("Module and plan cannot both be JAR files
or directories!");
-            }
             module = test;
         } else {
-            if(plan != null) {
-                throw new DeploymentSyntaxException("Module or plan must be a JAR file or
directory!");
-            }
             plan = test;
         }
         if(args.length > 1) { // Guess whether the second argument is a module, plan,
ModuleID, or TargetModuleID

Modified: geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployUtils.java?rev=392164&r1=392163&r2=392164&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployUtils.java
(original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/DeployUtils.java
Thu Apr  6 19:38:29 2006
@@ -23,6 +23,7 @@
 import java.util.Collection;
 import java.util.List;
 import java.util.LinkedList;
+import java.util.Stack;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.xml.sax.InputSource;
@@ -266,11 +267,47 @@
 
     private static class ConfigIdHandler extends DefaultHandler {
         private String configId;
+        private boolean inConfigId;
+        private String groupId = "", artifactId = "", version = "", type = "";
+        private String inElement = null;
+        private Stack parent = new Stack();
 
         public void startElement(String uri, String localName, String qName, Attributes attributes)
throws SAXException {
-            if(configId == null) {
-                configId = attributes.getValue("configId");
+            if(inConfigId) {
+                if(localName.equals("groupId") || localName.equals("artifactId") || localName.equals("version")
|| localName.equals("type")) {
+                    inElement = localName;
+                }
+            } else {
+                if(parent.size() == 2 && localName.equals("configId")) {
+                    inConfigId = true; // only document/environment/configId, not e.g. configId
in nested plan in EAR
+                }
+            }
+            parent.push(localName);
+        }
+
+        public void characters(char ch[], int start, int length) throws SAXException {
+            if(inElement != null) {
+                if(inElement.equals("groupId")) groupId += new String(ch, start, length);
+                else if(inElement.equals("artifactId")) artifactId += new String(ch, start,
length);
+                else if(inElement.equals("version")) version += new String(ch, start, length);
+                else if(inElement.equals("type")) type += new String(ch, start, length);
             }
+        }
+
+        public void endElement(String uri, String localName, String qName) throws SAXException
{
+            inElement = null;
+            if(inConfigId && localName.equals("configId")) {
+                inConfigId = false;
+            }
+            if(parent.peek().equals(localName)) {
+                parent.pop();
+            } else {
+                throw new IllegalStateException("End of "+localName+" but expecting "+parent.peek());
+            }
+        }
+
+        public void endDocument() throws SAXException {
+            configId = groupId+"/"+artifactId+"/"+version+"/"+type;
         }
     }
 }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java?rev=392164&r1=392163&r2=392164&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
(original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/GBeanNotFoundException.java
Thu Apr  6 19:38:29 2006
@@ -29,6 +29,7 @@
  */
 public class GBeanNotFoundException extends KernelException {
     private ObjectName gBeanName;
+    private AbstractName abstractName;
 
     public GBeanNotFoundException(ObjectName gBeanName) {
         super(gBeanName+" not found");
@@ -42,6 +43,7 @@
 
     public GBeanNotFoundException(AbstractName abstractName) {
         super(abstractName + " not found");
+        this.abstractName = abstractName;
     }
 
     public GBeanNotFoundException(String message, Set patterns) {
@@ -54,5 +56,17 @@
 
     public ObjectName getGBeanName() {
         return gBeanName;
+    }
+
+    public AbstractName getAbstractName() {
+        return abstractName;
+    }
+
+    public boolean isGBeanName() {
+        return gBeanName != null;
+    }
+
+    public boolean isAbstractName() {
+        return abstractName != null;
     }
 }



Mime
View raw message