You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/05/23 16:13:14 UTC

svn commit: r408901 [2/2] - in /incubator/servicemix/branches/java5: ./ servicemix-core/ servicemix-core/src/main/java/org/apache/servicemix/ servicemix-core/src/main/java/org/apache/servicemix/jbi/config/ servicemix-core/src/main/java/org/apache/servi...

Added: incubator/servicemix/branches/java5/servicemix-schemas/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-schemas/pom.xml?rev=408901&view=auto
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-schemas/pom.xml (added)
+++ incubator/servicemix/branches/java5/servicemix-schemas/pom.xml Tue May 23 07:13:08 2006
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed 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: 356052 $ $Date: 2005-12-11 14:41:20 -0800 (dim., 11 déc. 2005) $ -->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.servicemix</groupId>
+    <artifactId>servicemix</artifactId>
+    <version>3.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>servicemix-schemas</artifactId>
+  <packaging>jar</packaging>
+  <name>ServiceMix :: Schemas</name>
+  <description>ServiceMix JAXB2 Schemas</description>
+  
+  <dependencies>
+    <dependency>
+      <groupId>javax.xml</groupId>
+      <artifactId>jaxb-impl</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+    </dependency>
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>jaxb2-maven-plugin</artifactId>
+        <version>1.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>xjc</goal>
+            </goals>
+            <configuration>
+              <explicitAnnotation>true</explicitAnnotation>
+            </configuration>
+          </execution>
+       </executions>
+      </plugin>
+    </plugins>
+  </build>
+  
+</project>
+

