You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2008/01/05 01:47:25 UTC
svn commit: r609072 [2/2] - in /geronimo/server/trunk:
applications/welcome/geronimo-welcome/
applications/welcome/geronimo-welcome/src/main/java/org/apache/geronimo/welcome/
applications/welcome/welcome-jetty/ applications/welcome/welcome-tomcat/
asse...
Copied: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginXmlUtil.java (from r609071, geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginXmlUtil.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginXmlUtil.java?p2=geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginXmlUtil.java&p1=geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginXmlUtil.java&r1=609071&r2=609072&rev=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/PluginXmlUtil.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/PluginXmlUtil.java Fri Jan 4 16:47:14 2008
@@ -63,20 +63,12 @@
public static final JAXBContext PLUGIN_CONTEXT;
public static final JAXBContext PLUGIN_LIST_CONTEXT;
public static final JAXBContext PLUGIN_ARTIFACT_CONTEXT;
- public static final JAXBContext ATTRIBUTES_CONTEXT;
- public static final JAXBContext ATTRIBUTE_CONTEXT;
- public static final JAXBContext MODULE_CONTEXT;
- public static final JAXBContext GBEAN_CONTEXT;
static {
try {
PLUGIN_CONTEXT = JAXBContext.newInstance(PluginType.class);
PLUGIN_LIST_CONTEXT = JAXBContext.newInstance(PluginListType.class);
PLUGIN_ARTIFACT_CONTEXT = JAXBContext.newInstance(PluginArtifactType.class);
- ATTRIBUTES_CONTEXT = JAXBContext.newInstance(AttributesType.class);
- MODULE_CONTEXT = JAXBContext.newInstance(ModuleType.class);
- GBEAN_CONTEXT = JAXBContext.newInstance(GbeanType.class);
- ATTRIBUTE_CONTEXT = JAXBContext.newInstance(AttributeType.class);
} catch (JAXBException e) {
throw new RuntimeException("Could not create jaxb contexts for plugin types");
}
@@ -96,31 +88,6 @@
marshaller.marshal(element, out);
}
- public static void writeAttribute(AttributeType metadata, Writer out) throws XMLStreamException, JAXBException {
- Marshaller marshaller = PLUGIN_LIST_CONTEXT.createMarshaller();
- marshaller.setProperty("jaxb.formatted.output", true);
- JAXBElement<AttributeType> element = new ObjectFactory().createAttribute(metadata);
- marshaller.marshal(element, out);
- }
- public static String extractAttributeValue(AttributeType attr) throws JAXBException, XMLStreamException {
- StringWriter sw = new StringWriter();
- PluginXmlUtil.writeAttribute(attr, sw);
- String s = sw.toString();
- int start = s.indexOf('>');
- start = s.indexOf('>', start + 1);
- int end = s.lastIndexOf('<');
- if (end < start) {
- return null;
- }
- return s.substring(start + 1, end).trim();
- }
-
- public static void writeAttributes(AttributesType metadata, Writer out) throws XMLStreamException, JAXBException {
- Marshaller marshaller = PLUGIN_LIST_CONTEXT.createMarshaller();
- marshaller.setProperty("jaxb.formatted.output", true);
- JAXBElement<AttributesType> element = new ObjectFactory().createAttributes(metadata);
- marshaller.marshal(element, out);
- }
/**
* Read a set of plugin metadata from a DOM document.
@@ -170,35 +137,6 @@
JAXBElement<PluginListType> element = unmarshaller.unmarshal(xmlStream, PluginListType.class);
PluginListType pluginList = element.getValue();
return pluginList;
- }
-
- public static AttributesType loadAttributes(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
- Unmarshaller unmarshaller = ATTRIBUTES_CONTEXT.createUnmarshaller();
- XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
- JAXBElement<AttributesType> element = unmarshaller.unmarshal(xmlStream, AttributesType.class);
- AttributesType pluginList = element.getValue();
- return pluginList;
- }
- public static ModuleType loadModule(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
- Unmarshaller unmarshaller = MODULE_CONTEXT.createUnmarshaller();
- XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
- JAXBElement<ModuleType> element = unmarshaller.unmarshal(xmlStream, ModuleType.class);
- ModuleType pluginList = element.getValue();
- return pluginList;
- }
- public static GbeanType loadGbean(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
- Unmarshaller unmarshaller = GBEAN_CONTEXT.createUnmarshaller();
- XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
- JAXBElement<GbeanType> element = unmarshaller.unmarshal(xmlStream, GbeanType.class);
- GbeanType pluginList = element.getValue();
- return pluginList;
- }
- public static AttributeType loadAttribute(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
- Unmarshaller unmarshaller = ATTRIBUTE_CONTEXT.createUnmarshaller();
- XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
- JAXBElement<AttributeType> element = unmarshaller.unmarshal(xmlStream, AttributeType.class);
- AttributeType attributeType = element.getValue();
- return attributeType;
}
public static class NamespaceFilter extends XMLFilterImpl {
Copied: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java (from r609071, geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java?p2=geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java&p1=geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java&r1=609071&r2=609072&rev=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ReferenceServerInstanceData.java Fri Jan 4 16:47:14 2008
@@ -32,7 +32,7 @@
import org.apache.geronimo.gbean.GBeanInfoBuilder;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
*/
public class ReferenceServerInstanceData extends ServerInstanceData {
Copied: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java (from r609071, 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-plugin/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java?p2=geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java&p1=geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java&r1=609071&r2=609072&rev=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/RemoteSourceRepository.java Fri Jan 4 16:47:14 2008
@@ -52,7 +52,7 @@
import org.xml.sax.SAXException;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
*/
public class RemoteSourceRepository implements SourceRepository {
Copied: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java (from r609071, geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java?p2=geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java&p1=geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java&r1=609071&r2=609072&rev=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/ServerArchiver.java Fri Jan 4 16:47:14 2008
@@ -27,7 +27,7 @@
import org.codehaus.plexus.archiver.ArchiverException;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
*/
public interface ServerArchiver {
File archive(String sourcePath, String destPath, Artifact artifact) throws ArchiverException, IOException;
Copied: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java (from r609071, 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-plugin/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java?p2=geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java&p1=geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java&r1=609071&r2=609072&rev=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/SourceRepository.java Fri Jan 4 16:47:14 2008
@@ -29,7 +29,7 @@
import org.apache.geronimo.system.plugin.model.PluginListType;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
*/
public interface SourceRepository {
Copied: geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java (from r609071, 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-plugin/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java?p2=geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java&p1=geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java&r1=609071&r2=609072&rev=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/main/java/org/apache/geronimo/system/plugin/SourceRepositoryFactory.java Fri Jan 4 16:47:14 2008
@@ -25,7 +25,7 @@
import java.net.URISyntaxException;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
*/
public class SourceRepositoryFactory {
private SourceRepositoryFactory() {
Copied: geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/ArchiverGBeanTest.java (from r609071, geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/plugin/ArchiverGBeanTest.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/ArchiverGBeanTest.java?p2=geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/ArchiverGBeanTest.java&p1=geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/plugin/ArchiverGBeanTest.java&r1=609071&r2=609072&rev=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/plugin/ArchiverGBeanTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/ArchiverGBeanTest.java Fri Jan 4 16:47:14 2008
@@ -28,7 +28,7 @@
import org.apache.geronimo.kernel.repository.Artifact;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
*/
public class ArchiverGBeanTest extends TestSupport {
Copied: geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java (from r609071, geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java?p2=geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java&p1=geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java&r1=609071&r2=609072&rev=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-plugin/src/test/java/org/apache/geronimo/system/plugin/CopyConfigTest.java Fri Jan 4 16:47:14 2008
@@ -34,6 +34,7 @@
import org.apache.geronimo.system.plugin.model.PluginArtifactType;
import org.apache.geronimo.system.plugin.model.AttributeType;
import org.apache.geronimo.system.configuration.GBeanOverride;
+import org.apache.geronimo.system.configuration.AttributesXmlUtil;
import org.apache.geronimo.system.configuration.condition.JexlExpressionParser;
/**
@@ -259,7 +260,7 @@
List contents = gbeans.get(0).getAttributeOrReference();
assertEquals(2, contents.size());
AttributeType attr = (AttributeType) contents.get(1);
- String value = PluginXmlUtil.extractAttributeValue(attr);
+ String value = AttributesXmlUtil.extractAttributeValue(attr);
assertEquals(VALUE, value);
}
}
Modified: geronimo/server/trunk/framework/modules/geronimo-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/pom.xml Fri Jan 4 16:47:14 2008
@@ -94,12 +94,6 @@
<artifactId>wstx-asl</artifactId>
</dependency>
- <!-- archiver seems to need to be same version as maven uses ??? -->
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-archiver</artifactId>
- </dependency>
-
</dependencies>
<build>
Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/AttributesXmlUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/AttributesXmlUtil.java?rev=609072&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/AttributesXmlUtil.java (added)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/AttributesXmlUtil.java Fri Jan 4 16:47:14 2008
@@ -0,0 +1,160 @@
+/*
+ * 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.configuration;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.geronimo.system.plugin.model.AttributeType;
+import org.apache.geronimo.system.plugin.model.AttributesType;
+import org.apache.geronimo.system.plugin.model.GbeanType;
+import org.apache.geronimo.system.plugin.model.ModuleType;
+import org.apache.geronimo.system.plugin.model.ObjectFactory;
+import org.xml.sax.SAXException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AttributesXmlUtil {
+ public static final XMLInputFactory XMLINPUT_FACTORY = XMLInputFactory.newInstance();
+ public static final JAXBContext ATTRIBUTES_CONTEXT;
+ public static final JAXBContext ATTRIBUTE_CONTEXT;
+ public static final JAXBContext MODULE_CONTEXT;
+ public static final JAXBContext GBEAN_CONTEXT;
+
+ static {
+ try {
+ ATTRIBUTES_CONTEXT = JAXBContext.newInstance(AttributesType.class);
+ MODULE_CONTEXT = JAXBContext.newInstance(ModuleType.class);
+ GBEAN_CONTEXT = JAXBContext.newInstance(GbeanType.class);
+ ATTRIBUTE_CONTEXT = JAXBContext.newInstance(AttributeType.class);
+ } catch (JAXBException e) {
+ throw new RuntimeException("Could not create jaxb contexts for plugin types");
+ }
+ }
+
+
+ public static void writeAttribute(AttributeType metadata, Writer out) throws XMLStreamException, JAXBException {
+ Marshaller marshaller = ATTRIBUTE_CONTEXT.createMarshaller();
+ marshaller.setProperty("jaxb.formatted.output", true);
+ JAXBElement<AttributeType> element = new ObjectFactory().createAttribute(metadata);
+ marshaller.marshal(element, out);
+ }
+ public static String extractAttributeValue(AttributeType attr) throws JAXBException, XMLStreamException {
+ StringWriter sw = new StringWriter();
+ writeAttribute(attr, sw);
+ String s = sw.toString();
+ int start = s.indexOf('>');
+ start = s.indexOf('>', start + 1);
+ int end = s.lastIndexOf('<');
+ if (end < start) {
+ return null;
+ }
+ return s.substring(start + 1, end).trim();
+ }
+
+ public static void writeAttributes(AttributesType metadata, Writer out) throws XMLStreamException, JAXBException {
+ Marshaller marshaller = ATTRIBUTES_CONTEXT.createMarshaller();
+ marshaller.setProperty("jaxb.formatted.output", true);
+ JAXBElement<AttributesType> element = new ObjectFactory().createAttributes(metadata);
+ marshaller.marshal(element, out);
+ }
+
+
+ public static AttributesType loadAttributes(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+ Unmarshaller unmarshaller = ATTRIBUTES_CONTEXT.createUnmarshaller();
+ XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
+ JAXBElement<AttributesType> element = unmarshaller.unmarshal(xmlStream, AttributesType.class);
+ AttributesType pluginList = element.getValue();
+ return pluginList;
+ }
+ public static ModuleType loadModule(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+ Unmarshaller unmarshaller = MODULE_CONTEXT.createUnmarshaller();
+ XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
+ JAXBElement<ModuleType> element = unmarshaller.unmarshal(xmlStream, ModuleType.class);
+ ModuleType pluginList = element.getValue();
+ return pluginList;
+ }
+ public static GbeanType loadGbean(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+ Unmarshaller unmarshaller = GBEAN_CONTEXT.createUnmarshaller();
+ XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
+ JAXBElement<GbeanType> element = unmarshaller.unmarshal(xmlStream, GbeanType.class);
+ GbeanType pluginList = element.getValue();
+ return pluginList;
+ }
+ public static AttributeType loadAttribute(Reader in) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException {
+ Unmarshaller unmarshaller = ATTRIBUTE_CONTEXT.createUnmarshaller();
+ XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
+ JAXBElement<AttributeType> element = unmarshaller.unmarshal(xmlStream, AttributeType.class);
+ AttributeType attributeType = element.getValue();
+ return attributeType;
+ }
+
+/*
+ public static class NamespaceFilter extends XMLFilterImpl {
+ private static String PLUGIN_NS = "http://geronimo.apache.org/xml/ns/plugins-1.3";
+ private static String GBEAN_NS = "http://geronimo.apache.org/xml/ns/attributes-1.2";
+ private static String ENVIRONMENT_NS = "http://geronimo.apache.org/xml/ns/deployment-1.2";
+
+ private String namespace;
+
+ public NamespaceFilter(XMLReader xmlReader) {
+ super(xmlReader);
+ }
+
+ @Override
+ public void startElement(String uri, String localName, String qname, Attributes atts) throws SAXException {
+ if ("plugin-artifact".equals(localName)) {
+ namespace = PLUGIN_NS;
+ } else if ("gbean".equals(localName)) {
+ namespace = GBEAN_NS;
+ } else if ("environment".equals(localName)) {
+ namespace = ENVIRONMENT_NS;
+ }
+ super.startElement(namespace, localName, qname, atts);
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+ super.endElement(namespace, localName, qName);
+ if ("plugin-artifact".equals(localName)) {
+ namespace = null;
+ } else if ("gbean".equals(localName)) {
+ namespace = PLUGIN_NS;
+ } else if ("environment".equals(localName)) {
+ namespace = GBEAN_NS;
+ }
+ }
+ }
+*/
+}
Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/AttributesXmlUtil.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/AttributesXmlUtil.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/AttributesXmlUtil.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/GBeanOverride.java Fri Jan 4 16:47:14 2008
@@ -47,7 +47,6 @@
import org.apache.geronimo.kernel.config.InvalidConfigException;
import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.system.configuration.condition.JexlExpressionParser;
-import org.apache.geronimo.system.plugin.PluginXmlUtil;
import org.apache.geronimo.system.plugin.model.AttributeType;
import org.apache.geronimo.system.plugin.model.GbeanType;
import org.apache.geronimo.system.plugin.model.ReferenceType;
@@ -188,7 +187,7 @@
} else {
String value;
try {
- value = PluginXmlUtil.extractAttributeValue(attr);
+ value = AttributesXmlUtil.extractAttributeValue(attr);
} catch (JAXBException e) {
throw new InvalidGBeanException("Could not extract attribute value from gbean override", e);
} catch (XMLStreamException e) {
@@ -469,7 +468,7 @@
value = "<attribute xmlns='" + ATTRIBUTE_NAMESPACE + "'>" + value.replaceAll("&(?!amp;)", "&") + "</attribute>";
Reader reader = new StringReader(value);
try {
- AttributeType attribute = PluginXmlUtil.loadAttribute(reader);
+ AttributeType attribute = AttributesXmlUtil.loadAttribute(reader);
attribute.setName(name);
String editorClass = propertyEditors.get(name);
if (null != editorClass) {
Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java Fri Jan 4 16:47:14 2008
@@ -60,7 +60,6 @@
import org.apache.geronimo.system.configuration.condition.ParserUtils;
import org.apache.geronimo.system.plugin.model.GbeanType;
import org.apache.geronimo.system.plugin.model.AttributesType;
-import org.apache.geronimo.system.plugin.PluginXmlUtil;
import org.apache.geronimo.system.serverinfo.ServerInfo;
import org.xml.sax.SAXException;
@@ -131,7 +130,7 @@
return prefix;
}
- public synchronized Collection applyOverrides(Artifact configName, Collection untypedGbeanDatas, ClassLoader classLoader) throws InvalidConfigException {
+ public synchronized Collection applyOverrides(Artifact configName, Collection<GBeanData> untypedGbeanDatas, ClassLoader classLoader) throws InvalidConfigException {
// clone the datas since we will be modifying this collection
Collection<GBeanData> gbeanDatas = new ArrayList<GBeanData>(untypedGbeanDatas);
@@ -343,7 +342,7 @@
}
static ServerOverride read(Reader input, JexlExpressionParser expressionParser) throws ParserConfigurationException, IOException, SAXException, JAXBException, XMLStreamException, InvalidGBeanException {
- AttributesType attributes = PluginXmlUtil.loadAttributes(input);
+ AttributesType attributes = AttributesXmlUtil.loadAttributes(input);
return new ServerOverride(attributes, expressionParser);
}
@@ -403,7 +402,7 @@
static void write(ServerOverride serverOverride, Writer writer) throws XMLStreamException, JAXBException, IOException {
AttributesType attributes = serverOverride.writeXml();
- PluginXmlUtil.writeAttributes(attributes, writer);
+ AttributesXmlUtil.writeAttributes(attributes, writer);
writer.flush();
}
Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/ServerOverrideTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/ServerOverrideTest.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/ServerOverrideTest.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/test/java/org/apache/geronimo/system/configuration/ServerOverrideTest.java Fri Jan 4 16:47:14 2008
@@ -35,7 +35,6 @@
import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.system.configuration.condition.JexlExpressionParser;
import org.apache.geronimo.system.configuration.condition.ParserUtils;
-import org.apache.geronimo.system.plugin.PluginXmlUtil;
import org.apache.geronimo.system.plugin.model.GbeanType;
import org.apache.geronimo.system.plugin.model.ModuleType;
@@ -214,7 +213,7 @@
String comment = "This comment should get properly parsed";
Reader in = new StringReader(REFERENCE_COMMENT_XML);
- ModuleType module = PluginXmlUtil.loadModule(in);
+ ModuleType module = AttributesXmlUtil.loadModule(in);
ConfigurationOverride commentConfig = new ConfigurationOverride(module, expressionParser);
assertNotNull(commentConfig);
@@ -241,7 +240,7 @@
public void testReferenceXml() throws Exception {
Reader in = new StringReader(REFERENCE_XML);
- GbeanType gbeanElement = PluginXmlUtil.loadGbean(in);
+ GbeanType gbeanElement = AttributesXmlUtil.loadGbean(in);
GBeanOverride gbean = new GBeanOverride(gbeanElement, expressionParser);
assertCopyIdentical(gbean);
}
@@ -255,7 +254,7 @@
public void testExpressionXml() throws Exception {
Reader in = new StringReader(EXPRESSION_XML);
- GbeanType gbeanElement = PluginXmlUtil.loadGbean(in);
+ GbeanType gbeanElement = AttributesXmlUtil.loadGbean(in);
GBeanOverride gbean = new GBeanOverride(gbeanElement, expressionParser);
assertCopyIdentical(gbean);
GBeanData data = new GBeanData(MockGBean.GBEAN_INFO);
Modified: geronimo/server/trunk/framework/modules/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/pom.xml Fri Jan 4 16:47:14 2008
@@ -14,8 +14,7 @@
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.
---><!-- $Rev$ $Date$ -->
-<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">
+--><!-- $Rev$ $Date$ --><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>
@@ -62,6 +61,7 @@
<module>geronimo-transformer</module>
<module>geronimo-upgrade</module>
<module>geronimo-util</module>
- </modules>
+ <module>geronimo-plugin</module>
+ </modules>
-</project>
+</project>
\ No newline at end of file
Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/pom.xml (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/pom.xml Fri Jan 4 16:47:14 2008
@@ -67,7 +67,12 @@
<artifactId>geronimo-system</artifactId>
<version>${version}</version>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-plugin</artifactId>
+ <version>${version}</version>
+ </dependency>
+
<dependency>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-service-builder</artifactId>
Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenAttributeStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenAttributeStore.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenAttributeStore.java (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/MavenAttributeStore.java Fri Jan 4 16:47:14 2008
@@ -43,7 +43,7 @@
public MavenAttributeStore() {
}
- public Collection applyOverrides(Artifact configurationName, Collection datas, ClassLoader classLoader) {
+ public Collection applyOverrides(Artifact configurationName, Collection<GBeanData> datas, ClassLoader classLoader) {
return datas;
}
Modified: geronimo/server/trunk/plugins/activemq/activemq-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/activemq-jetty/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/activemq-jetty/pom.xml (original)
+++ geronimo/server/trunk/plugins/activemq/activemq-jetty/pom.xml Fri Jan 4 16:47:14 2008
@@ -104,9 +104,10 @@
</dependency>
<dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-deploy-jsr88</artifactId>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>plugin</artifactId>
<version>${version}</version>
+ <type>car</type>
</dependency>
<dependency>
Modified: geronimo/server/trunk/plugins/activemq/activemq-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/activemq-tomcat/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/activemq-tomcat/pom.xml (original)
+++ geronimo/server/trunk/plugins/activemq/activemq-tomcat/pom.xml Fri Jan 4 16:47:14 2008
@@ -104,9 +104,10 @@
</dependency>
<dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-deploy-jsr88</artifactId>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>plugin</artifactId>
<version>${version}</version>
+ <type>car</type>
</dependency>
<dependency>
Modified: geronimo/server/trunk/plugins/clustering/clustering/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/clustering/clustering/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/clustering/clustering/pom.xml (original)
+++ geronimo/server/trunk/plugins/clustering/clustering/pom.xml Fri Jan 4 16:47:14 2008
@@ -43,6 +43,12 @@
<version>${version}</version>
<type>car</type>
</dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>plugin</artifactId>
+ <version>${version}</version>
+ <type>car</type>
+ </dependency>
<dependency>
<groupId>org.apache.geronimo.configs</groupId>
@@ -64,11 +70,6 @@
<version>${version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-deploy-jsr88</artifactId>
- <version>${version}</version>
- </dependency>
</dependencies>
<build>
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ajax/ProgressMonitor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ajax/ProgressMonitor.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ajax/ProgressMonitor.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/ajax/ProgressMonitor.java Fri Jan 4 16:47:14 2008
@@ -17,10 +17,12 @@
package org.apache.geronimo.console.ajax;
+import java.util.Set;
+
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
import org.apache.geronimo.kernel.Kernel;
import org.apache.geronimo.kernel.KernelRegistry;
-import org.apache.geronimo.management.geronimo.J2EEDomain;
-import org.apache.geronimo.management.geronimo.J2EEServer;
import org.apache.geronimo.system.plugin.DownloadResults;
import org.apache.geronimo.system.plugin.PluginInstaller;
import org.directwebremoting.ScriptSession;
@@ -71,9 +73,11 @@
private synchronized PluginInstaller getPluginInstaller() throws Exception {
if (pluginInstaller == null) {
Kernel kernel = KernelRegistry.getSingleKernel();
- J2EEDomain domain = (J2EEDomain) kernel.getGBean(J2EEDomain.class);
- J2EEServer server = domain.getServerInstances()[0];
- this.pluginInstaller = server.getPluginInstaller();
+ Set<AbstractName> pluginInstallers = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
+ if (pluginInstallers.size() == 0) {
+ throw new IllegalStateException("No plugin installer registered");
+ }
+ pluginInstaller = (PluginInstaller) kernel.getGBean(pluginInstallers.iterator().next());
}
return pluginInstaller;
}
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=609072&r1=609071&r2=609072&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 Fri Jan 4 16:47:14 2008
@@ -55,7 +55,7 @@
}
public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
- PluginRepositoryList[] lists = PortletManager.getCurrentServer(request).getPluginRepositoryLists();
+ List<PluginRepositoryList> lists = ManagementHelper.getManagementHelper(request).getPluginRepositoryLists();
List<URL> list = new ArrayList<URL>();
for (PluginRepositoryList repo : lists) {
list.addAll(repo.getRepositories());
@@ -85,11 +85,10 @@
repo = repo+"/";
}
- PluginRepositoryList[] lists = PortletManager.getCurrentServer(request).getPluginRepositoryLists();
+ List<PluginRepositoryList> lists = ManagementHelper.getManagementHelper(request).getPluginRepositoryLists();
// Check for duplicates
- for (int i = 0; i < lists.length; i++) {
- PluginRepositoryList test = lists[i];
+ for (PluginRepositoryList test: lists) {
List<URL> all = test.getRepositories();
for (URL url: all) {
String existing = url.toString();
@@ -101,7 +100,7 @@
}
// Verify the repository and add it if valid
- if(lists.length > 0) {
+ if(lists.size() > 0) {
URL url;
try {
url = new URL(repo);
@@ -142,7 +141,7 @@
return false;
}
}
- lists[0].addUserRepository(url);
+ lists.get(0).addUserRepository(url);
request.setAttribute("repository", repo);
return true;
}
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/DownloadCARHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/DownloadCARHandler.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/DownloadCARHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/DownloadCARHandler.java Fri Jan 4 16:47:14 2008
@@ -73,7 +73,7 @@
try {
PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
if (list == null) {
- list = PortletManager.getCurrentServer(request).getPluginInstaller().listPlugins(new URL(repo), user, pass);
+ list = ManagementHelper.getManagementHelper(request).getPluginInstaller().listPlugins(new URL(repo), user, pass);
request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
}
for (PluginType metadata : list.getPlugin()) {
@@ -109,7 +109,7 @@
try {
PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
if(list == null) {
- list = PortletManager.getCurrentServer(request).getPluginInstaller().listPlugins(new URL(repo), user, pass);
+ list = ManagementHelper.getManagementHelper(request).getPluginInstaller().listPlugins(new URL(repo), user, pass);
request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
}
for (PluginType metadata: list.getPlugin()) {
@@ -131,7 +131,7 @@
PluginListType installList = new PluginListType();
installList.getPlugin().add(copy);
- PluginInstaller configInstaller = PortletManager.getCurrentServer(request).getPluginInstaller();
+ PluginInstaller configInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
Object downloadKey = configInstaller.startInstall(installList, repo, false, user, pass);
DownloadResults results = configInstaller.checkOnInstall(downloadKey);
request.getPortletSession(true).setAttribute(DOWNLOAD_RESULTS_SESSION_KEY, results);
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ExportConfigHandler.java Fri Jan 4 16:47:14 2008
@@ -65,7 +65,7 @@
public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
String configId = request.getParameter("configId");
- PluginType data = PortletManager.getCurrentServer(request).getPluginInstaller().getPluginMetadata(
+ PluginType data = ManagementHelper.getManagementHelper(request).getPluginInstaller().getPluginMetadata(
Artifact.create(configId));
PluginArtifactType instance = data.getPluginArtifact().get(0);
request.setAttribute("configId", PluginInstallerGBean.toArtifact(instance.getModuleId()).toString());
@@ -112,7 +112,7 @@
public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
String configId = request.getParameter("configId");
- PluginType metadata = PortletManager.getCurrentServer(request).getPluginInstaller().getPluginMetadata(Artifact.create(configId));
+ PluginType metadata = ManagementHelper.getManagementHelper(request).getPluginInstaller().getPluginMetadata(Artifact.create(configId));
PluginArtifactType instance = metadata.getPluginArtifact().get(0);
String name = request.getParameter("name");
@@ -179,7 +179,7 @@
}
// Save updated metadata
- PortletManager.getCurrentServer(request).getPluginInstaller().updatePluginMetadata(metadata);
+ ManagementHelper.getManagementHelper(request).getPluginInstaller().updatePluginMetadata(metadata);
response.setRenderParameter("configId", configId);
response.setRenderParameter("name", name);
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=609072&r1=609071&r2=609072&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 Fri Jan 4 16:47:14 2008
@@ -49,14 +49,13 @@
}
public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model) throws PortletException, IOException {
- PluginRepositoryList[] lists = PortletManager.getCurrentServer(request).getPluginRepositoryLists();
-
+ List<PluginRepositoryList> lists = ManagementHelper.getManagementHelper(request).getPluginRepositoryLists();
+
// clear out the catalog if it was previously loaded
request.getPortletSession(true).removeAttribute(CONFIG_LIST_SESSION_KEY);
List<URL> list = new ArrayList<URL>();
- for (int i = 0; i < lists.length; i++) {
- PluginRepositoryList repo = lists[i];
+ for (PluginRepositoryList repo: lists) {
list.addAll(repo.getRepositories());
}
ConfigurationData[] configs = PortletManager.getConfigurations(request, null, false);
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ListHandler.java Fri Jan 4 16:47:14 2008
@@ -90,7 +90,7 @@
PluginListType data = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
if (data==null) {
try {
- data = PortletManager.getCurrentServer(request).getPluginInstaller().listPlugins(new URL(repository), username, password);
+ data = ManagementHelper.getManagementHelper(request).getPluginInstaller().listPlugins(new URL(repository), username, password);
} catch (FailedLoginException e) {
throw new PortletException("Invalid login for Maven repository '"+repository+"'", e);
}
@@ -101,7 +101,7 @@
}
List<PluginInfoBean> plugins = new ArrayList<PluginInfoBean>();
- PluginInstaller pluginInstaller = PortletManager.getCurrentServer(request).getPluginInstaller();
+ PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
for (PluginType metadata: data.getPlugin()) {
Added: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java?rev=609072&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java (added)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java Fri Jan 4 16:47:14 2008
@@ -0,0 +1,92 @@
+/*
+ * 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.console.car;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Set;
+
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
+
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.system.plugin.PluginInstaller;
+import org.apache.geronimo.system.plugin.PluginRepositoryList;
+import org.apache.geronimo.console.util.PortletManager;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class ManagementHelper {
+
+ private final static String PLUGIN_HELPER_KEY = "org.apache.geronimo.console.PluginManagementHelper";
+ private final Kernel kernel;
+ private PluginInstaller pluginInstaller;
+ private List<PluginRepositoryList> pluginRepositoryLists;
+
+ public static ManagementHelper getManagementHelper(PortletRequest request) {
+ ManagementHelper helper = (ManagementHelper) request.getPortletSession(true).getAttribute(PLUGIN_HELPER_KEY, PortletSession.APPLICATION_SCOPE);
+ if (helper == null) {
+ Kernel kernel = PortletManager.getKernel();
+ helper = new ManagementHelper(kernel);
+ request.getPortletSession().setAttribute(PLUGIN_HELPER_KEY, helper, PortletSession.APPLICATION_SCOPE);
+ }
+ return helper;
+ }
+
+ public ManagementHelper(Kernel kernel) {
+ this.kernel = kernel;
+ }
+
+ public PluginInstaller getPluginInstaller() {
+ if (pluginInstaller == null) {
+ Set<AbstractName> pluginInstallers = kernel.listGBeans(new AbstractNameQuery(PluginInstaller.class.getName()));
+ if (pluginInstallers.size() == 0) {
+ throw new IllegalStateException("No plugin installer registered");
+ }
+ try {
+ pluginInstaller = (PluginInstaller) kernel.getGBean(pluginInstallers.iterator().next());
+ } catch (GBeanNotFoundException e) {
+ throw new IllegalStateException("Plugin installer cannot be retrieved from kernel");
+ }
+ }
+ return pluginInstaller;
+ }
+
+ public List<PluginRepositoryList> getPluginRepositoryLists() {
+ if (this.pluginRepositoryLists == null) {
+ Set<AbstractName> names = kernel.listGBeans(new AbstractNameQuery(PluginRepositoryList.class.getName()));
+ List<PluginRepositoryList> pluginRepositoryLists = new ArrayList<PluginRepositoryList>(names.size());
+ for (AbstractName name: names) {
+ try {
+ pluginRepositoryLists.add((PluginRepositoryList)kernel.getGBean(name));
+ } catch (GBeanNotFoundException e) {
+ //ignore?
+ }
+ }
+ this.pluginRepositoryLists = pluginRepositoryLists;
+ }
+ return this.pluginRepositoryLists;
+ }
+}
Propchange: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ManagementHelper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/UpdateListHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/UpdateListHandler.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/UpdateListHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/UpdateListHandler.java Fri Jan 4 16:47:14 2008
@@ -41,9 +41,9 @@
}
public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
- PluginRepositoryList[] lists = PortletManager.getCurrentServer(request).getPluginRepositoryLists();
- for (int i = 0; i < lists.length; i++) {
- lists[i].refresh();
+ List<PluginRepositoryList> lists = ManagementHelper.getManagementHelper(request).getPluginRepositoryLists();
+ for (PluginRepositoryList repo: lists) {
+ repo.refresh();
}
return INDEX_MODE+BEFORE_ACTION;
}
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/car/ViewPluginDownloadHandler.java Fri Jan 4 16:47:14 2008
@@ -73,7 +73,7 @@
try {
PluginListType list = (PluginListType) request.getPortletSession(true).getAttribute(CONFIG_LIST_SESSION_KEY);
if(list == null) {
- list = PortletManager.getCurrentServer(request).getPluginInstaller().listPlugins(new URL(repo), user, pass);
+ list = ManagementHelper.getManagementHelper(request).getPluginInstaller().listPlugins(new URL(repo), user, pass);
request.getPortletSession(true).setAttribute(CONFIG_LIST_SESSION_KEY, list);
}
for (PluginType metadata: list.getPlugin()) {
@@ -95,7 +95,7 @@
// see if the plugin is installable. if not then provide the details
String validationOk = "All requirements for this plugin have been met.";
StringBuffer validationNotOk = new StringBuffer();
- PluginInstaller pluginInstaller = PortletManager.getCurrentServer(request).getPluginInstaller();
+ PluginInstaller pluginInstaller = ManagementHelper.getManagementHelper(request).getPluginInstaller();
PluginType holder = PluginInstallerGBean.copy(plugin.getPlugin(), plugin.getPluginArtifact());
try {
pluginInstaller.validatePlugin(holder);
Modified: geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java (original)
+++ geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/PortletManager.java Fri Jan 4 16:47:14 2008
@@ -85,7 +85,7 @@
return new KernelManagementHelper(kernel);
}
- private static Kernel getKernel() {
+ public static Kernel getKernel() {
//todo: consider making this configurable; we could easily connect to a remote kernel if we wanted to
Kernel kernel = null;
try {
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=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-jetty/pom.xml (original)
+++ geronimo/server/trunk/plugins/console/console-jetty/pom.xml Fri Jan 4 16:47:14 2008
@@ -56,11 +56,12 @@
<version>${version}</version>
<type>car</type>
</dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-deploy-jsr88</artifactId>
+ <!-- TODO temporary? -->
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>plugin</artifactId>
<version>${version}</version>
+ <type>car</type>
</dependency>
<dependency>
Modified: geronimo/server/trunk/plugins/console/console-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-tomcat/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-tomcat/pom.xml (original)
+++ geronimo/server/trunk/plugins/console/console-tomcat/pom.xml Fri Jan 4 16:47:14 2008
@@ -56,13 +56,14 @@
<version>${version}</version>
<type>car</type>
</dependency>
-
+ <!-- TODO temporary? -->
<dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-deploy-jsr88</artifactId>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>plugin</artifactId>
<version>${version}</version>
+ <type>car</type>
</dependency>
-
+
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
Modified: geronimo/server/trunk/plugins/hotdeploy/hot-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/hotdeploy/hot-deployer/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/hotdeploy/hot-deployer/pom.xml (original)
+++ geronimo/server/trunk/plugins/hotdeploy/hot-deployer/pom.xml Fri Jan 4 16:47:14 2008
@@ -39,7 +39,7 @@
<dependency>
<groupId>org.apache.geronimo.configs</groupId>
- <artifactId>rmi-naming</artifactId>
+ <artifactId>plugin</artifactId>
<version>${version}</version>
<type>car</type>
</dependency>
@@ -63,12 +63,6 @@
<version>${version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-deploy-jsr88</artifactId>
- <version>${version}</version>
- </dependency>
-
</dependencies>
<build>
Modified: geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/plan/plan.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/plan/plan.xml Fri Jan 4 16:47:14 2008
@@ -69,10 +69,6 @@
<reference name="WritableRepos"/>
<reference name="SecurityRealms"/>
<reference name="KeystoreManagers"/>
- <reference name="PluginRepoLists"/>
- <reference name="PluginInstaller">
- <name>PluginInstaller</name>
- </reference>
<reference name="ConfigurationManager">
<name>ConfigurationManager</name>
</reference>
Modified: geronimo/server/trunk/plugins/plancreator/plancreator-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-jetty/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-jetty/pom.xml (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-jetty/pom.xml Fri Jan 4 16:47:14 2008
@@ -78,9 +78,10 @@
</dependency>
<dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-deploy-jsr88</artifactId>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>plugin</artifactId>
<version>${version}</version>
+ <type>car</type>
</dependency>
<dependency>
Modified: geronimo/server/trunk/plugins/plancreator/plancreator-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-tomcat/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-tomcat/pom.xml (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-tomcat/pom.xml Fri Jan 4 16:47:14 2008
@@ -78,9 +78,10 @@
</dependency>
<dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-deploy-jsr88</artifactId>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>plugin</artifactId>
<version>${version}</version>
+ <type>car</type>
</dependency>
<dependency>
Modified: geronimo/server/trunk/plugins/system-database/system-database-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/system-database/system-database-jetty/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/system-database/system-database-jetty/pom.xml (original)
+++ geronimo/server/trunk/plugins/system-database/system-database-jetty/pom.xml Fri Jan 4 16:47:14 2008
@@ -110,9 +110,10 @@
</dependency>
<dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-deploy-jsr88</artifactId>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>plugin</artifactId>
<version>${version}</version>
+ <type>car</type>
</dependency>
<dependency>
Modified: geronimo/server/trunk/plugins/system-database/system-database-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/system-database/system-database-tomcat/pom.xml?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/system-database/system-database-tomcat/pom.xml (original)
+++ geronimo/server/trunk/plugins/system-database/system-database-tomcat/pom.xml Fri Jan 4 16:47:14 2008
@@ -110,9 +110,10 @@
</dependency>
<dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-deploy-jsr88</artifactId>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>plugin</artifactId>
<version>${version}</version>
+ <type>car</type>
</dependency>
<dependency>
Modified: geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/DOMUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/DOMUtils.java?rev=609072&r1=609071&r2=609072&view=diff
==============================================================================
--- geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/DOMUtils.java (original)
+++ geronimo/server/trunk/testsupport/testsupport-common/src/main/java/org/apache/geronimo/testsupport/DOMUtils.java Fri Jan 4 16:47:14 2008
@@ -66,13 +66,13 @@
// compare element names
if (!expectedElement.getLocalName().equals(actualElement.getLocalName())) {
- throw new Exception("Element names do match: " + expectedElement.getLocalName() + " " + actualElement.getLocalName());
+ throw new Exception("Element names do not match: " + expectedElement.getLocalName() + " " + actualElement.getLocalName());
}
// compare element ns
String expectedNS = expectedElement.getNamespaceURI();
String actualNS = actualElement.getNamespaceURI();
- if ((expectedNS != actualNS) || (expectedNS != null && !expectedNS.equals(actualNS))) {
- throw new Exception("Element namespaces names do match: " + expectedNS + " " + actualNS);
+ if ((expectedNS == null && actualNS != null) || (expectedNS != null && !expectedNS.equals(actualNS))) {
+ throw new Exception("Element namespaces names do not match: " + expectedNS + " " + actualNS);
}
String elementName = "{" + expectedElement.getNamespaceURI() + "}" + actualElement.getLocalName();
@@ -80,11 +80,14 @@
// compare attributes
NamedNodeMap expectedAttrs = expectedElement.getAttributes();
NamedNodeMap actualAttrs = actualElement.getAttributes();
- if (expectedAttrs.getLength() != actualAttrs.getLength()) {
- throw new Exception(elementName + ": Number of attributes do not match up: " + expectedAttrs.getLength() + " " + actualAttrs.getLength());
+ if (countNonNamespaceAttribures(expectedAttrs) != countNonNamespaceAttribures(actualAttrs)) {
+ throw new Exception(elementName + ": Number of attributes do not match up: " + countNonNamespaceAttribures(expectedAttrs) + " " + countNonNamespaceAttribures(actualAttrs));
}
for (int i = 0; i < expectedAttrs.getLength(); i++) {
Attr expectedAttr = (Attr)expectedAttrs.item(i);
+ if (expectedAttr.getName().startsWith("xmlns")) {
+ continue;
+ }
Attr actualAttr = null;
if (expectedAttr.getNamespaceURI() == null) {
actualAttr = (Attr)actualAttrs.getNamedItem(expectedAttr.getName());
@@ -118,6 +121,17 @@
throw new Exception("Text does not match: " + expectedData + " " + actualData);
}
}
- }
+ }
+
+ private static int countNonNamespaceAttribures(NamedNodeMap attrs) {
+ int n = 0;
+ for (int i = 0; i< attrs.getLength(); i++ ) {
+ Attr attr = (Attr) attrs.item(i);
+ if (!attr.getName().startsWith("xmlns")) {
+ n++;
+ }
+ }
+ return n;
+ }
}