Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 25612 invoked from network); 30 Apr 2006 03:44:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Apr 2006 03:44:38 -0000 Received: (qmail 79281 invoked by uid 500); 30 Apr 2006 03:44:38 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 79252 invoked by uid 500); 30 Apr 2006 03:44:37 -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 79240 invoked by uid 99); 30 Apr 2006 03:44:37 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Apr 2006 20:44:37 -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; Sat, 29 Apr 2006 20:44:37 -0700 Received: (qmail 25551 invoked by uid 65534); 30 Apr 2006 03:44:16 -0000 Message-ID: <20060430034416.25550.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r398278 - in /geronimo/branches/1.1/modules: deployment/src/test/org/apache/geronimo/deployment/ kernel/src/java/org/apache/geronimo/kernel/config/ Date: Sun, 30 Apr 2006 03:44:15 -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: Sat Apr 29 20:44:14 2006 New Revision: 398278 URL: http://svn.apache.org/viewcvs?rev=398278&view=rev Log: Add child configurations to ConfigurationInfo Modified: geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationInfo.java geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java Modified: geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java?rev=398278&r1=398277&r2=398278&view=diff ============================================================================== --- geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java (original) +++ geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java Sat Apr 29 20:44:14 2006 @@ -134,7 +134,7 @@ touch(watchFile1, NOW); touch(watchFile2, NOW); - existingConfigurationInfos.add(new ConfigurationInfo(null, NEW_ID, ConfigurationModuleType.CAR, PAST, null, dir)); + existingConfigurationInfos.add(new ConfigurationInfo(null, NEW_ID, ConfigurationModuleType.CAR, PAST, null, null, dir)); SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir, watchPaths, @@ -158,7 +158,7 @@ touch(watchFile1, NOW); touch(watchFile2, NOW); - existingConfigurationInfos.add(new ConfigurationInfo(null, DIFFERENT_ID, ConfigurationModuleType.CAR, PAST, null, dir)); + existingConfigurationInfos.add(new ConfigurationInfo(null, DIFFERENT_ID, ConfigurationModuleType.CAR, PAST, null, null, dir)); SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir, watchPaths, @@ -182,7 +182,7 @@ touch(watchFile1, NOW); touch(watchFile2, NOW); - existingConfigurationInfos.add(new ConfigurationInfo(null, OLD_VERSION_ID, ConfigurationModuleType.CAR, PAST, null, dir)); + existingConfigurationInfos.add(new ConfigurationInfo(null, OLD_VERSION_ID, ConfigurationModuleType.CAR, PAST, null, null, dir)); SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir, watchPaths, @@ -206,7 +206,7 @@ touch(watchFile1, PAST); touch(watchFile2, PAST); - existingConfigurationInfos.add(new ConfigurationInfo(null, NEW_ID, ConfigurationModuleType.CAR, NOW, null, dir)); + existingConfigurationInfos.add(new ConfigurationInfo(null, NEW_ID, ConfigurationModuleType.CAR, NOW, null, null, dir)); SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir, watchPaths, @@ -230,7 +230,7 @@ touch(watchFile1, PAST); touch(watchFile2, PAST); - existingConfigurationInfos.add(new ConfigurationInfo(null, OLD_VERSION_ID, ConfigurationModuleType.CAR, NOW, null, dir)); + existingConfigurationInfos.add(new ConfigurationInfo(null, OLD_VERSION_ID, ConfigurationModuleType.CAR, NOW, null, null, dir)); SingleFileHotDeployer singleFileHotDeployer = new SingleFileHotDeployer(dir, watchPaths, Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationInfo.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationInfo.java?rev=398278&r1=398277&r2=398278&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationInfo.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationInfo.java Sat Apr 29 20:44:14 2006 @@ -38,36 +38,19 @@ private final long created; private final File inPlaceLocation; private final Set ownedConfigurations = new LinkedHashSet(); + private final Set childConfigurations = new LinkedHashSet(); private final State state; private final Artifact parentID; - public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, File inPlaceLocation) { - this.storeName = storeName; - this.configID = configID; - this.type = type; - this.created = created; - this.inPlaceLocation = inPlaceLocation; - if (ownedConfigurations != null) { - this.ownedConfigurations.addAll(ownedConfigurations); - } - state = null; - parentID = null; + public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, Set childConfigurations, File inPlaceLocation) { + this(storeName, configID, type, created, ownedConfigurations, childConfigurations, inPlaceLocation, null, null); } - public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, File inPlaceLocation, State state) { - this.storeName = storeName; - this.configID = configID; - this.type = type; - this.created = created; - this.inPlaceLocation = inPlaceLocation; - if (ownedConfigurations != null) { - this.ownedConfigurations.addAll(ownedConfigurations); - } - this.state = state; - parentID = null; + public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, Set childConfigurations, File inPlaceLocation, State state) { + this(storeName, configID, type, created, ownedConfigurations, childConfigurations, inPlaceLocation, state, null); } - public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, File inPlaceLocation, State state, Artifact parentID) { + public ConfigurationInfo(AbstractName storeName, Artifact configID, ConfigurationModuleType type, long created, Set ownedConfigurations, Set childConfigurations, File inPlaceLocation, State state, Artifact parentID) { this.storeName = storeName; this.configID = configID; this.type = type; @@ -76,6 +59,9 @@ if (ownedConfigurations != null) { this.ownedConfigurations.addAll(ownedConfigurations); } + if (childConfigurations != null) { + this.childConfigurations.addAll(childConfigurations); + } this.state = state; this.parentID = parentID; } @@ -102,6 +88,10 @@ public Set getOwnedConfigurations() { return ownedConfigurations; + } + + public Set getChildConfigurations() { + return childConfigurations; } public State getState() { Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?rev=398278&r1=398277&r2=398278&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java Sat Apr 29 20:44:14 2006 @@ -168,31 +168,42 @@ } public static void writeConfigInfo(PrintWriter writer, ConfigurationData configurationData) { - writer.println("id=" + configurationData.getId()); - writer.println("type=" + configurationData.getModuleType()); - writer.println("created=" + configurationData.getCreated()); + writeConfigInfo("", writer, configurationData); + } + private static void writeConfigInfo(String prefix, PrintWriter writer, ConfigurationData configurationData) { + writer.println(prefix+"id=" + configurationData.getId()); + writer.println(prefix+"type=" + configurationData.getModuleType()); + writer.println(prefix+"created=" + configurationData.getCreated()); Set ownedConfigurations = configurationData.getOwnedConfigurations(); int i = 0; for (Iterator iterator = ownedConfigurations.iterator(); iterator.hasNext();) { Artifact ownedConfiguration = (Artifact) iterator.next(); - writer.println("owned.configuration." + i++ + "=" + ownedConfiguration); + writer.println(prefix+"owned." + i++ + "=" + ownedConfiguration); + } + i = 0; + for (Iterator it = configurationData.getChildConfigurations().values().iterator(); it.hasNext(); i++) { + ConfigurationData data = (ConfigurationData) it.next(); + writeConfigInfo("child."+i+".", writer, data); } + writer.flush(); } public static ConfigurationInfo readConfigurationInfo(InputStream in, AbstractName storeName, File inPlaceLocation) throws IOException { Properties properties = new Properties(); properties.load(in); - - String id = properties.getProperty("id"); + return readConfigurationInfo("", properties, storeName, inPlaceLocation); + } + private static ConfigurationInfo readConfigurationInfo(String prefix, Properties properties, AbstractName storeName, File inPlaceLocation) throws IOException { + String id = properties.getProperty(prefix+"id"); Artifact configId = Artifact.create(id); - String type = properties.getProperty("type"); + String type = properties.getProperty(prefix+"type"); ConfigurationModuleType moduleType = ConfigurationModuleType.getByName(type); if (moduleType == null) { throw new IllegalArgumentException("Unknown module type: " + type); } - String created = properties.getProperty("created"); + String created = properties.getProperty(prefix+"created"); long time; try { time = Long.parseLong(created); @@ -204,13 +215,25 @@ for (Iterator iterator = properties.entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); String name = (String) entry.getKey(); - if (name.startsWith("owned.configuration.")) { + if (name.startsWith(prefix+"owned.")) { String value = (String) entry.getValue(); Artifact ownedConfiguration = Artifact.create(value); ownedConfigurations.add(ownedConfiguration); } } - return new ConfigurationInfo(storeName, configId, moduleType, time, ownedConfigurations, inPlaceLocation); + LinkedHashSet childConfigurations = new LinkedHashSet(); + int test = 0; + while(true) { + String next = prefix+"child."+test+"."; + String value = properties.getProperty(next+".id"); + if(value == null) { + break; + } + childConfigurations.add(readConfigurationInfo(next, properties, storeName, inPlaceLocation)); + ++test; + } + + return new ConfigurationInfo(storeName, configId, moduleType, time, ownedConfigurations, childConfigurations, inPlaceLocation); } /** Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java?rev=398278&r1=398277&r2=398278&view=diff ============================================================================== --- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java (original) +++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java Sat Apr 29 20:44:14 2006 @@ -174,6 +174,7 @@ configurationInfo.getType(), configurationInfo.getCreated(), configurationInfo.getOwnedConfigurations(), + configurationInfo.getChildConfigurations(), configurationInfo.getInPlaceLocation(), State.RUNNING); } else { @@ -182,6 +183,7 @@ configurationInfo.getType(), configurationInfo.getCreated(), configurationInfo.getOwnedConfigurations(), + configurationInfo.getChildConfigurations(), configurationInfo.getInPlaceLocation(), State.STOPPED); }