Added: incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/org/apache/servicemix/schemas/deployment/DescriptorFactory.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/org/apache/servicemix/schemas/deployment/DescriptorFactory.java?rev=408901&view=auto
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/org/apache/servicemix/schemas/deployment/DescriptorFactory.java (added)
+++ incubator/servicemix/branches/java5/servicemix-schemas/src/main/java/org/apache/servicemix/schemas/deployment/DescriptorFactory.java Tue May 23 07:13:08 2006
@@ -0,0 +1,173 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.servicemix.schemas.deployment;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author gnodet (Guillaume Nodet)
+ * @version $Revision: 359151 $
+ */ 
+public class DescriptorFactory {
+
+	public static final String TYPE_SERVICE_ENGINE = "service-engine";
+	public static final String TYPE_BINDING_COMPONENT = "binding-component";
+	
+	public static final String DELEGATION_PARENT_FIRST = "parent-first";
+	public static final String DELEGATION_SELF_FIRST = "self-first";
+	
+    public static final String DESCRIPTOR_FILE = "META-INF/jbi.xml";
+
+    private static Log log = LogFactory.getLog(DescriptorFactory.class);
+    
+    /**
+     * Build a jbi descriptor from a file archive
+     * 
+     * @param descriptorFile path to the jbi descriptor, or to the root directory
+     * @return the Descriptor object
+     */
+    public static Descriptor buildDescriptor(File descriptorFile) {
+        if (descriptorFile.isDirectory()) {
+            descriptorFile = new File(descriptorFile, DESCRIPTOR_FILE);
+        }
+        if (descriptorFile.isFile()) {
+            try {
+                return buildDescriptor(descriptorFile.toURL());
+            } catch (MalformedURLException e) {
+                throw new RuntimeException("There is a bug here...", e);
+            }
+        }
+        return null;
+    }
+    
+    /**
+     * Build a jbi descriptor from the specified URL
+     * 
+     * @param url url to the jbi descriptor
+     * @return the Descriptor object
+     */
+    public static Descriptor buildDescriptor(URL url) {
+        try {
+            JAXBContext context = JAXBContext.newInstance(Descriptor.class);
+            return (Descriptor) context.createUnmarshaller().unmarshal(url);
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new RuntimeException("Unable to create descriptor from " + url, e);
+        }
+    }
+    
+    /**
+     * Check validity of the JBI descriptor
+     * @param descriptor the descriptor to check
+     * @throws Exception if the descriptor is not valid
+     */
+    public static void checkDescriptor(Descriptor descriptor) throws Exception {
+        // TODO
+    }
+
+    /**
+     * Retrieves the jbi descriptor as a string
+     * 
+     * @param descriptorFile path to the jbi descriptor, or to the root directory
+     * @return the contents of the jbi descriptor
+     */
+    public static String getDescriptorAsText(File descriptorFile) {
+        if (descriptorFile.isDirectory()) {
+            descriptorFile = new File(descriptorFile, DESCRIPTOR_FILE);
+        }
+        if (descriptorFile.isFile()) {
+            try {
+                ByteArrayOutputStream os = new ByteArrayOutputStream();
+                InputStream is = new FileInputStream(descriptorFile);
+                try {
+                    byte[] buffer = new byte[4096];
+                    int len;
+                    while ((len = is.read(buffer)) >= 0) {
+                        os.write(buffer, 0, len);
+                    }
+                } finally {
+                    is.close();
+                    os.close();
+                }
+                return os.toString();
+            } catch (Exception e) {
+                log.debug("Error reading jbi descritor: " + descriptorFile, e);
+            }
+        }
+        return null;
+    }
+
+	public static DocumentFragment getDescriptorExtension(Component descriptor) {
+		try {
+			DocumentFragment df = null;
+			if (descriptor.getAnyOrAny().size() > 0) {
+				Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+				df = doc.createDocumentFragment();
+				for (Element element : descriptor.getAnyOrAny()) {
+					df.appendChild(doc.importNode(element, true));
+				}
+			}
+			return df;
+		} catch (Exception e) {
+			throw new RuntimeException("Unable to create descriptor extension", e);
+		}
+	}
+	
+	public static boolean isBindingComponent(Component component) {
+		return TYPE_BINDING_COMPONENT.equals(component.getType());
+	}
+
+	public static boolean isServiceEngine(Component component) {
+		return TYPE_SERVICE_ENGINE.equals(component.getType());
+	}
+	
+	public static boolean isBCLParentFirst(Component component) {
+		return DELEGATION_PARENT_FIRST.equals(component.getBootstrapClassLoaderDelegation());
+	}
+
+	public static boolean isBCLSelfFirst(Component component) {
+		return DELEGATION_SELF_FIRST.equals(component.getBootstrapClassLoaderDelegation());
+	}
+
+	public static boolean isCCLParentFirst(Component component) {
+		return DELEGATION_PARENT_FIRST.equals(component.getComponentClassLoaderDelegation());
+	}
+
+	public static boolean isCCLSelfFirst(Component component) {
+		return DELEGATION_SELF_FIRST.equals(component.getComponentClassLoaderDelegation());
+	}
+	
+	public static boolean isSLParentFirst(Descriptor.SharedLibrary sl) {
+		return DELEGATION_PARENT_FIRST.equals(sl.getClassLoaderDelegation());
+	}
+
+}

Added: incubator/servicemix/branches/java5/servicemix-schemas/src/main/xjb/jbi.xjb
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-schemas/src/main/xjb/jbi.xjb?rev=408901&view=auto
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-schemas/src/main/xjb/jbi.xjb (added)
+++ incubator/servicemix/branches/java5/servicemix-schemas/src/main/xjb/jbi.xjb Tue May 23 07:13:08 2006
@@ -0,0 +1,32 @@
+<jxb:bindings version="1.0"
+               xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+               xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+  <jxb:bindings schemaLocation="../xsd/jbi.xsd" node="/xs:schema">
+    <jxb:schemaBindings>
+      <jxb:package name="org.apache.servicemix.schemas.deployment" />
+    </jxb:schemaBindings>
+    <jxb:bindings node="//xs:element[@name='jbi']">
+      <jxb:class name="Descriptor"/>
+    </jxb:bindings>
+  </jxb:bindings>
+
+  <jxb:bindings schemaLocation="../xsd/management-message.xsd" node="/xs:schema">
+    <jxb:schemaBindings>
+      <jxb:package name="org.apache.servicemix.schemas.management" />
+    </jxb:schemaBindings>
+  </jxb:bindings>
+  
+  <jxb:bindings schemaLocation="../xsd/component-info-list.xsd" node="/xs:schema">
+    <jxb:schemaBindings>
+      <jxb:package name="org.apache.servicemix.schemas.components" />
+    </jxb:schemaBindings>
+  </jxb:bindings>
+  
+  <jxb:bindings schemaLocation="../xsd/service-assembly-info-list.xsd" node="/xs:schema">
+    <jxb:schemaBindings>
+      <jxb:package name="org.apache.servicemix.schemas.assemblies" />
+    </jxb:schemaBindings>
+  </jxb:bindings>
+  
+</jxb:bindings>

