You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/03/16 07:04:44 UTC
svn commit: r637545 - in /geronimo/gshell/trunk/gshell-model: ./ src/
src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/geronimo/ src/main/java/org/apache/geronimo/gshell/
src/main/java/org/apache/geronimo/g...
Author: jdillon
Date: Sat Mar 15 23:04:39 2008
New Revision: 637545
URL: http://svn.apache.org/viewvc?rev=637545&view=rev
Log:
Start of new module to hold all of the XML model related bits for new configuration system
Added:
geronimo/gshell/trunk/gshell-model/
geronimo/gshell/trunk/gshell-model/pom.xml (with props)
geronimo/gshell/trunk/gshell-model/src/
geronimo/gshell/trunk/gshell-model/src/main/
geronimo/gshell/trunk/gshell-model/src/main/java/
geronimo/gshell/trunk/gshell-model/src/main/java/org/
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/Application.java
- copied, changed from r637012, geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/ApplicationMarshaller.java (with props)
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Dependency.java (with props)
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelElement.java (with props)
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelRoot.java (with props)
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/Marshaller.java (with props)
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/MarshallerSupport.java (with props)
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java (with props)
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/
geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java (with props)
geronimo/gshell/trunk/gshell-model/src/main/resources/
geronimo/gshell/trunk/gshell-model/src/test/
geronimo/gshell/trunk/gshell-model/src/test/java/
geronimo/gshell/trunk/gshell-model/src/test/java/org/
geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/
geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/
geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/
geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/
geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/
geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java
- copied, changed from r637012, geronimo/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/layout/model/GroupNodeTest.java
geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/common/
geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/marshal/
geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/plugin/
geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/settings/
geronimo/gshell/trunk/gshell-model/src/test/resources/
geronimo/gshell/trunk/gshell-model/src/test/resources/org/
geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/
geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/
geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/
geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/
geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/application/
geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/plugin/
geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/settings/
Added: geronimo/gshell/trunk/gshell-model/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/pom.xml?rev=637545&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-model/pom.xml (added)
+++ geronimo/gshell/trunk/gshell-model/pom.xml Sat Mar 15 23:04:39 2008
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<!-- $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>
+
+ <parent>
+ <groupId>org.apache.geronimo.gshell</groupId>
+ <artifactId>gshell</artifactId>
+ <version>1.0-alpha-2-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gshell-model</artifactId>
+ <name>GShell Model</name>
+
+ <description>
+ GShell XML models.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.gshell.support</groupId>
+ <artifactId>gshell-common</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-model/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-model/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-model/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Copied: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/Application.java (from r637012, geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/Application.java?p2=geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/Application.java&p1=geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java&r1=637012&r2=637545&rev=637545&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/layout/model/Layout.java (original)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/Application.java Sat Mar 15 23:04:39 2008
@@ -17,20 +17,23 @@
* under the License.
*/
-package org.apache.geronimo.gshell.layout.model;
+package org.apache.geronimo.gshell.model.application;
import com.thoughtworks.xstream.annotations.XStreamAlias;
+import org.apache.geronimo.gshell.model.common.ModelRoot;
+import org.apache.geronimo.gshell.model.common.Dependency;
+
+import java.util.List;
+import java.util.ArrayList;
/**
- * The root container for a layout tree.
+ * ???
*
* @version $Rev$ $Date$
*/
-@XStreamAlias("layout")
-public class Layout
- extends GroupNode
+@XStreamAlias("application")
+public class Application
+ extends ModelRoot
{
- public Layout() {
- super(ROOT);
- }
+ private List<Dependency> dependencies = new ArrayList<Dependency>();
}
Added: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/ApplicationMarshaller.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/ApplicationMarshaller.java?rev=637545&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/ApplicationMarshaller.java (added)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/ApplicationMarshaller.java Sat Mar 15 23:04:39 2008
@@ -0,0 +1,33 @@
+/*
+ * 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.gshell.model.application;
+
+import org.apache.geronimo.gshell.model.marshal.MarshallerSupport;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public class ApplicationMarshaller
+ extends MarshallerSupport<Application>
+{
+ // ???
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/ApplicationMarshaller.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/ApplicationMarshaller.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/ApplicationMarshaller.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Dependency.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Dependency.java?rev=637545&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Dependency.java (added)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Dependency.java Sat Mar 15 23:04:39 2008
@@ -0,0 +1,72 @@
+/*
+ * 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.gshell.model.common;
+
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@XStreamAlias("dependency")
+public class Dependency
+ extends ModelElement
+{
+ private String groupId;
+
+ private String artifactId;
+
+ private String classifier;
+
+ private String version;
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(final String groupId) {
+ this.groupId = groupId;
+ }
+
+ public String getArtifactId() {
+ return artifactId;
+ }
+
+ public void setArtifactId(final String artifactId) {
+ this.artifactId = artifactId;
+ }
+
+ public String getClassifier() {
+ return classifier;
+ }
+
+ public void setClassifier(final String classifier) {
+ this.classifier = classifier;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(final String version) {
+ this.version = version;
+ }
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Dependency.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Dependency.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/Dependency.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelElement.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelElement.java?rev=637545&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelElement.java (added)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelElement.java Sat Mar 15 23:04:39 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.gshell.model.common;
+
+import org.apache.geronimo.gshell.common.tostring.ReflectionToStringBuilder;
+import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class ModelElement
+{
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
+ }
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelElement.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelElement.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelRoot.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelRoot.java?rev=637545&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelRoot.java (added)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelRoot.java Sat Mar 15 23:04:39 2008
@@ -0,0 +1,34 @@
+/*
+ * 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.gshell.model.common;
+
+import org.apache.geronimo.gshell.common.tostring.ReflectionToStringBuilder;
+import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class ModelRoot
+ extends ModelElement
+{
+ // ???
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelRoot.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelRoot.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/ModelRoot.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/Marshaller.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/Marshaller.java?rev=637545&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/Marshaller.java (added)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/Marshaller.java Sat Mar 15 23:04:39 2008
@@ -0,0 +1,34 @@
+/*
+ * 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.gshell.model.marshal;
+
+import java.io.InputStream;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public interface Marshaller<T>
+{
+ String marshal(T root);
+
+ T unmarshal(InputStream input);
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/Marshaller.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/Marshaller.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/Marshaller.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/MarshallerSupport.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/MarshallerSupport.java?rev=637545&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/MarshallerSupport.java (added)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/MarshallerSupport.java Sat Mar 15 23:04:39 2008
@@ -0,0 +1,66 @@
+/*
+ * 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.gshell.model.marshal;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+import com.thoughtworks.xstream.io.xml.XppDriver;
+
+import java.io.InputStream;
+
+/**
+ * Support for model marshallers.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class MarshallerSupport<T>
+ implements Marshaller<T>
+{
+ protected XStream createXStream() {
+ XStream xs;
+
+ try {
+ Class.forName("org.xmlpull.mxp1.MXParser");
+ xs = new XStream(new XppDriver());
+ }
+ catch (ClassNotFoundException ignore) {
+ xs = new XStream(new DomDriver());
+ }
+
+ //
+ // TODO: Process annotations... how to do tht from T ?
+ //
+
+ return xs;
+ }
+
+ public String marshal(final T root) {
+ assert root != null;
+
+ return createXStream().toXML(root);
+ }
+
+ public T unmarshal(final InputStream input) {
+ assert input != null;
+
+ //noinspection unchecked
+ return (T)createXStream().fromXML(input);
+ }
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/MarshallerSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/MarshallerSupport.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/marshal/MarshallerSupport.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java?rev=637545&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java (added)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java Sat Mar 15 23:04:39 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.gshell.model.plugin;
+
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+import org.apache.geronimo.gshell.model.common.ModelRoot;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@XStreamAlias("plugin")
+public class Plugin
+ extends ModelRoot
+{
+ // ???
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java?rev=637545&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java (added)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java Sat Mar 15 23:04:39 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.gshell.model.settings;
+
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+import org.apache.geronimo.gshell.model.common.ModelRoot;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+@XStreamAlias("settings")
+public class Settings
+ extends ModelRoot
+{
+ // ???
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Copied: geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java (from r637012, geronimo/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/layout/model/GroupNodeTest.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java?p2=geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java&p1=geronimo/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/layout/model/GroupNodeTest.java&r1=637012&r2=637545&rev=637545&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/test/java/org/apache/geronimo/gshell/layout/model/GroupNodeTest.java (original)
+++ geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java Sat Mar 15 23:04:39 2008
@@ -17,48 +17,26 @@
* under the License.
*/
-package org.apache.geronimo.gshell.layout.model;
+package org.apache.geronimo.gshell.model.application;
-import com.thoughtworks.xstream.XStream;
import junit.framework.TestCase;
/**
- * Test for the {@link GroupNode} class.
+ * Test for the {@link ApplicationMarshaller} class.
*
* @version $Rev$ $Date$
*/
-public class GroupNodeTest
+public class ApplicationMarshallerTest
extends TestCase
{
- public void testAddLinks() throws Exception {
- GroupNode group = new GroupNode("test");
+ private ApplicationMarshaller marshaller = new ApplicationMarshaller();
+
+ public void testMarshal() throws Exception {
+ Application root = new Application();
- Node n1 = new CommandNode("a", "b");
+ String xml = marshaller.marshal(root);
+ assertNotNull(xml);
- group.add(n1);
-
- assertEquals(group, n1.getParent());
- }
-
- public void testDeserializeLinks() throws Exception {
- GroupNode g1 = new GroupNode("test");
-
- Node n1 = new CommandNode("a", "b");
-
- g1.add(n1);
-
- XStream xs = new XStream();
-
- xs.processAnnotations(GroupNode.class);
-
- String xml = xs.toXML(g1);
-
- System.err.println("XML: " + xml);
-
- GroupNode g2 = (GroupNode) xs.fromXML(xml);
-
- Node n2 = g2.nodes().iterator().next();
-
- assertEquals(g2, n2.getParent());
+ System.out.println(xml);
}
}