Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 28591 invoked from network); 18 Apr 2006 02:49:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Apr 2006 02:49:52 -0000 Received: (qmail 73574 invoked by uid 500); 18 Apr 2006 02:49:52 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 73566 invoked by uid 500); 18 Apr 2006 02:49:52 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 73555 invoked by uid 99); 18 Apr 2006 02:49:51 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Apr 2006 19:49:51 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 17 Apr 2006 19:49:50 -0700 Received: (qmail 28481 invoked by uid 65534); 18 Apr 2006 02:49:29 -0000 Message-ID: <20060418024929.28479.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r394827 - in /geronimo/branches/1.1/modules/system/src: java/org/apache/geronimo/system/configuration/ schema/ Date: Tue, 18 Apr 2006 02:49:28 -0000 To: scm@geronimo.apache.org From: ammulder@apache.org X-Mailer: svnmailer-1.0.8 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: ammulder Date: Mon Apr 17 19:49:26 2006 New Revision: 394827 URL: http://svn.apache.org/viewcvs?rev=394827&view=rev Log: Support for upgrade lists, obsoletes, etc. As an example, now you can upgrade a minimal tomcat server to a J2EE tomcat server with one command. Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationMetadata.java geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/DownloadPoller.java geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/DownloadResults.java geronimo/branches/1.1/modules/system/src/schema/config-list.xsd Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java?rev=394827&r1=394826&r2=394827&view=diff ============================================================================== --- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java (original) +++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigInstallerGBean.java Mon Apr 17 19:49:26 2006 @@ -34,6 +34,7 @@ import java.util.Map; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.jar.JarFile; import java.util.jar.JarEntry; import javax.security.auth.login.FailedLoginException; @@ -193,13 +194,18 @@ return new ConfigurationList(repo, backupURLs, data); } - private ConfigurationMetadata processConfiguration(Element config) { + private ConfigurationMetadata processConfiguration(Element config) throws SAXException { String configId = getChildText(config, "config-id"); NodeList licenseNodes = config.getElementsByTagName("license"); ConfigurationMetadata.License[] licenses = new ConfigurationMetadata.License[licenseNodes.getLength()]; for(int j=0; j"); + } Artifact artifact = Artifact.create(originalConfigId.replaceAll("\\*", "")); boolean present = resolver.queryArtifacts(artifact).length > 0; prereqs[j] = new ConfigurationMetadata.Prerequisite(artifact, present, @@ -222,6 +231,9 @@ boolean match = false; for (int j = 0; j < gerVersions.length; j++) { String gerVersion = gerVersions[j]; + if(gerVersion == null || gerVersion.equals("")) { + throw new SAXException("geronimo-version should not be empty!"); + } if(gerVersion.equals(version)) { match = true; break; @@ -235,6 +247,9 @@ boolean match = false; for (int j = 0; j < jvmVersions.length; j++) { String jvmVersion = jvmVersions[j]; + if(jvmVersion == null || jvmVersion.equals("")) { + throw new SAXException("jvm-version should not be empty!"); + } if(version.startsWith(jvmVersion)) { match = true; break; @@ -242,8 +257,12 @@ } if(!match) eligible = false; } - Artifact artifact = Artifact.create(configId); - boolean installed = configManager.isLoaded(artifact); + Artifact artifact = null; + boolean installed = false; + if (configId != null) { + artifact = Artifact.create(configId); + installed = configManager.isLoaded(artifact); + } log.trace("Checking "+configId+": installed="+installed+", eligible="+eligible); ConfigurationMetadata data = new ConfigurationMetadata(artifact, getChildText(config, "name"), getChildText(config, "description"), getChildText(config, "category"), installed, eligible); @@ -251,7 +270,19 @@ data.setJvmVersions(jvmVersions); data.setLicenses(licenses); data.setPrerequisites(prereqs); - data.setDependencies(getChildrenText(config, "dependency")); + NodeList list = config.getElementsByTagName("dependency"); + List start = new ArrayList(); + String deps[] = new String[list.getLength()]; + for(int i=0; i - + The Geronimo configId for this configuration, which uniquely identifies - it, and also is used to construct a path to download it if necessary + it, and also is used to construct a path to download it if necessary. + + If no config-id is provided, that means this is a plugin group, which is + just a list of other plugins to install. The prerequisites must still be + met, but then the dependencies listed for this configuration will be + treated as the list of actual configuraitons to install. NOTE: for plugin + lists, each of the dependencies must be a full config-id; entries without + a version number for example will not work. @@ -234,6 +241,28 @@ + + + + The configId of another configuration that this configuration replaces. + That can be used, for example, to replace a less functional configuration + with a more functional one, or to upgrade a component to a newer version. + + This is applied as an exact match, except that the version number may be + omitted, in which case any matching version of the configuration will be + replaced. Be aware that omitting the version number may cause a + configuration to be downgraded, so you may choose to explicitly list all + lesser versions. That may not be desirable either, though. If the + server has foo-1.0.2 installed and you install foo-1.0.1, would you + rather have it downgrade or end up with both installed? + + NOTE: currently the "obsoletes" entries are only processed on the + configuration(s) passed directly to the ConfigurationInstaller (not on + dependencies that are brought down as a result). That means that a + plugin group must list obsoletes for all its components, etc. + + + @@ -261,6 +290,34 @@ + + + + See configurationType/dependency above + + + + + + + + + Normally when a configuration dependency is installed it will not + be started. The user may be prompted to start the configuration + with whatever tool kicked off the install to begin with. + + This attribute may be set to "true" to force the dependency to + be started after it is installed. NOTE: this currently only + affects the dependencies of the configurations actually passed to + the Configuration Installer (not nested dependencies). This + means it's primarily useful for plugin lists. + + + + + + + @@ -280,7 +337,7 @@ - + Describes the type of resource that the prerequisite is. Examples @@ -309,7 +366,7 @@ - + A description for the user about why this is a prerequisite and what