Added: incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/component-info-list.xsd
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/component-info-list.xsd?rev=408901&view=auto
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/component-info-list.xsd (added)
+++ incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/component-info-list.xsd Tue May 23 07:13:08 2006
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/jbi/component-info-list" xmlns:this="http://java.sun.com/xml/ns/jbi/component-info-list">
+  <xs:element name="component-info-list">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="this:component-info"/>
+      </xs:sequence>
+      <xs:attribute name="version" use="required" type="xs:decimal"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="component-info">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="this:description"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:any namespace="##other" processContents="skip"/>
+          <xs:any namespace="##local" processContents="skip"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="type" use="required">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="service-engine"/>
+            <xs:enumeration value="binding-component"/>
+            <xs:enumeration value="shared-library"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="state" use="required">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="Shutdown"/>
+            <xs:enumeration value="Started"/>
+            <xs:enumeration value="Stopped"/>
+            <xs:enumeration value="Unknown"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="description" type="xs:string"/>
+</xs:schema>

Added: incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/jbi.xsd
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/jbi.xsd?rev=408901&view=auto
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/jbi.xsd (added)
+++ incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/jbi.xsd Tue May 23 07:13:08 2006
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/jbi" xmlns:this="http://java.sun.com/xml/ns/jbi">
+  <xs:element name="jbi">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element ref="this:component"/>
+        <xs:element ref="this:service-assembly"/>
+        <xs:group ref="this:shared-library"/>
+        <xs:element ref="this:services"/>
+      </xs:choice>
+      <xs:attribute name="version" use="required" type="xs:decimal"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="component">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="this:identification"/>
+        <xs:element ref="this:component-class-name"/>
+        <xs:element ref="this:component-class-path"/>
+        <xs:element ref="this:bootstrap-class-name"/>
+        <xs:element ref="this:bootstrap-class-path"/>
+        <xs:group minOccurs="0" maxOccurs="unbounded" ref="this:shared-library-list"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:any namespace="##other" processContents="skip"/>
+          <xs:any namespace="##local" processContents="skip"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="type" use="required">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="service-engine"/>
+            <xs:enumeration value="binding-component"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="component-class-loader-delegation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="parent-first"/>
+            <xs:enumeration value="self-first"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="bootstrap-class-loader-delegation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="parent-first"/>
+            <xs:enumeration value="self-first"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="component-class-name">
+    <xs:complexType mixed="true">
+      <xs:attribute name="description"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="component-class-path" type="this:class-path"/>
+  <xs:element name="bootstrap-class-name" type="xs:string"/>
+  <xs:element name="bootstrap-class-path" type="this:class-path"/>
+  <xs:group name="shared-library">
+    <xs:sequence>
+      <xs:element name="shared-library">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="this:identification"/>
+            <xs:element ref="this:shared-library-class-path"/>
+          </xs:sequence>
+          <xs:attribute name="class-loader-delegation">
+            <xs:simpleType>
+              <xs:restriction base="xs:token">
+                <xs:enumeration value="parent-first"/>
+                <xs:enumeration value="self-first"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+          <xs:attribute name="version"/>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="shared-library-class-path" type="this:class-path"/>
+  <xs:group name="shared-library-list">
+    <xs:sequence>
+      <xs:element name="shared-library">
+        <xs:complexType mixed="true">
+          <xs:attribute name="version"/>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="service-assembly">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="this:identification"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="this:service-unit"/>
+        <xs:element minOccurs="0" ref="this:connections"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:any namespace="##other" processContents="skip"/>
+          <xs:any namespace="##local" processContents="skip"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="service-unit">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="this:identification"/>
+        <xs:element ref="this:target"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:any namespace="##other" processContents="skip"/>
+          <xs:any namespace="##local" processContents="skip"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="target">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="this:artifacts-zip"/>
+        <xs:element ref="this:component-name"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="artifacts-zip" type="xs:string"/>
+  <xs:element name="component-name" type="xs:string"/>
+  <xs:element name="identification">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="this:name"/>
+        <xs:element ref="this:description"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:any namespace="##other" processContents="skip"/>
+          <xs:any namespace="##local" processContents="skip"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="name" type="xs:string"/>
+  <xs:element name="description" type="xs:string"/>
+  <xs:complexType name="class-path">
+    <xs:sequence>
+      <xs:element maxOccurs="unbounded" ref="this:path-element"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="path-element" type="xs:string"/>
+  <xs:element name="connections">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="this:connection"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:any namespace="##other" processContents="skip"/>
+          <xs:any namespace="##local" processContents="skip"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="connection">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="this:consumer"/>
+        <xs:element ref="this:provider"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="consumer">
+    <xs:complexType>
+      <xs:attribute name="interface-name" type="xs:QName"/>
+      <xs:attribute name="service-name" type="xs:QName"/>
+      <xs:attribute name="endpoint-name"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="provider">
+    <xs:complexType>
+      <xs:attribute name="service-name" use="required" type="xs:QName"/>
+      <xs:attribute name="endpoint-name" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="services">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="this:provides"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="this:consumes"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:any namespace="##other" processContents="skip"/>
+          <xs:any namespace="##local" processContents="skip"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="binding-component" use="required" type="xs:boolean"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="provides">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:any namespace="##other" processContents="skip"/>
+        <xs:any namespace="##local" processContents="skip"/>
+      </xs:choice>
+      <xs:attribute name="interface-name" use="required" type="xs:QName"/>
+      <xs:attribute name="service-name" use="required" type="xs:QName"/>
+      <xs:attribute name="endpoint-name" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="consumes">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:any namespace="##other" processContents="skip"/>
+        <xs:any namespace="##local" processContents="skip"/>
+      </xs:choice>
+      <xs:attribute name="interface-name" use="required" type="xs:QName"/>
+      <xs:attribute name="service-name" type="xs:QName"/>
+      <xs:attribute name="endpoint-name"/>
+      <xs:attribute name="link-type">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="standard"/>
+            <xs:enumeration value="hard"/>
+            <xs:enumeration value="soft"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>

