geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r604483 [3/3] - in /geronimo/server/trunk: applications/welcome/geronimo-welcome/src/main/java/org/apache/geronimo/welcome/ framework/configs/rmi-naming/src/main/plan/ framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronim...
Date Sat, 15 Dec 2007 18:28:22 GMT
Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java?rev=604483&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java
(added)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java
Sat Dec 15 10:28:19 2007
@@ -0,0 +1,395 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.system.plugin;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+
+import javax.security.auth.login.FailedLoginException;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.FileWriteMonitor;
+import org.apache.geronimo.kernel.repository.Version;
+import org.apache.geronimo.kernel.repository.WriteableRepository;
+import org.apache.geronimo.kernel.util.XmlUtil;
+import org.apache.geronimo.system.plugin.model.PluginListType;
+import org.apache.geronimo.util.encoders.Base64;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class RemoteSourceRepository implements SourceRepository {
+
+    private final URI base;
+    private String username = null;
+    private String password = null;
+
+    public RemoteSourceRepository(URI base) {
+        if (!base.getPath().endsWith("/")) {
+            throw new IllegalArgumentException("base uri must end with '/', not " + base);
+        }
+        this.base = base;
+    }
+
+    public PluginListType getPluginList() {
+        try {
+            URL uri = base.resolve("geronimo-plugins.xml").toURL();
+            InputStream in = uri.openStream();
+            try {
+                return PluginXmlUtil.loadPluginList(in);
+            } finally {
+                in.close();
+            }
+        } catch (Exception e) {
+            return null;
+        }
+    }
+
+    public OpenResult open(Artifact artifact, FileWriteMonitor monitor) throws IOException,
FailedLoginException {
+
+        // If the artifact version is resolved then look for the artifact in the repo
+        if (artifact.isResolved()) {
+            URL location = getURL(artifact);
+            OpenResult result = open(artifact, location);
+            if (result != null) {
+                return result;
+            }
+            Version version = artifact.getVersion();
+            // Snapshot artifacts can have a special filename in an online maven repo.
+            // The version number is replaced with a timestmap and build number.
+            // The maven-metadata file contains this extra information.
+            if (version.toString().indexOf("SNAPSHOT") >= 0 && !(version instanceof
SnapshotVersion)) {
+                // base path for the artifact version in a maven repo
+                URI basePath = base.resolve(artifact.getGroupId().replace('.', '/') + "/"
+ artifact.getArtifactId() + "/" + version);
+
+                // get the maven-metadata file
+                Document metadata = getMavenMetadata(basePath);
+
+                // determine the snapshot qualifier from the maven-metadata file
+                if (metadata != null) {
+                    NodeList snapshots = metadata.getDocumentElement().getElementsByTagName("snapshot");
+                    if (snapshots.getLength() >= 1) {
+                        Element snapshot = (Element) snapshots.item(0);
+                        List<String> timestamp = getChildrenText(snapshot, "timestamp");
+                        List<String> buildNumber = getChildrenText(snapshot, "buildNumber");
+                        if (timestamp.size() >= 1 && buildNumber.size() >=
1) {
+                            try {
+                                // recurse back into this method using a SnapshotVersion
+                                SnapshotVersion snapshotVersion = new SnapshotVersion(version);
+                                snapshotVersion.setBuildNumber(Integer.parseInt(buildNumber.get(0)));
+                                snapshotVersion.setTimestamp(timestamp.get(0));
+                                Artifact newQuery = new Artifact(artifact.getGroupId(), artifact.getArtifactId(),
snapshotVersion, artifact.getType());
+                                location = getURL(newQuery);
+                                return open(artifact, location);
+                            } catch (NumberFormatException nfe) {
+//                                log.error("Could not create snapshot version for " + artifact,
nfe);
+                            }
+                        } else {
+//                            log.error("Could not create snapshot version for " + artifact);
+                        }
+                    }
+                }
+            }
+            return null;
+        }
+
+        // Version is not resolved.  Look in maven-metadata.xml and maven-metadata-local.xml
for
+        // the available version numbers.  If found then recurse into the enclosing method
with
+        // a resolved version number
+        else {
+
+            // base path for the artifact version in a maven repo
+            URI basePath = base.resolve(artifact.getGroupId().replace('.', '/') + "/" + artifact.getArtifactId());
+
+            // get the maven-metadata file
+            Document metadata = getMavenMetadata(basePath);
+
+            // determine the available versions from the maven-metadata file
+            if (metadata != null) {
+                Element root = metadata.getDocumentElement();
+                NodeList list = root.getElementsByTagName("versions");
+                list = ((Element) list.item(0)).getElementsByTagName("version");
+                Version[] available = new Version[list.getLength()];
+                for (int i = 0; i < available.length; i++) {
+                    available[i] = new Version(getText(list.item(i)));
+                }
+                // desc sort
+                Arrays.sort(available, new Comparator<Version>() {
+                    public int compare(Version o1, Version o2) {
+                        return o2.toString().compareTo(o1.toString());
+                    }
+                });
+
+                for (Version version : available) {
+                    URL location = getURL(new Artifact(artifact.getGroupId(), artifact.getArtifactId(),
version, artifact.getType()));
+                    OpenResult result = open(artifact, location);
+                    if (result != null) {
+                        return result;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    private OpenResult open(Artifact artifact, URL location) throws IOException, FailedLoginException
{
+        InputStream in = openStream(artifact, location);
+        return new RemoteOpenResult(artifact, in);
+    }
+
+    private InputStream openStream(Artifact artifact, URL location) throws IOException, FailedLoginException
{
+        int size = 0;
+        URLConnection con = location.openConnection();
+        if (con instanceof HttpURLConnection) {
+            HttpURLConnection http = (HttpURLConnection) con;
+            http.connect();
+            if (http.getResponseCode() == 401) { // need to authenticate
+                if (username == null || username.equals("")) {
+                    throw new FailedLoginException("Server returned 401 " + http.getResponseMessage());
+                }
+                //TODO is it necessary to keep getting new http's ?
+                http = (HttpURLConnection) location.openConnection();
+                http.setRequestProperty("Authorization",
+                        "Basic " + new String(Base64.encode((username + ":" + password).getBytes())));
+                http.connect();
+                if (http.getResponseCode() == 401) {
+                    throw new FailedLoginException("Server returned 401 " + http.getResponseMessage());
+                } else if (http.getResponseCode() == 404) {
+                    return null; // Not found at this repository
+                }
+                if (http.getContentLength() > 0) {
+                    size = http.getContentLength();
+                }
+            } else if (http.getResponseCode() == 404) {
+                return null; // Not found at this repository
+            } else {
+                if (http.getContentLength() > 0) {
+                    size = http.getContentLength();
+                }
+            }
+            return http.getInputStream();
+        }
+        return null;
+    }
+
+
+    private Document getMavenMetadata(URI base) throws IOException, FailedLoginException
{
+        Document doc = null;
+        InputStream in = null;
+
+        try {
+            URL metaURL = base.resolve( "maven-metadata.xml").toURL();
+            in = openStream(null, metaURL);
+            if (in == null) { // check for local maven metadata
+                metaURL = base.resolve("maven-metadata-local.xml").toURL();
+                in = openStream(null, metaURL);
+            }
+            if (in != null) {
+                DocumentBuilder builder = XmlUtil.newDocumentBuilderFactory().newDocumentBuilder();
+                doc = builder.parse(in);
+            }
+        } catch (ParserConfigurationException e) {
+            throw (IOException)new IOException().initCause(e);
+        } catch (SAXException e) {
+            throw (IOException)new IOException().initCause(e);
+        } finally {
+            if (in == null) {
+//                log.info("No maven metadata available at " + base);
+            } else {
+                in.close();
+            }
+        }
+        return doc;
+    }
+
+
+    private URL getURL(Artifact configId) throws MalformedURLException {
+        String qualifiedVersion = configId.getVersion().toString();
+        if (configId.getVersion() instanceof SnapshotVersion) {
+            SnapshotVersion ssVersion = (SnapshotVersion) configId.getVersion();
+            String timestamp = ssVersion.getTimestamp();
+            int buildNumber = ssVersion.getBuildNumber();
+            if (timestamp != null && buildNumber != 0) {
+                qualifiedVersion = qualifiedVersion.replaceAll("SNAPSHOT", timestamp + "-"
+ buildNumber);
+            }
+        }
+        return base.resolve(configId.getGroupId().replace('.', '/') + "/"
+                + configId.getArtifactId() + "/" + configId.getVersion()
+                + "/" + configId.getArtifactId() + "-"
+                + qualifiedVersion + "." + configId.getType()).toURL();
+    }
+
+        /**
+     * Gets all the text contents of the specified DOM node.
+     */
+    private static String getText(Node target) {
+        NodeList nodes = target.getChildNodes();
+        StringBuffer buf = null;
+        for (int j = 0; j < nodes.getLength(); j++) {
+            Node node = nodes.item(j);
+            if (node.getNodeType() == Node.TEXT_NODE) {
+                if (buf == null) {
+                    buf = new StringBuffer();
+                }
+                buf.append(node.getNodeValue());
+            }
+        }
+        return buf == null ? null : buf.toString();
+    }
+
+    /**
+     * Gets the text out of all the child nodes of a certain type.  The result
+     * array has one element for each child of the specified DOM element that
+     * has the specified name.
+     *
+     * @param root     The parent DOM element
+     * @param property The name of the child elements that hold the text
+     */
+    private static List<String> getChildrenText(Element root, String property) {
+        NodeList children = root.getChildNodes();
+        List<String> results = new ArrayList<String>();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node check = children.item(i);
+            if (check.getNodeType() == Node.ELEMENT_NODE && check.getNodeName().equals(property))
{
+                NodeList nodes = check.getChildNodes();
+                StringBuffer buf = null;
+                for (int j = 0; j < nodes.getLength(); j++) {
+                    Node node = nodes.item(j);
+                    if (node.getNodeType() == Node.TEXT_NODE) {
+                        if (buf == null) {
+                            buf = new StringBuffer();
+                        }
+                        buf.append(node.getNodeValue());
+                    }
+                }
+                results.add(buf == null ? null : buf.toString());
+            }
+        }
+        return results;
+    }
+
+    private static class RemoteOpenResult implements OpenResult {
+        private final Artifact artifact;
+        private final InputStream in;
+        private File file;
+
+        private RemoteOpenResult(Artifact artifact, InputStream in) {
+            this.artifact = artifact;
+            this.in = in;
+        }
+
+        public Artifact getArtifact() {
+            return artifact;
+        }
+
+        public File getFile() throws IOException {
+            if (file == null) {
+                file = downloadFile(in);
+            }
+            return file;
+        }
+
+        public void install(WriteableRepository repo, FileWriteMonitor monitor) throws IOException
{
+            File file = getFile();
+            repo.copyToRepository(file, artifact, monitor);
+            if (!file.delete()) {
+//                log.warn("Unable to delete temporary download file " + tempFile.getAbsolutePath());
+                file.deleteOnExit();
+            }
+        }
+
+        public void close() {
+            if (in != null) {
+                try {
+                    in.close();
+                } catch (IOException e) {
+                    //ignore
+                }
+            }
+        }
+        /**
+         * Downloads to a temporary file so we can validate the download before
+         * installing into the repository.
+         *
+         * @param in  source of download
+    //     * @param monitor monitor to report results of download
+         * @return downloaded file
+         * @throws IOException if input cannot be read or file cannot be written
+         */
+        private File downloadFile(InputStream in/*, ResultsFileWriteMonitor monitor*/) throws
IOException {
+            if (in == null) {
+                throw new IllegalStateException();
+            }
+            FileOutputStream out = null;
+            byte[] buf;
+            try {
+//            monitor.writeStarted(result.getArtifact().toString(), result.getFileSize());
+                File file = File.createTempFile("geronimo-plugin-download-", ".tmp");
+                out = new FileOutputStream(file);
+                buf = new byte[65536];
+                int count, total = 0;
+                while ((count = in.read(buf)) > -1) {
+                    out.write(buf, 0, count);
+//                monitor.writeProgress(total += count);
+                }
+//            monitor.writeComplete(total);
+                in.close();
+                in = null;
+                out.close();
+                out = null;
+                return file;
+            } finally {
+                if (in != null) {
+                    try {
+                        in.close();
+                    } catch (IOException ignored) {
+                        //ignore
+                    }
+                }
+                if (out != null) {
+                    try {
+                        out.close();
+                    } catch (IOException ignored) {
+                        //ignore
+                    }
+                }
+            }
+        }
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java?rev=604483&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java
(added)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java
Sat Dec 15 10:28:19 2007
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.system.plugin;
+
+import java.io.IOException;
+
+import javax.security.auth.login.FailedLoginException;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.FileWriteMonitor;
+import org.apache.geronimo.system.plugin.model.PluginListType;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface SourceRepository {
+
+    PluginListType getPluginList();
+
+    OpenResult open(Artifact artifact, FileWriteMonitor monitor) throws IOException, FailedLoginException;
+
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java?rev=604483&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java
(added)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java
Sat Dec 15 10:28:19 2007
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.system.plugin;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class SourceRepositoryFactory {
+    private SourceRepositoryFactory() {
+    }
+
+    public static SourceRepository getSourceRepository(String repo) {
+        URI repoURI = PluginRepositoryDownloader.resolveRepository(repo);
+        if (repoURI == null) {
+            throw new IllegalStateException("Can't locate repo " + repo);
+        }
+        String scheme = repoURI.getScheme();
+        if (scheme.startsWith("http")) {
+            return new RemoteSourceRepository(repoURI);
+        } else if ("file".equals(scheme)) {
+            return new LocalSourceRepository(new File(repoURI));
+        }
+        throw new IllegalStateException("Cannot identify desired repo type for " + repo);
+    }
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/xsd/plugins-1.3.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/xsd/plugins-1.3.xsd?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/xsd/plugins-1.3.xsd (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/xsd/plugins-1.3.xsd Sat
Dec 15 10:28:19 2007
@@ -450,18 +450,13 @@
 
         <xs:complexContent>
             <xs:extension base="list:artifactType">
-                <xs:attribute name="start" use="optional" type="xs:boolean" default="false">
+                <xs:attribute name="start" use="optional" type="xs:boolean" default="true">
                     <xs:annotation>
                         <xs:documentation>
-                            Normally when a plugin dependency is installed it will not
-                            be started. The user may be prompted to start the plugin
-                            with whatever tool kicked off the install to begin with.
-
-                            This attribute may be set to "true" to force the plugin to
-                            be started after it is installed. NOTE: this currently only
-                            affects the dependencies of the plugins actually passed to
-                            the PluginInstaller (not nested dependencies). This
-                            means it's primarily useful for plugin lists.
+                            Influences whether a dependency is marked to start.  A plugin
is marked to start
+                            in a particular server "instance" primarily based on the load
and condition settings in
+                            the config-xml sections.  However the start attribute overrides
this for plugins installed
+                            as dependencies.
                         </xs:documentation>
                     </xs:annotation>
                 </xs:attribute>

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/pom.xml?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/pom.xml
(original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/pom.xml
Sat Dec 15 10:28:19 2007
@@ -124,6 +124,12 @@
                             <start>true</start>
                             <import>classes</import>
                         </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.modules</groupId>
+                            <artifactId>geronimo-service-builder</artifactId>
+                            <version>${version}</version>
+                            <start>false</start>
+                        </dependency>
                     </dependencies>
                     <instance>
                         <plugin-artifact xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3"
xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/src/test/resources/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/src/test/resources/META-INF/geronimo-plugin.xml?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/src/test/resources/META-INF/geronimo-plugin.xml
(original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/it/metadatageneration/src/test/resources/META-INF/geronimo-plugin.xml
Sat Dec 15 10:28:19 2007
@@ -23,7 +23,7 @@
             <resource-type>joke</resource-type>
             <description>this is an explanation</description>
         </prerequisite>
-        <dependency start="false">
+        <dependency>
             <groupId>xstream</groupId>
             <artifactId>xstream</artifactId>
             <type>jar</type>
@@ -33,6 +33,11 @@
             <artifactId>velocity</artifactId>
             <version>1.4</version>
             <type>jar</type>
+        </dependency>
+        <dependency start="false">
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>2.1-SNAPSHOT</version>
         </dependency>
         <obsoletes>
             <groupId>commons-logging</groupId>

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Dependency.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Dependency.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Dependency.java
(original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/Dependency.java
Sat Dec 15 10:28:19 2007
@@ -31,10 +31,13 @@
     /**
      * @parameter
      */
-    private boolean start;
+    private Boolean start;
 
 
-    public boolean isStart() {
+    public Boolean isStart() {
+        if (start == null) {
+            return Boolean.TRUE;
+        }
         return start;
     }
 
@@ -50,7 +53,7 @@
 
     public org.apache.geronimo.kernel.repository.Dependency toDependency() {
         org.apache.geronimo.kernel.repository.Artifact artifact = new org.apache.geronimo.kernel.repository.Artifact(groupId,
artifactId, version, type);
-        ImportType importType = getImport() == null? ImportType.ALL: (ImportType) ImportType.getByName(getImport());
+        ImportType importType = getImport() == null? ImportType.ALL: ImportType.getByName(getImport());
         return new org.apache.geronimo.kernel.repository.Dependency(artifact, importType);
     }
 

Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenConfigStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenConfigStore.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenConfigStore.java
(original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenConfigStore.java
Sat Dec 15 10:28:19 2007
@@ -46,7 +46,7 @@
     extends RepositoryConfigurationStore
 {
     public MavenConfigStore(Kernel kernel, String objectName, WritableListableRepository
repository) {
-        super(kernel, objectName, repository);
+        super(kernel, objectName, null, repository);
     }
 
     public MavenConfigStore(WritableListableRepository repository) {

Modified: geronimo/server/trunk/plugins/client/client-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/client-deployer/pom.xml?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/client-deployer/pom.xml (original)
+++ geronimo/server/trunk/plugins/client/client-deployer/pom.xml Sat Dec 15 10:28:19 2007
@@ -21,20 +21,20 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
-    
+
     <parent>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>configs</artifactId>
         <version>2.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
-    
+
     <artifactId>client-deployer</artifactId>
     <name>Geronimo Configs :: Application Client Deployments</name>
     <packaging>car</packaging>
-    
+
     <dependencies>
-        
+
         <!-- parent -->
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
@@ -68,60 +68,60 @@
             <artifactId>geronimo-connector-builder</artifactId>
             <version>${version}</version>
         </dependency>
-        
+
     </dependencies>
-    
+
     <build>
         <plugins>
             <plugin>
                 <groupId>org.apache.geronimo.plugins</groupId>
                 <artifactId>car-maven-plugin</artifactId>
                 <configuration>
-<!--
-                    <deploymentConfigs>
-                        <deploymentConfig>${gbeanDeployer}</deploymentConfig>
-                        <deploymentConfig>${j2eeDeployer}</deploymentConfig>
-                    </deploymentConfigs>
--->
+                    <!--
+                                        <deploymentConfigs>
+                                            <deploymentConfig>${gbeanDeployer}</deploymentConfig>
+                                            <deploymentConfig>${j2eeDeployer}</deploymentConfig>
+                                        </deploymentConfigs>
+                    -->
                     <category>Geronimo Core</category>
                     <useMavenDependencies>
                         <value>false</value>
                     </useMavenDependencies>
                     <dependencies>
-                      <dependency>
-                        <groupId>org.apache.geronimo.modules</groupId>
-                        <artifactId>geronimo-connector-builder</artifactId>
-                        <version>2.1-SNAPSHOT</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>client</artifactId>
-                          <version>2.1-SNAPSHOT</version>
-                        <type>car</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.modules</groupId>
-                        <artifactId>geronimo-client-builder</artifactId>
-                        <version>2.1-SNAPSHOT</version>
-                        <type>jar</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>client-transaction</artifactId>
-                          <version>2.1-SNAPSHOT</version>
-                        <type>car</type>
-                        <import>classes</import>
-                      </dependency>
-                      <dependency>
-                        <groupId>org.apache.geronimo.configs</groupId>
-                        <artifactId>j2ee-deployer</artifactId>
-                          <version>2.1-SNAPSHOT</version>
-                        <type>car</type>
-                      </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.configs</groupId>
+                            <artifactId>j2ee-deployer</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>car</type>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.modules</groupId>
+                            <artifactId>geronimo-connector-builder</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.configs</groupId>
+                            <artifactId>client</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>car</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.modules</groupId>
+                            <artifactId>geronimo-client-builder</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>jar</type>
+                            <import>classes</import>
+                        </dependency>
+                        <dependency>
+                            <groupId>org.apache.geronimo.configs</groupId>
+                            <artifactId>client-transaction</artifactId>
+                            <version>2.1-SNAPSHOT</version>
+                            <type>car</type>
+                            <import>classes</import>
+                        </dependency>
                     </dependencies>
                     <instance>
                         <plugin-artifact>

Modified: geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/main/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/main/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStore.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/main/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStore.java
(original)
+++ geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/main/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStore.java
Sat Dec 15 10:28:19 2007
@@ -67,6 +67,7 @@
     
     public MasterConfigurationStore(Kernel kernel,
             String objectName,
+            AbstractName abstractName,
             WritableListableRepository repository,
             Environment defaultEnvironment,
             ClusterInfo clusterInfo,
@@ -90,7 +91,7 @@
 
         builder = newMasterConfigurationBuilder();
         clusterInfoName = kernel.getAbstractNameFor(clusterInfo);
-        delegate = newConfigurationStore(kernel, objectName, repository);
+        delegate = newConfigurationStore(kernel, objectName, abstractName, repository);
     }
 
     public boolean containsConfiguration(Artifact configId) {
@@ -177,8 +178,9 @@
 
     protected ConfigurationStore newConfigurationStore(Kernel kernel,
         String objectName,
+        AbstractName abstractName,
         WritableListableRepository repository) {
-        return new RepositoryConfigurationStore(kernel, objectName, repository);
+        return new RepositoryConfigurationStore(kernel, objectName, abstractName, repository);
     }
 
     protected MasterConfigurationNameBuilder newMasterConfigurationBuilder() {
@@ -291,6 +293,7 @@
         
         builder.addAttribute(GBEAN_ATTR_KERNEL, Kernel.class, false);
         builder.addAttribute(GBEAN_ATTR_OBJECT_NAME, String.class, false);
+        builder.addAttribute("abstractName", AbstractName.class, false);
         builder.addAttribute(GBEAN_ATTR_DEFAULT_ENV, Environment.class, true, true);
         
         builder.addReference(GBEAN_REF_REPOSITORY, WritableListableRepository.class, "Repository");
@@ -301,6 +304,7 @@
         
         builder.setConstructor(new String[]{GBEAN_ATTR_KERNEL,
             GBEAN_ATTR_OBJECT_NAME,
+                "abstractName",
             GBEAN_REF_REPOSITORY,
             GBEAN_ATTR_DEFAULT_ENV,
             GBEAN_REF_CLUSTER_INFO,

Modified: geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStoreTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStoreTest.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStoreTest.java
(original)
+++ geronimo/server/trunk/plugins/clustering/geronimo-clustering/src/test/java/org/apache/geronimo/clustering/deployment/MasterConfigurationStoreTest.java
Sat Dec 15 10:28:19 2007
@@ -83,6 +83,7 @@
     private MasterConfigurationStore newMasterConfigurationStore() {
         return new MasterConfigurationStore(kernel,
             "objectName",
+                null,
             repository,
             new Environment(),
             clusterInfo,
@@ -90,6 +91,7 @@
             @Override
             protected ConfigurationStore newConfigurationStore(Kernel kernel,
                 String objectName,
+                AbstractName abstractName,
                 WritableListableRepository repository) {
                 return delegate;
             }

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/AddRepositoryHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/AddRepositoryHandler.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/AddRepositoryHandler.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/AddRepositoryHandler.java
Sat Dec 15 10:28:19 2007
@@ -56,10 +56,9 @@
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel
model) throws PortletException, IOException {
         PluginRepositoryList[] lists = PortletManager.getCurrentServer(request).getPluginRepositoryLists();
-        List list = new ArrayList();
-        for (int i = 0; i < lists.length; i++) {
-            PluginRepositoryList repo = lists[i];
-            list.addAll(Arrays.asList(repo.getRepositories()));
+        List<URL> list = new ArrayList<URL>();
+        for (PluginRepositoryList repo : lists) {
+            list.addAll(repo.getRepositories());
         }
         String error = request.getParameter("repoError");
         if(error != null && !error.equals("")) {
@@ -91,12 +90,9 @@
         // Check for duplicates
         for (int i = 0; i < lists.length; i++) {
             PluginRepositoryList test = lists[i];
-            URL[] all = test.getRepositories();
-            for (int j = 0; j < all.length; j++) {
-                String existing = all[j].toString();
-                if(!existing.endsWith("/")) {
-                    existing = existing + "/";
-                }
+            List<URL> all = test.getRepositories();
+            for (URL url: all) {
+                String existing = url.toString();
                 if(repo.equals(existing)) {
                     response.setRenderParameter("repoError", "Already have an entry for repository
"+repo);
                     return false;

Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/IndexHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/IndexHandler.java?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/IndexHandler.java
(original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/IndexHandler.java
Sat Dec 15 10:28:19 2007
@@ -17,19 +17,20 @@
 package org.apache.geronimo.console.car;
 
 import java.io.IOException;
-import java.util.List;
+import java.net.URL;
 import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.List;
+
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletException;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
+
 import org.apache.geronimo.console.MultiPageModel;
 import org.apache.geronimo.console.util.ConfigurationData;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.system.plugin.PluginRepositoryList;
-import org.apache.geronimo.system.plugin.model.PluginListType;
 
 /**
  * Handler for the import export main screen.
@@ -53,10 +54,10 @@
         // clear out the catalog if it was previously loaded 
         request.getPortletSession(true).removeAttribute(CONFIG_LIST_SESSION_KEY);
         
-        List list = new ArrayList();
+        List<URL> list = new ArrayList<URL>();
         for (int i = 0; i < lists.length; i++) {
             PluginRepositoryList repo = lists[i];
-            list.addAll(Arrays.asList(repo.getRepositories()));
+            list.addAll(repo.getRepositories());
         }
         ConfigurationData[] configs = PortletManager.getConfigurations(request, null, false);
         request.setAttribute("configurations", configs);

Modified: geronimo/server/trunk/plugins/console/console-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-jetty/pom.xml?rev=604483&r1=604482&r2=604483&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-jetty/pom.xml (original)
+++ geronimo/server/trunk/plugins/console/console-jetty/pom.xml Sat Dec 15 10:28:19 2007
@@ -93,13 +93,19 @@
             <scope>provided</scope>
        </dependency>
 
-        <!-- for jspc. why is this needed? -->
+        <!-- make sure these get into the plugin dependencies -->
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>
             <artifactId>jasper</artifactId>
             <version>${version}</version>
             <type>car</type>
         </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>jetty6</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+        </dependency>
 
     </dependencies>
 
@@ -134,6 +140,7 @@
                         <value>true</value>
                         <includeVersion>true</includeVersion>
                     </useMavenDependencies>
+<!--
                     <instance>
                         <plugin-artifact>
                             <prerequisite>
@@ -148,6 +155,7 @@
                             </prerequisite>
                         </plugin-artifact>
                     </instance>
+-->
                 </configuration>
             </plugin>
         </plugins>



Mime
View raw message