geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r394396 - in /geronimo/branches/1.1: modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/ modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/ modules/deploy-tool/src/java/org/apache/geronimo/deploy...
Date Sat, 15 Apr 2006 23:07:19 GMT
Author: gdamour
Date: Sat Apr 15 16:07:17 2006
New Revision: 394396

URL: http://svn.apache.org/viewcvs?rev=394396&view=rev
Log:
in-place deployment progress: the distribute command supports a "--inPlace" switch indicating
that the configuration is to be deployed "in-place".

I have successfully deployed the geronimo/webconsole-jetty/1.1-SNAPSHOT/car configuration
in-place and "exploded" (EAR and WAR modules exploded). 

Added:
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/CommandContext.java
Modified:
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
    geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
    geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
    geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/InPlaceEARContext.java
    geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java

Added: geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/CommandContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/CommandContext.java?rev=394396&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/CommandContext.java
(added)
+++ geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/CommandContext.java
Sat Apr 15 16:07:17 2006
@@ -0,0 +1,81 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.deployment.plugin.jmx;
+
+
+/**
+ * @version $Rev: 355877 $ $Date: 2005-12-11 13:48:27 +1100 (Sun, 11 Dec 2005) $
+ */
+public class CommandContext {
+    private boolean logErrors;
+    private boolean verbose;
+    private String username;
+    private String password;
+    private boolean inPlace;
+
+    public CommandContext(boolean logErrors,
+            boolean verbose,
+            String username,
+            String password,
+            boolean inPlace) {
+        this.logErrors = logErrors;
+        this.verbose = verbose;
+        this.username = username;
+        this.password = password;
+        this.inPlace = inPlace;
+    }
+
+    public boolean isLogErrors() {
+        return logErrors;
+    }
+
+    public void setLogErrors(boolean logErrors) {
+        this.logErrors = logErrors;
+    }
+
+    public boolean isVerbose() {
+        return verbose;
+    }
+
+    public void setVerbose(boolean verbose) {
+        this.verbose = verbose;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public boolean isInPlace() {
+        return inPlace;
+    }
+
+    public void setInPlace(boolean inPlace) {
+        this.inPlace = inPlace;
+    }
+}
\ No newline at end of file

Modified: geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
(original)
+++ geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
Sat Apr 15 16:07:17 2006
@@ -64,7 +64,7 @@
     protected void initialize(Kernel kernel) {
         this.kernel = kernel;
         configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-        commandContext = new CommandContext(true, true, null, null);
+        commandContext = new CommandContext(true, true, null, null, false);
     }
 
     public void setAuthentication(String username, String password) {
@@ -318,50 +318,8 @@
         commandContext.setLogErrors(shouldLog);
         commandContext.setVerbose(verboseStatus);
     }
-
-    public static class CommandContext {
-        private boolean logErrors;
-        private boolean verbose;
-        private String username;
-        private String password;
-
-        private CommandContext(boolean logErrors, boolean verbose, String username, String
password) {
-            this.logErrors = logErrors;
-            this.verbose = verbose;
-            this.username = username;
-            this.password = password;
-        }
-
-        public boolean isLogErrors() {
-            return logErrors;
-        }
-
-        public void setLogErrors(boolean logErrors) {
-            this.logErrors = logErrors;
-        }
-
-        public boolean isVerbose() {
-            return verbose;
-        }
-
-        public void setVerbose(boolean verbose) {
-            this.verbose = verbose;
-        }
-
-        private void setUsername(String username) {
-            this.username = username;
-        }
-
-        private void setPassword(String password) {
-            this.password = password;
-        }
-
-        public String getUsername() {
-            return username;
-        }
-
-        public String getPassword() {
-            return password;
-        }
+    
+    public void setInPlace(boolean inPlace) {
+        commandContext.setInPlace(inPlace);
     }
 }

Modified: geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
(original)
+++ geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/RemoteDeploymentManager.java
Sat Apr 15 16:07:17 2006
@@ -25,11 +25,12 @@
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.Set;
+
 import javax.enterprise.deploy.spi.Target;
 import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.management.MBeanServerConnection;
 import javax.management.remote.JMXConnector;
-import org.apache.geronimo.deployment.plugin.GeronimoDeploymentManager;
+
 import org.apache.geronimo.deployment.plugin.local.DistributeCommand;
 import org.apache.geronimo.deployment.plugin.local.RedeployCommand;
 import org.apache.geronimo.gbean.AbstractName;
@@ -44,7 +45,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class RemoteDeploymentManager extends JMXDeploymentManager implements GeronimoDeploymentManager
{
+public class RemoteDeploymentManager extends JMXDeploymentManager {
     private JMXConnector jmxConnector;
     private boolean isSameMachine;
 

Modified: geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
(original)
+++ geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
Sat Apr 15 16:07:17 2006
@@ -42,7 +42,7 @@
     private final static String DEPLOYER_NAME = "*:name=Deployer,j2eeType=Deployer,*";
 
     protected final Kernel kernel;
-    private static final String[] DEPLOY_SIG = {File.class.getName(), File.class.getName()};
+    private static final String[] DEPLOY_SIG = {boolean.class.getName(), File.class.getName(),
File.class.getName()};
     protected final boolean spool;
     protected File moduleArchive;
     protected File deploymentPlan;
@@ -103,7 +103,8 @@
     protected void doDeploy(Target target, boolean finished) throws Exception {
         File[] args = {moduleArchive, deploymentPlan};
         massageFileNames(args);
-        List objectNames = (List) kernel.invoke(deployer, "deploy", args, DEPLOY_SIG);
+        Object deployParams[] = new Object[] {Boolean.valueOf(commandContext.isInPlace()),
args[0], args[1]};
+        List objectNames = (List) kernel.invoke(deployer, "deploy", deployParams, DEPLOY_SIG);
         if (objectNames == null || objectNames.isEmpty()) {
             throw new DeploymentException("Server didn't deploy anything");
         }

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=394396&r1=394395&r2=394396&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
Sat Apr 15 16:07:17 2006
@@ -18,7 +18,7 @@
 package org.apache.geronimo.deployment.plugin.local;
 
 import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
-import org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager.CommandContext;
+import org.apache.geronimo.deployment.plugin.jmx.CommandContext;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.InternalKernelException;
@@ -60,7 +60,7 @@
     private String message;
     private final Set listeners = new HashSet();
     private final List moduleIDs = new ArrayList();
-    private CommandContext commandContext = null; //todo: this is pretty bad; should add
it into constructor
+    protected CommandContext commandContext = null; //todo: this is pretty bad; should add
it into constructor
 
     private ProgressEvent event = null;
 

Modified: geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
(original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
Sat Apr 15 16:07:17 2006
@@ -17,18 +17,20 @@
 
 package org.apache.geronimo.deployment.cli;
 
-import org.apache.geronimo.common.DeploymentException;
-
-import javax.enterprise.deploy.spi.DeploymentManager;
-import javax.enterprise.deploy.spi.Target;
-import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.status.ProgressObject;
 import java.io.File;
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.StringTokenizer;
 
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager;
+
 /**
  * The CLI deployer logic to distribute.
  *
@@ -53,7 +55,16 @@
         super(command, group, helpArgumentList, helpText);
     }
 
-    protected ProgressObject runCommand(DeploymentManager mgr, PrintWriter out, Target[]
tlist, File module, File plan) throws DeploymentException {
+    protected ProgressObject runCommand(DeploymentManager mgr, PrintWriter out, boolean inPlace,
Target[] tlist, File module, File plan) throws DeploymentException {
+        if (inPlace) {
+            if (false == mgr instanceof JMXDeploymentManager) {
+                throw new DeploymentSyntaxException(
+                        "Target DeploymentManager is not a Geronimo one. \n" +
+                        "Cannot perform in-place deployment.");
+            }
+            JMXDeploymentManager jmxMgr = (JMXDeploymentManager) mgr;
+            jmxMgr.setInPlace(true);
+        }
         return mgr.distribute(tlist, module, plan);
     }
 
@@ -121,12 +132,12 @@
         if(targets.size() > 0) {
             Target[] tlist = identifyTargets(targets, mgr);
             multipleTargets = tlist.length > 1;
-            po = runCommand(mgr, out, tlist, module, plan);
+            po = runCommand(mgr, out, inPlace, tlist, module, plan);
             waitForProgress(out, po);
         } else {
             final Target[] tlist = mgr.getTargets();
             multipleTargets = tlist.length > 1;
-            po = runCommand(mgr, out, tlist, module, plan);
+            po = runCommand(mgr, out, inPlace, tlist, module, plan);
             waitForProgress(out, po);
         }
 

Modified: geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
(original)
+++ geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Sat Apr 15 16:07:17 2006
@@ -80,7 +80,7 @@
         t.start();
     }
 
-    public List deploy(File moduleFile, File planFile) throws DeploymentException {
+    public List deploy(boolean inPlace, File moduleFile, File planFile) throws DeploymentException
{
         File originalModuleFile = moduleFile;
         File tmpDir = null;
         if (moduleFile != null && !moduleFile.isDirectory()) {
@@ -101,7 +101,7 @@
         }
 
         try {
-            return deploy(planFile, moduleFile, null, true, null, null, null, null);
+            return deploy(inPlace, planFile, moduleFile, null, true, null, null, null, null);
         } catch (DeploymentException e) {
             log.debug("Deployment failed: plan=" + planFile +", module=" + originalModuleFile,
e);
             throw e.cleanse();
@@ -196,9 +196,7 @@
         return null;
     }
 
-    public List deploy(File planFile, File moduleFile, File targetFile, boolean install,
String mainClass, String classPath, String endorsedDirs, String extensionDirs) throws DeploymentException
{
-        boolean inPlaceConfiguration = false;
-    	
+    public List deploy(boolean inPlace, File planFile, File moduleFile, File targetFile,
boolean install, String mainClass, String classPath, String endorsedDirs, String extensionDirs)
throws DeploymentException {
         if (planFile == null && moduleFile == null) {
             throw new DeploymentException("No plan or module specified");
         }
@@ -214,7 +212,7 @@
 
         JarFile module = null;
         if (moduleFile != null) {
-            if (inPlaceConfiguration && !moduleFile.isDirectory()) {
+            if (inPlace && !moduleFile.isDirectory()) {
                 throw new DeploymentException("In place deployment is not allowed for packed
module");
             }
             if (!moduleFile.exists()) {
@@ -282,7 +280,7 @@
             }
             ConfigurationStore store = (ConfigurationStore) stores.iterator().next();
             // It's our responsibility to close this context, once we're done with it...
-            DeploymentContext context = builder.buildConfiguration(inPlaceConfiguration,
plan, module, stores, store);
+            DeploymentContext context = builder.buildConfiguration(inPlace, plan, module,
stores, store);
             List configurations = new ArrayList();
             configurations.add(context.getConfigurationData());
             configurations.addAll(context.getAdditionalDeployment());
@@ -422,8 +420,8 @@
 
         infoFactory.addAttribute("kernel", Kernel.class, false);
         infoFactory.addAttribute("remoteDeployUploadURL", String.class, false);
-        infoFactory.addOperation("deploy", new Class[]{File.class, File.class});
-        infoFactory.addOperation("deploy", new Class[]{File.class, File.class, File.class,
boolean.class, String.class, String.class, String.class, String.class});
+        infoFactory.addOperation("deploy", new Class[]{boolean.class, File.class, File.class});
+        infoFactory.addOperation("deploy", new Class[]{boolean.class, File.class, File.class,
File.class, boolean.class, String.class, String.class, String.class, String.class});
 
         infoFactory.addReference("Builders", ConfigurationBuilder.class, "ConfigBuilder");
         infoFactory.addReference("Store", ConfigurationStore.class, "ConfigurationStore");

Modified: geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
(original)
+++ geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/util/DeploymentUtil.java
Sat Apr 15 16:07:17 2006
@@ -156,6 +156,19 @@
     }
 
     public static URL createJarURL(JarFile jarFile, String path) throws MalformedURLException
{
+        if (jarFile instanceof NestedJarFile) {
+            NestedJarFile nestedJar = (NestedJarFile) jarFile;
+            if (nestedJar.isUnpacked()) {
+                JarFile baseJar = nestedJar.getBaseJar();
+                String basePath = nestedJar.getBasePath();
+                if (baseJar instanceof UnpackedJarFile) {
+                    File baseDir = ((UnpackedJarFile) baseJar).getBaseDir();
+                    baseDir = new File(baseDir, basePath);
+                    return new File(baseDir, path).toURL();
+                }
+            }
+        }
+        
         if (jarFile instanceof UnpackedJarFile) {
             File baseDir = ((UnpackedJarFile) jarFile).getBaseDir();
             return new File(baseDir, path).toURL();

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
(original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Sat Apr 15 16:07:17 2006
@@ -391,7 +391,16 @@
             if (ConfigurationModuleType.EAR == applicationType && earFile != null)
{
                 for (Enumeration e = earFile.entries(); e.hasMoreElements();) {
                     ZipEntry entry = (ZipEntry) e.nextElement();
-                    if (!moduleLocations.contains(entry.getName())) {
+                    String entryName = entry.getName();
+                    boolean addEntry = true;
+                    for (Iterator iter = moduleLocations.iterator(); iter.hasNext();) {
+                        String location = (String) iter.next();
+                        if (entryName.startsWith(location)) {
+                            addEntry = false;
+                            break;
+                        }
+                    }
+                    if (addEntry) {
                         earContext.addFile(URI.create(entry.getName()), earFile, entry);
                     }
                 }

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
(original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
Sat Apr 15 16:07:17 2006
@@ -83,16 +83,7 @@
     }
 
     public EARContext(File baseDir, Environment environment, ConfigurationModuleType moduleType,
AbstractName baseName, EARContext parent) throws DeploymentException {
-        super(baseDir, null, environment, moduleType, parent.getNaming(), parent.getConfigurationManager());
-        moduleName = baseName;
-        this.serverName = parent.getServerName();
-
-        this.transactionContextManagerObjectName = parent.getTransactionContextManagerObjectName();
-        this.connectionTrackerObjectName = parent.getConnectionTrackerObjectName();
-        this.transactedTimerName = parent.getTransactedTimerName();
-        this.nonTransactedTimerName = parent.getNonTransactedTimerName();
-        this.corbaGBeanObjectName = parent.getCORBAGBeanObjectName();
-        this.refContext = parent.getRefContext();
+        this(baseDir, null, environment, moduleType, baseName, parent);
     }
 
     protected EARContext(File baseDir, File inPlaceConfigurationDir, Environment environment,
ConfigurationModuleType moduleType, Naming naming, Collection repositories, Collection configurationStores,
AbstractNameQuery serverName, AbstractName baseName, AbstractNameQuery transactionContextManagerObjectName,
AbstractNameQuery connectionTrackerObjectName, AbstractNameQuery transactedTimerName, AbstractNameQuery
nonTransactedTimerName, AbstractNameQuery corbaGBeanObjectName, RefContext refContext) throws
DeploymentException {
@@ -109,6 +100,18 @@
         this.refContext = refContext;
     }
 
+    protected EARContext(File baseDir, File inPlaceConfigurationDir, Environment environment,
ConfigurationModuleType moduleType, AbstractName baseName, EARContext parent) throws DeploymentException
{
+        super(baseDir, inPlaceConfigurationDir, environment, moduleType, parent.getNaming(),
parent.getConfigurationManager());
+        moduleName = baseName;
+        this.serverName = parent.getServerName();
+
+        this.transactionContextManagerObjectName = parent.getTransactionContextManagerObjectName();
+        this.connectionTrackerObjectName = parent.getConnectionTrackerObjectName();
+        this.transactedTimerName = parent.getTransactedTimerName();
+        this.nonTransactedTimerName = parent.getNonTransactedTimerName();
+        this.corbaGBeanObjectName = parent.getCORBAGBeanObjectName();
+        this.refContext = parent.getRefContext();
+    }
     
     public AbstractNameQuery getServerName() {
         return serverName;

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/InPlaceEARContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/InPlaceEARContext.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/InPlaceEARContext.java
(original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/InPlaceEARContext.java
Sat Apr 15 16:07:17 2006
@@ -36,7 +36,21 @@
  * @version $Rev:386276 $ $Date: 2006-03-25 13:13:46 +1100 (Sat, 25 Mar 2006) $
  */
 public class InPlaceEARContext extends EARContext {
-	
+
+    public InPlaceEARContext(File baseDir, 
+            File inPlaceConfigurationDir, 
+            Environment environment, 
+            ConfigurationModuleType moduleType, 
+            AbstractName baseName, 
+            EARContext parent) throws DeploymentException {
+        super(baseDir,
+                inPlaceConfigurationDir,
+                environment,
+                moduleType,
+                baseName,
+                parent);
+    }
+
     public InPlaceEARContext(File baseDir,
     		File inPlaceConfigurationDir,
     		Environment environment,

Modified: geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Sat Apr 15 16:07:17 2006
@@ -17,6 +17,32 @@
 
 package org.apache.geronimo.jetty.deployment;
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.jar.JarFile;
+
+import javax.management.ObjectName;
+import javax.servlet.Servlet;
+import javax.transaction.UserTransaction;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
@@ -27,21 +53,21 @@
 import org.apache.geronimo.deployment.xbeans.GbeanType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.jetty.JettyDefaultServletHolder;
 import org.apache.geronimo.jetty.JettyFilterHolder;
 import org.apache.geronimo.jetty.JettyFilterMapping;
 import org.apache.geronimo.jetty.JettyServletHolder;
 import org.apache.geronimo.jetty.JettyWebAppContext;
-import org.apache.geronimo.jetty.JettyDefaultServletHolder;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
@@ -88,32 +114,6 @@
 import org.mortbay.http.ClientCertAuthenticator;
 import org.mortbay.http.DigestAuthenticator;
 import org.mortbay.jetty.servlet.FormAuthenticator;
-
-import javax.servlet.Servlet;
-import javax.transaction.UserTransaction;
-import javax.management.ObjectName;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.Permission;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.jar.JarFile;
 
 
 /**

Modified: geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
Sat Apr 15 16:07:17 2006
@@ -16,11 +16,35 @@
  */
 package org.apache.geronimo.web.deployment;
 
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.jar.JarFile;
+import java.util.zip.ZipEntry;
+
+import javax.security.jacc.WebResourcePermission;
+import javax.security.jacc.WebRoleRefPermission;
+import javax.security.jacc.WebUserDataPermission;
+
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
-import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.InPlaceEARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -45,28 +69,6 @@
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
 import org.apache.geronimo.xbeans.j2ee.WebResourceCollectionType;
 
-import javax.security.jacc.WebResourcePermission;
-import javax.security.jacc.WebRoleRefPermission;
-import javax.security.jacc.WebUserDataPermission;
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.security.Permission;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Collection;
-import java.util.jar.JarFile;
-import java.util.zip.ZipEntry;
-
 /**
  * @version $Rev$ $Date$
  */
@@ -178,11 +180,20 @@
 
             // construct the web app deployment context... this is the same class used by
the ear context
             try {
-                moduleContext = new EARContext(configurationDir,
-                        environment,
-                        ConfigurationModuleType.WAR,
-                        module.getModuleName(),
-                        earContext);
+                if (null != earContext.getInPlaceConfigurationDir()) {
+                    moduleContext = new InPlaceEARContext(configurationDir,
+                            new File(earContext.getInPlaceConfigurationDir(), module.getTargetPath()),
+                            environment,
+                            ConfigurationModuleType.WAR,
+                            module.getModuleName(),
+                            earContext);
+                } else {
+                    moduleContext = new EARContext(configurationDir,
+                            environment,
+                            ConfigurationModuleType.WAR,
+                            module.getModuleName(),
+                            earContext);
+                }
             } catch (DeploymentException e) {
                 DeploymentUtil.recursiveDelete(configurationDir);
                 throw e;

Modified: geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java?rev=394396&r1=394395&r2=394396&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
(original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
Sat Apr 15 16:07:17 2006
@@ -59,6 +59,7 @@
     private static Kernel kernel;
 
     private static final String[] ARG_TYPES = {
+            boolean.class.getName(),
             File.class.getName(),
             File.class.getName(),
             File.class.getName(),
@@ -409,7 +410,7 @@
 
     private List invokeDeployer(Kernel kernel, AbstractName deployer) throws Exception {
         boolean isExecutable = mainClass != null;
-        Object[] args = {planFile, moduleFile, isExecutable ? packageFile : null, Boolean.valueOf(!isExecutable),
mainClass, classPath, endorsedDirs, extensionDirs};
+        Object[] args = {Boolean.FALSE, planFile, moduleFile, isExecutable ? packageFile
: null, Boolean.valueOf(!isExecutable), mainClass, classPath, endorsedDirs, extensionDirs};
         return (List) kernel.invoke(deployer, "deploy", args, ARG_TYPES);
     }
 }



Mime
View raw message