Added: incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/management-message.xsd
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/management-message.xsd?rev=408901&view=auto
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/management-message.xsd (added)
+++ incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/management-message.xsd Tue May 23 07:13:08 2006
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/jbi/management-message" xmlns:m="http://java.sun.com/xml/ns/jbi/management-message">
+  <xs:element name="jbi-task">
+    <xs:complexType>
+    	<xs:sequence>
+      <xs:element ref="m:jbi-task-result"/>
+    	</xs:sequence>
+    	<xs:attribute name="version" use="required" type="xs:decimal"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="jbi-task-result">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="m:frmwk-task-result"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="m:component-task-result"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="frmwk-task-result">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="m:frmwk-task-result-details"/>
+        <xs:element minOccurs="0" ref="m:is-cause-framework"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="is-cause-framework">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="YES"/>
+        <xs:enumeration value="NO"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <xs:element name="component-task-result">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="m:component-name"/>
+        <xs:element ref="m:component-task-result-details"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="component-name" type="xs:string"/>
+  <xs:element name="frmwk-task-result-details">
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:extension base="m:task-result-details">
+          <xs:sequence>
+            <xs:element ref="m:locale"/>
+          </xs:sequence>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="locale" type="xs:string"/>
+  <xs:element name="component-task-result-details" type="m:task-result-details"/>
+  <xs:complexType name="task-result-details">
+      <xs:sequence>
+        <xs:element ref="m:task-id"/>
+        <xs:element ref="m:task-result"/>
+        <xs:element minOccurs="0" ref="m:message-type"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="m:task-status-msg"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="m:exception-info"/>
+      </xs:sequence>
+    </xs:complexType>
+  <xs:element name="task-id" type="xs:string"/>
+  <xs:element name="task-result">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="SUCCESS"/>
+        <xs:enumeration value="FAILED"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <xs:element name="message-type">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="ERROR"/>
+        <xs:enumeration value="WARNING"/>
+        <xs:enumeration value="INFO"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <xs:element name="task-status-msg">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="m:msg-loc-info"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msg-loc-info">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="m:loc-token"/>
+        <xs:element ref="m:loc-message"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="m:loc-param"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="loc-token" type="xs:string"/>
+  <xs:element name="loc-message" type="xs:string"/>
+  <xs:element name="loc-param" type="xs:string"/>
+  <xs:element name="exception-info">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="m:nesting-level"/>
+        <xs:element ref="m:msg-loc-info"/>
+        <xs:element ref="m:stack-trace"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="nesting-level" type="xs:string"/>
+  <xs:element name="stack-trace" type="xs:string"/>
+</xs:schema>

