Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 1492 invoked from network); 17 Oct 2008 16:58:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Oct 2008 16:58:46 -0000 Received: (qmail 61465 invoked by uid 500); 17 Oct 2008 16:58:41 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 61414 invoked by uid 500); 17 Oct 2008 16:58:41 -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 61398 invoked by uid 99); 17 Oct 2008 16:58:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Oct 2008 09:58:41 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Oct 2008 16:57:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1F7FA23888A0; Fri, 17 Oct 2008 09:58:17 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r705671 - in /geronimo/gshell/trunk: gshell-assembly/src/main/underlay/etc/ gshell-model/src/main/java/org/apache/geronimo/gshell/model/ gshell-support/gshell-ivy/src/main/java/org/apache/geronimo/gshell/ivy/ gshell-wisdom/gshell-wisdom-boo... Date: Fri, 17 Oct 2008 16:58:16 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081017165817.1F7FA23888A0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jdillon Date: Fri Oct 17 09:58:16 2008 New Revision: 705671 URL: http://svn.apache.org/viewvc?rev=705671&view=rev Log: For now move the ivy cache into var/cache The stupid java.beans.XML[Encoder|Decoder] is crap crap crap, so just serialize the damn object for the app cp cache Modified: geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/ivysettings.xml geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/Artifact.java geronimo/gshell/trunk/gshell-support/gshell-ivy/src/main/java/org/apache/geronimo/gshell/ivy/IvyFactoryBean.java geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ClassPathImpl.java geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java Modified: geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/ivysettings.xml URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/ivysettings.xml?rev=705671&r1=705670&r2=705671&view=diff ============================================================================== --- geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/ivysettings.xml (original) +++ geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/ivysettings.xml Fri Oct 17 09:58:16 2008 @@ -28,7 +28,7 @@ - + @@ -39,4 +39,8 @@ --> + + \ No newline at end of file Modified: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/Artifact.java URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/Artifact.java?rev=705671&r1=705670&r2=705671&view=diff ============================================================================== --- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/Artifact.java (original) +++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/Artifact.java Fri Oct 17 09:58:16 2008 @@ -19,9 +19,8 @@ package org.apache.geronimo.gshell.model; -import org.apache.geronimo.gshell.model.Element; - import java.io.File; +import java.io.Serializable; /** * Defines an artifact (groupId, artifactId, version, etc). @@ -30,6 +29,7 @@ */ public class Artifact extends Element + implements Serializable { public static final String DEFAULT_TYPE = "jar"; Modified: geronimo/gshell/trunk/gshell-support/gshell-ivy/src/main/java/org/apache/geronimo/gshell/ivy/IvyFactoryBean.java URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-ivy/src/main/java/org/apache/geronimo/gshell/ivy/IvyFactoryBean.java?rev=705671&r1=705670&r2=705671&view=diff ============================================================================== --- geronimo/gshell/trunk/gshell-support/gshell-ivy/src/main/java/org/apache/geronimo/gshell/ivy/IvyFactoryBean.java (original) +++ geronimo/gshell/trunk/gshell-support/gshell-ivy/src/main/java/org/apache/geronimo/gshell/ivy/IvyFactoryBean.java Fri Oct 17 09:58:16 2008 @@ -61,6 +61,8 @@ log.debug("Settings URL: {}", url); ivy.configure(url); + // settings.setVariable("ivy.default.configuration.m2compatible", "true") + return ivy; } Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java?rev=705671&r1=705670&r2=705671&view=diff ============================================================================== --- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java (original) +++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java Fri Oct 17 09:58:16 2008 @@ -27,6 +27,7 @@ import org.apache.geronimo.gshell.application.plugin.PluginManager; import org.apache.geronimo.gshell.chronos.StopWatch; import org.apache.geronimo.gshell.event.EventPublisher; +import org.apache.geronimo.gshell.io.Closer; import org.apache.geronimo.gshell.model.ApplicationModel; import org.apache.geronimo.gshell.model.Artifact; import org.apache.geronimo.gshell.shell.Shell; @@ -45,14 +46,21 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; +import java.net.URL; import java.util.LinkedHashSet; -import java.util.Set; import java.util.List; -import java.net.URL; +import java.util.Set; /** * Default implementation of the {@link ApplicationManager} component. @@ -139,32 +147,30 @@ private ClassPath loadClassPath(final ApplicationModel model) throws Exception { assert model != null; - Set artifacts = resolveArtifacts(model); - ClassPath classPath = new ClassPathImpl(artifacts); - - /* - FIXME: This needs to find a way to work w/o XStream, which isn't available on the classpath yet. - - File file = new File(new File(System.getProperty("gshell.home")), "var/xstore/classpath.xml"); // FIXME: Get state directory from application/branding + // FIXME: Get state directory from application/branding + File file = new File(new File(System.getProperty("gshell.home")), "var/classpath.ser"); ClassPath classPath; + // + // HACK: Using a serialized object here, for lack of a better choice. XStream is not on the classpath yet, and the java.beans.XMLEncoder sucks my balls. + // + if (file.exists()) { - XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(new FileInputStream(file))); - classPath = (ClassPath)decoder.readObject(); + ObjectInputStream input = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file))); + classPath = (ClassPath)input.readObject(); log.debug("Loaded classpath from cache: {}", file); - decoder.close(); + Closer.close(input); } else { Set artifacts = resolveArtifacts(model); classPath = new ClassPathImpl(artifacts); log.debug("Saving classpath to cache: {}", file); file.getParentFile().mkdirs(); - XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(file))); - encoder.writeObject(classPath); - encoder.close(); + ObjectOutputStream output = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file))); + output.writeObject(classPath); + Closer.close(output); } - */ - + if (log.isDebugEnabled()) { log.debug("Application classpath:"); Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ClassPathImpl.java URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ClassPathImpl.java?rev=705671&r1=705670&r2=705671&view=diff ============================================================================== --- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ClassPathImpl.java (original) +++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ClassPathImpl.java Fri Oct 17 09:58:16 2008 @@ -22,14 +22,14 @@ import org.apache.geronimo.gshell.application.ClassPath; import org.apache.geronimo.gshell.model.Artifact; +import java.io.File; +import java.io.Serializable; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Set; import java.util.List; -import java.util.ArrayList; -import java.net.URL; -import java.net.MalformedURLException; -import java.io.File; /** * {@link ClassPath} implementation backed up by a set of artifacts. @@ -37,15 +37,15 @@ * @version $Rev$ $Date$ */ public class ClassPathImpl - implements ClassPath + implements ClassPath, Serializable { private Collection artifacts; - private Collection urls; + private transient Collection urls; public ClassPathImpl() {} - public ClassPathImpl(final Set artifacts) { + public ClassPathImpl(final Collection artifacts) { assert artifacts != null; this.artifacts = artifacts; Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java?rev=705671&r1=705670&r2=705671&view=diff ============================================================================== --- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java (original) +++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java Fri Oct 17 09:58:16 2008 @@ -166,7 +166,8 @@ assert artifact != null; ClassPath classPath; - XStoreRecord record = xstore.resolveRecord(artifact.getGroupId() + "/" + artifact.getArtifactId() + "/classpath.xml"); // FIXME: Get state directory from application/branding + // FIXME: Get state directory from application/branding + XStoreRecord record = xstore.resolveRecord(artifact.getGroupId() + "/" + artifact.getArtifactId() + "/classpath.xml"); if (record.exists()) { classPath = record.get(ClassPathImpl.class); log.debug("Loaded classpath from cache: {}", record);