Added: incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/service-assembly-info-list.xsd
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/service-assembly-info-list.xsd?rev=408901&view=auto
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/service-assembly-info-list.xsd (added)
+++ incubator/servicemix/branches/java5/servicemix-schemas/src/main/xsd/service-assembly-info-list.xsd Tue May 23 07:13:08 2006
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/jbi/service-assembly-info-list" xmlns:this="http://java.sun.com/xml/ns/jbi/service-assembly-info-list">
+  <xs:element name="service-assembly-info-list">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="this:service-assembly-info"/>
+      </xs:sequence>
+      <xs:attribute name="version" use="required" type="xs:decimal"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="service-assembly-info">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="this:description"/>
+        <xs:element maxOccurs="unbounded" ref="this:service-unit-info"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:any namespace="##other" processContents="skip"/>
+          <xs:any namespace="##local" processContents="skip"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="state" use="required">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="Started"/>
+            <xs:enumeration value="Stopped"/>
+            <xs:enumeration value="Shutdown"/>
+            <xs:enumeration value="Unknown"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="description" type="xs:string"/>
+  <xs:element name="service-unit-info">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="this:description"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:any namespace="##other" processContents="skip"/>
+          <xs:any namespace="##local" processContents="skip"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="state" use="required">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="Started"/>
+            <xs:enumeration value="Stopped"/>
+            <xs:enumeration value="Shutdown"/>
+            <xs:enumeration value="Unknown"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="deployed-on" use="required"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>

Added: incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/org/apache/servicemix/schemas/deployment/DescriptorTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/org/apache/servicemix/schemas/deployment/DescriptorTest.java?rev=408901&view=auto
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/org/apache/servicemix/schemas/deployment/DescriptorTest.java (added)
+++ incubator/servicemix/branches/java5/servicemix-schemas/src/test/java/org/apache/servicemix/schemas/deployment/DescriptorTest.java Tue May 23 07:13:08 2006
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.servicemix.schemas.deployment;
+
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+public class DescriptorTest extends TestCase {
+    
+    public void testUmarshal() throws Exception {
+        URL res = getClass().getResource("component.xml");
+        Descriptor jbi = DescriptorFactory.buildDescriptor(res);
+        assertNotNull(jbi);
+    }
+
+}

Added: incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/org/apache/servicemix/schemas/deployment/component.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/org/apache/servicemix/schemas/deployment/component.xml?rev=408901&view=auto
==============================================================================
--- incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/org/apache/servicemix/schemas/deployment/component.xml (added)
+++ incubator/servicemix/branches/java5/servicemix-schemas/src/test/resources/org/apache/servicemix/schemas/deployment/component.xml Tue May 23 07:13:08 2006
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
+  <component type="service-engine">
+    <identification>
+      <name>servicemix-jsr181</name>
+      <description>ServiceMix :: JSR-181 Service Engine</description>
+    </identification>
+    <component-class-name>org.apache.servicemix.jsr181.Jsr181Component</component-class-name>
+    <component-class-path>
+      <path-element>lib/servicemix-jsr181-3.0-SNAPSHOT.jar</path-element>
+      <path-element>lib/commons-codec-1.3.jar</path-element>
+      <path-element>lib/xfire-aegis-1.1.jar</path-element>
+      <path-element>lib/commons-attributes-api-2.1.jar</path-element>
+      <path-element>lib/stax-utils-20040917.jar</path-element>
+      <path-element>lib/xfire-jaxb2-1.1.jar</path-element>
+      <path-element>lib/servicemix-common-3.0-SNAPSHOT.jar</path-element>
+      <path-element>lib/xfire-xmlbeans-1.1.jar</path-element>
+      <path-element>lib/xfire-jsr181-api-1.0-M1.jar</path-element>
+      <path-element>lib/jaxen-1.1-beta-8.jar</path-element>
+      <path-element>lib/jaxb-impl-2.0EA3.jar</path-element>
+      <path-element>lib/XmlSchema-1.0.3.jar</path-element>
+      <path-element>lib/xbean-2.1.0.jar</path-element>
+      <path-element>lib/jdom-1.0.jar</path-element>
+      <path-element>lib/xfire-java5-1.1.jar</path-element>
+      <path-element>lib/xfire-annotations-1.1.jar</path-element>
+      <path-element>lib/jaxb-api-2.0EA3.jar</path-element>
+      <path-element>lib/jaxb-xjc-2.0EA3.jar</path-element>
+      <path-element>lib/xfire-core-1.1.jar</path-element>
+      <path-element>lib/wstx-asl-2.9.3.jar</path-element>
+    </component-class-path>
+    <bootstrap-class-name>org.apache.servicemix.jsr181.Jsr181Bootstrap</bootstrap-class-name>
+    <bootstrap-class-path>
+      <path-element>lib/servicemix-jsr181-3.0-SNAPSHOT.jar</path-element>
+      <path-element>lib/commons-codec-1.3.jar</path-element>
+      <path-element>lib/xfire-aegis-1.1.jar</path-element>
+      <path-element>lib/commons-attributes-api-2.1.jar</path-element>
+      <path-element>lib/stax-utils-20040917.jar</path-element>
+      <path-element>lib/xfire-jaxb2-1.1.jar</path-element>
+      <path-element>lib/servicemix-common-3.0-SNAPSHOT.jar</path-element>
+      <path-element>lib/xfire-xmlbeans-1.1.jar</path-element>
+      <path-element>lib/xfire-jsr181-api-1.0-M1.jar</path-element>
+      <path-element>lib/jaxen-1.1-beta-8.jar</path-element>
+      <path-element>lib/jaxb-impl-2.0EA3.jar</path-element>
+      <path-element>lib/XmlSchema-1.0.3.jar</path-element>
+      <path-element>lib/xbean-2.1.0.jar</path-element>
+      <path-element>lib/jdom-1.0.jar</path-element>
+      <path-element>lib/xfire-java5-1.1.jar</path-element>
+      <path-element>lib/xfire-annotations-1.1.jar</path-element>
+      <path-element>lib/jaxb-api-2.0EA3.jar</path-element>
+      <path-element>lib/jaxb-xjc-2.0EA3.jar</path-element>
+      <path-element>lib/xfire-core-1.1.jar</path-element>
+      <path-element>lib/wstx-asl-2.9.3.jar</path-element>
+    </bootstrap-class-path>
+  </component>
+</jbi>