You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2008/11/10 10:49:33 UTC

svn commit: r712637 - in /felix/trunk/ipojo: ant/src/main/java/org/apache/felix/ipojo/task/ manipulator/ manipulator/src/main/java/org/apache/felix/ipojo/manipulator/ manipulator/src/main/java/org/apache/felix/ipojo/xml/parser/ manipulator/src/main/res...

Author: clement
Date: Mon Nov 10 01:49:32 2008
New Revision: 712637

URL: http://svn.apache.org/viewvc?rev=712637&view=rev
Log:
Fix issue Felix-813.
XML-Schemas are now embedded in the manipulator. The manipulator tries to use those files to validate the metadata.xml file. If a schema cannot be loaded "internally", the regular downloading process continue.

The internal resolution of schema can also be skipped by setting the ignoreEmbeddedSchemas parameter:
Ant: ignoreEmbeddedSchemas="true" attribute in the iPOJO task
Maven: <ignoreEmbeddedSchemas>true</ignoreEmbeddedSchemas> in the iPOJO plugin configuration

Added:
    felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/xml/parser/SchemaResolver.java
    felix/trunk/ipojo/manipulator/src/main/resources/
    felix/trunk/ipojo/manipulator/src/main/resources/composite.xsd
    felix/trunk/ipojo/manipulator/src/main/resources/core.xsd
    felix/trunk/ipojo/manipulator/src/main/resources/event-admin.xsd
    felix/trunk/ipojo/manipulator/src/main/resources/extender-pattern.xsd
    felix/trunk/ipojo/manipulator/src/main/resources/jmx.xsd
    felix/trunk/ipojo/manipulator/src/main/resources/temporal.xsd
    felix/trunk/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd
Modified:
    felix/trunk/ipojo/ant/src/main/java/org/apache/felix/ipojo/task/IPojoTask.java
    felix/trunk/ipojo/manipulator/pom.xml
    felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
    felix/trunk/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java

Modified: felix/trunk/ipojo/ant/src/main/java/org/apache/felix/ipojo/task/IPojoTask.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/ant/src/main/java/org/apache/felix/ipojo/task/IPojoTask.java?rev=712637&r1=712636&r2=712637&view=diff
==============================================================================
--- felix/trunk/ipojo/ant/src/main/java/org/apache/felix/ipojo/task/IPojoTask.java (original)
+++ felix/trunk/ipojo/ant/src/main/java/org/apache/felix/ipojo/task/IPojoTask.java Mon Nov 10 01:49:32 2008
@@ -21,6 +21,7 @@
 import java.io.File;
 
 import org.apache.felix.ipojo.manipulator.Pojoization;
+import org.apache.felix.ipojo.xml.parser.SchemaResolver;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.Task;
@@ -44,6 +45,13 @@
     private boolean m_ignoreAnnotations = false;
     
     /**
+     * Flag describing if we need or not use local XSD files
+     * (i.e. use the {@link SchemaResolver} or not).
+     * If <code>true</code> the local XSD are not used.
+     */
+    private boolean m_ignoreLocalXSD = false;
+    
+    /**
      * Set the metadata file.
      * @param meta : the metadata file.
      */
@@ -76,6 +84,14 @@
     }
     
     /**
+     * Set if we need to use embedded XSD files or not.
+     * @param flag : true if we need to ignore embedded XSD files.
+     */
+    public void setIgnoreEmbeddedSchemas(boolean flag) {
+        m_ignoreLocalXSD = flag;
+    }
+    
+    /**
      * Execute the Ant Task.
      * @see org.apache.tools.ant.Task#execute()
      */
@@ -129,6 +145,9 @@
         if (! m_ignoreAnnotations) {
             pojo.setAnnotationProcessing();
         }
+        if (! m_ignoreLocalXSD) {
+            pojo.setUseLocalXSD();
+        }
         pojo.pojoization(m_input, m_output, m_metadata);
         for (int i = 0; i < pojo.getWarnings().size(); i++) {
             log((String) pojo.getWarnings().get(i), Project.MSG_WARN);

Modified: felix/trunk/ipojo/manipulator/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/pom.xml?rev=712637&r1=712636&r2=712637&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/pom.xml (original)
+++ felix/trunk/ipojo/manipulator/pom.xml Mon Nov 10 01:49:32 2008
@@ -76,7 +76,8 @@
 						<Include-Resource>
 							META-INF/LICENCE=LICENSE,
 							META-INF/LICENCE.asm=LICENSE.asm,
-							META-INF/NOTICE=NOTICE
+							META-INF/NOTICE=NOTICE,
+							xsd=src/main/resources
 						</Include-Resource>
 					</instructions>
 				</configuration>

Modified: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java?rev=712637&r1=712636&r2=712637&view=diff
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java (original)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java Mon Nov 10 01:49:32 2008
@@ -45,6 +45,7 @@
 import org.apache.felix.ipojo.metadata.Attribute;
 import org.apache.felix.ipojo.metadata.Element;
 import org.apache.felix.ipojo.xml.parser.ParseException;
+import org.apache.felix.ipojo.xml.parser.SchemaResolver;
 import org.apache.felix.ipojo.xml.parser.XMLMetadataParser;
 import org.objectweb.asm.ClassReader;
 import org.xml.sax.InputSource;
@@ -89,9 +90,16 @@
     private List m_referredPackages;
 
     /**
-     * Flag describing if we need of not compute annotations.
+     * Flag describing if we need or not compute annotations.
      */
     private boolean m_ignoreAnnotations;
+    
+    /**
+     * Flag describing if we need or not use local XSD files
+     * (i.e. use the {@link SchemaResolver} or not).
+     * If <code>true</code> the local XSD are not used.
+     */
+    private boolean m_ignoreLocalXSD;
 
     /**
      * Add an error in the error list.
@@ -114,11 +122,19 @@
     }
     
     /**
-     * Activate annotation processing.
+     * Activates annotation processing.
      */
     public void setAnnotationProcessing() {
         m_ignoreAnnotations = false;
     }
+    
+    /**
+     * Activates the entity resolver loading
+     * XSD files from the classloader.
+     */
+    public void setUseLocalXSD() {
+        m_ignoreLocalXSD = false;
+    }
 
     /**
      * Manipulates an input bundle.
@@ -669,9 +685,24 @@
                     true); 
             parser.setFeature("http://apache.org/xml/features/validation/schema", 
                     true);
+            
+            
            
+            
+//            parser
+//                    .setProperty(
+//                            "http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
+//                            xsd.toString());
+//
+//            
+            
+            
             parser.setErrorHandler(handler);
             
+            if (! m_ignoreLocalXSD) {
+                parser.setEntityResolver(new SchemaResolver());
+            }
+            
             InputSource is = new InputSource(stream);
             parser.parse(is);
             meta = handler.getMetadata();

Added: felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/xml/parser/SchemaResolver.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/xml/parser/SchemaResolver.java?rev=712637&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/xml/parser/SchemaResolver.java (added)
+++ felix/trunk/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/xml/parser/SchemaResolver.java Mon Nov 10 01:49:32 2008
@@ -0,0 +1,81 @@
+/* 
+ * 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.felix.ipojo.xml.parser;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+
+/**
+ * Entity Resolver loading embedded XML Schemas.
+ * This resolver avoid using a network connection to get schemas as they
+ * are loaded from the manipulator jar file.
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+public class SchemaResolver implements EntityResolver {
+    
+    /**
+     * Directory where embedded schemas are copied.
+     */
+    public static final String XSD_PATH = "xsd";
+
+    /**
+     * Resolves systemIds to use embedded schemas. The schemas are loaded from
+     * the {@link SchemaResolver#XSD_PATH} directory with the current classloader.
+     * @param publicId the publicId
+     * @param systemId the systemId (Schema URL)
+     * @return the InputSource to load the schemas or <code>null</code> if the schema
+     * cannot be loaded (not embedded)
+     * @throws SAXException cannot happen 
+     * @throws IOException when the embedded resource cannot be read correctly
+     * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
+     */
+    public InputSource resolveEntity(String publicId, String systemId)
+            throws SAXException, IOException {
+        
+        URL url = getURL(systemId);
+        if (url == null) {
+            // Cannot found the resource
+            return null;
+        } else {
+            return new InputSource(url.openStream());
+        }
+        
+    }
+    
+    /**
+     * Computes the local URL of the given system Id.
+     * This URL is computed by trying to load the resource from
+     * the current classloader. First, the last fragment (file name) of the system id
+     * url is extracted and the file is loaded from the {@link SchemaResolver#XSD_PATH}
+     * directory ('xsd/extracted') 
+     * @param id the systemId to load
+     * @return the URL to the resources or <code>null</code> if the resource cannot be found.
+     */
+    private URL getURL(String id) {
+        int index = id.lastIndexOf('/');
+        String fragment = id.substring(index);
+        return this.getClass().getClassLoader().getResource(XSD_PATH + fragment);
+    }
+
+}

Added: felix/trunk/ipojo/manipulator/src/main/resources/composite.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/resources/composite.xsd?rev=712637&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/resources/composite.xsd (added)
+++ felix/trunk/ipojo/manipulator/src/main/resources/composite.xsd Mon Nov 10 01:49:32 2008
@@ -0,0 +1,147 @@
+<!--
+	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.
+-->
+<xs:schema elementFormDefault="qualified"
+	targetNamespace="org.apache.felix.ipojo.composite"
+	xmlns="org.apache.felix.ipojo.composite"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ipojo="org.apache.felix.ipojo">
+
+	<xs:import namespace="org.apache.felix.ipojo" schemaLocation="http://people.apache.org/~clement/ipojo/schemas/core.xsd"></xs:import>
+	<xs:complexType name="CompositeType">
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element ref="subservice" minOccurs="0"
+				maxOccurs="unbounded">
+			</xs:element>
+			<xs:element ref="provides" minOccurs="0"
+				maxOccurs="unbounded">
+			</xs:element>
+			<xs:element ref="instance" minOccurs="0"
+				maxOccurs="unbounded">
+			</xs:element>
+			<xs:any namespace="##other" processContents="lax"
+				minOccurs="0" maxOccurs="unbounded">
+			</xs:any>
+		</xs:choice>
+		<xs:attribute name="name" type="xs:string" use="optional"></xs:attribute>
+		<xs:attribute name="public" type="xs:boolean" use="optional"></xs:attribute>
+		<xs:attribute name="architecture" type="xs:boolean"
+			use="optional">
+		</xs:attribute>
+	</xs:complexType>
+
+	<xs:element name="subservice" type="SubserviceType" />
+	<xs:element name="provides" type="CompositeProvidesType" />
+	
+	<xs:complexType name="CompositeProvidesType">
+		<xs:complexContent>
+			<xs:extension base="ipojo:ServiceDependencyType">
+				<xs:sequence>
+					<xs:element name="delegation" type="DelegationType"></xs:element>
+				</xs:sequence>
+				<xs:attribute name="specification" type="xs:string"
+					use="required">
+				</xs:attribute>
+
+				<xs:attribute name="action">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="implement"></xs:enumeration>
+							<xs:enumeration value="export"></xs:enumeration>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+
+
+
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+
+	<xs:complexType name="SubserviceType">
+		<xs:complexContent>
+			<xs:extension base="ipojo:ServiceDependencyType">
+
+				<xs:sequence minOccurs="0" maxOccurs="unbounded">
+					<xs:element name="property" type="CompositePropertyType"></xs:element>
+				</xs:sequence>
+				<xs:attribute name="action" use="required">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="import"></xs:enumeration>
+							<xs:enumeration value="instantiate"></xs:enumeration>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+
+				<xs:attribute name="specification" type="xs:string"
+					use="required">
+				</xs:attribute>
+				<xs:attribute name="context-source" type="xs:string"
+					use="optional">
+				</xs:attribute>
+				<xs:attribute name="scope">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="global"></xs:enumeration>
+							<xs:enumeration value="composite"></xs:enumeration>
+							<xs:enumeration value="composite+global"></xs:enumeration>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+
+	<xs:simpleType name="actionType">
+		<xs:restriction base="xs:string"></xs:restriction>
+	</xs:simpleType>
+
+	<xs:complexType name="CompositePropertyType">
+		<xs:sequence minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="property" type="CompositePropertyType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+		<xs:attribute name="name" type="xs:string" use="required"></xs:attribute>
+		<xs:attribute name="value" type="xs:string" use="optional"></xs:attribute>
+	</xs:complexType>
+
+	<xs:complexType name="CompositeInstanceType">
+		<xs:sequence minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="property" type="CompositePropertyType"></xs:element>
+		</xs:sequence>
+		<xs:attribute name="name" type="xs:string" use="optional"></xs:attribute>
+		<xs:attribute name="component" type="xs:string"
+			use="required">
+		</xs:attribute>
+	</xs:complexType>
+
+    <xs:element name="instance" type="CompositeInstanceType"></xs:element>
+
+    <xs:element name="composite" type="CompositeType"></xs:element>
+
+    <xs:complexType name="DelegationType">
+    	<xs:attribute name="method" type="xs:string" use="required"></xs:attribute>
+    	<xs:attribute name="policy" use="required">
+    		<xs:simpleType>
+    			<xs:restriction base="xs:string">
+    				<xs:enumeration value="all"></xs:enumeration>
+    				<xs:enumeration value="one"></xs:enumeration>
+    			</xs:restriction>
+    		</xs:simpleType>
+    	</xs:attribute>
+    </xs:complexType>
+</xs:schema>
\ No newline at end of file

Added: felix/trunk/ipojo/manipulator/src/main/resources/core.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/resources/core.xsd?rev=712637&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/resources/core.xsd (added)
+++ felix/trunk/ipojo/manipulator/src/main/resources/core.xsd Mon Nov 10 01:49:32 2008
@@ -0,0 +1,439 @@
+<!--
+	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.
+-->
+<xs:schema elementFormDefault="qualified" targetNamespace="org.apache.felix.ipojo"
+	xmlns="org.apache.felix.ipojo" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <xs:annotation>
+    	<xs:documentation>iPOJO Core XML-Schema. This grammars models iPOJO descriptor using core features. It provides several extensibility mechanism in order to compose this schema with external handlers and other component implementation type such as compositions.</xs:documentation></xs:annotation>
+    <xs:element name="ipojo">
+		<xs:complexType>
+            <xs:annotation>
+            	<xs:documentation>iPOJO top level element.</xs:documentation>
+            </xs:annotation>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+				<xs:element ref="handler" minOccurs="0" maxOccurs="unbounded">
+                    <xs:annotation>
+                    	<xs:documentation>The handler declarations.</xs:documentation>
+                    </xs:annotation>
+				</xs:element>
+				<xs:element ref="instance" minOccurs="0" maxOccurs="unbounded">
+                    <xs:annotation>
+                    	<xs:documentation>The instance declarations.</xs:documentation>
+                    </xs:annotation>
+				</xs:element>
+				<xs:element ref="component" minOccurs="0" maxOccurs="unbounded">
+                    <xs:annotation>
+                    	<xs:documentation>The component type declarations.</xs:documentation>
+                    </xs:annotation>
+				</xs:element>
+				<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
+				</xs:any>
+			</xs:choice>
+		</xs:complexType>
+	</xs:element>
+	<xs:complexType name="HandlerType">
+        <xs:annotation>
+        	<xs:documentation>Description of the handler.</xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+			<xs:extension base="RootElementType">
+				<xs:sequence maxOccurs="unbounded" minOccurs="0">
+					<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##any"
+						processContents="skip">
+					</xs:any>
+				</xs:sequence>
+				<xs:attribute name="classname" type="xs:string" use="required">
+                    <xs:annotation>
+                    	<xs:documentation>The implementation class of the handler. The specified class must implement (direcly or not) the "org.apache.felix.ipojo.Handler" interface.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+				<xs:attribute name="name" type="xs:string" use="required">
+                    <xs:annotation>
+                    	<xs:documentation>The name of the handler.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+				<xs:attribute name="namespace" type="xs:string" use="optional">
+                    <xs:annotation>
+                    	<xs:documentation>The XML namespace of the handler.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+				<xs:attribute name="architecture" type="xs:boolean"
+					use="optional" fixed="false">
+                    <xs:annotation>
+                    	<xs:documentation>Enables or disables the architecture exposition. By default, the architecture is not exposed. This allows handler introspection.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+				<xs:attribute name="level" type="xs:int" use="optional">
+                    <xs:annotation>
+                    	<xs:documentation>The start level of the handler.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="InstanceType">
+        <xs:annotation>
+        	<xs:documentation>Describes an instance of a component.</xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+			<xs:extension base="RootElementType">
+				<xs:sequence minOccurs="0" maxOccurs="unbounded">
+					<xs:element name="property" type="InstancePropertyType">
+						<xs:annotation>
+							<xs:documentation>The instance properties.</xs:documentation>
+						</xs:annotation></xs:element>
+				</xs:sequence>
+				<xs:attribute name="component" type="xs:string">
+					<xs:annotation>
+						<xs:documentation>The name of the instance component type.</xs:documentation>
+					</xs:annotation></xs:attribute>
+				<xs:attribute name="name" type="xs:string" use="optional">
+                    <xs:annotation>
+                    	<xs:documentation>The (unique) name of the instance.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="InstancePropertyType">
+        <xs:annotation>
+        	<xs:documentation>Defines a property of an instance configuration.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+			<xs:element name="property" type="InstancePropertyType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+		<xs:attribute name="name" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Name of the property. Can be optional if a property is inside a structure.
+The 'instance.name' property has a special semantic as it will be used as the instance name.</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="value" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Value of the property. Can be null for property containing other properties.</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="type" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Type of the property, used to create the adequate object. Supported values are list, array, dictionary and map.</xs:documentation>
+			</xs:annotation></xs:attribute>
+	</xs:complexType>
+	<xs:complexType name="RootElementType"></xs:complexType>
+	<xs:complexType name="ComponentType">
+		<xs:annotation>
+			<xs:documentation>Declares an atomic (i.e. primitive) component type.</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element ref="callback" minOccurs="0"
+				maxOccurs="unbounded">
+                <xs:annotation>
+                	<xs:documentation>Describes the method(s) to invoke when the component's state changes.</xs:documentation>
+                </xs:annotation>
+			</xs:element>
+			<xs:element ref="provides" minOccurs="0"
+				maxOccurs="unbounded">
+                <xs:annotation>
+                	<xs:documentation>Indicates the component provided service(s). By default, all implemented interfaces are published.</xs:documentation>
+                </xs:annotation>
+			</xs:element>
+			<xs:element ref="requires" minOccurs="0"
+				maxOccurs="unbounded">
+                <xs:annotation>
+                	<xs:documentation>Indicates the service requirements of the component.</xs:documentation>
+                </xs:annotation>
+			</xs:element>
+			<xs:element ref="properties" minOccurs="0"
+				maxOccurs="unbounded">
+                <xs:annotation>
+                	<xs:documentation>Describes the properties of the component.</xs:documentation>
+                </xs:annotation>
+			</xs:element>
+			<xs:element ref="controller" minOccurs="0" maxOccurs="1">
+				<xs:annotation>
+					<xs:documentation>Lifecycle controller for this component.</xs:documentation>
+				</xs:annotation></xs:element>
+			<xs:any namespace="##other" processContents="lax"
+				minOccurs="0" maxOccurs="unbounded">
+			</xs:any>
+		</xs:choice>
+		<xs:attribute name="name" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Specifies the name of the component type. This name is used to identify the factory attached to this 	type. If not specified, the factory name is the implementation class name.</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="public" type="xs:boolean" use="optional">
+			<xs:annotation>
+				<xs:documentation>Determines if the component type is public or private. A public factory (default) can be used from any bundles.</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="classname" type="xs:string"
+			use="required">
+			<xs:annotation>
+				<xs:documentation>Specifies the implementation class of the component type.</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="architecture" type="xs:boolean"
+			use="optional">
+			<xs:annotation>
+				<xs:documentation>Enables or disables the architecture exposition. By default, the architecture is exposed. This allows instance introspection.</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="immediate" type="xs:boolean"
+			use="optional">
+            <xs:annotation>
+            	<xs:documentation>Creates the object of the component implementation type as soon as the component instance becomes valid. The default value is "true" if the component doesn't provide any service, "false" otherwise.</xs:documentation>
+            </xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="factory-method" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Factory method called to create POJO objects instead of the constructor. The specified method must be a static method of the implementation class returning an instance of this implementation class. The factory method can receive the bundle context in argument.</xs:documentation>
+			</xs:annotation></xs:attribute>
+	</xs:complexType>
+	<xs:complexType name="RequiresType">
+        <xs:annotation>
+        	<xs:documentation>Description of component services requirements.</xs:documentation>
+        </xs:annotation>
+        <xs:complexContent>
+			<xs:extension base="ServiceDependencyType">
+				<xs:sequence minOccurs="0" maxOccurs="unbounded">
+					<xs:element name="callback"
+						type="DependencyCallbackType">
+                        <xs:annotation>
+                        	<xs:documentation>Service requirement method invocation description. Here can be specified a bind method called when a service appears and an unbind method called when a service disappears.</xs:documentation>
+                        </xs:annotation>
+					</xs:element>
+				</xs:sequence>
+				
+				<xs:attribute name="interface" type="xs:string"
+				    use="prohibited">
+                    <xs:annotation>
+                    	<xs:documentation>The interface describing the required service type. This attribute is needed only when using aggregate dependencies with field injection and when the type of this field is a list, vector, collection and set. This attribute is deprecated, use 'specification'.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+				
+				<xs:attribute name="field" type="xs:string"
+					use="optional">
+                    <xs:annotation>
+                    	<xs:documentation>The name of the field representing the service dependency in the implementation class.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+
+				<xs:attribute name="nullable" type="xs:boolean"
+					use="optional">
+                    <xs:annotation>
+                    	<xs:documentation>Enable or disable the Nullable pattern on optional service dependencies. By default, Nullable pattern is enabled. If disabled, iPOJO will inject null instead of a Nullable object.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+
+				<xs:attribute name="default-implementation"
+					type="xs:string" use="optional">
+                    <xs:annotation>
+                    	<xs:documentation>Specifies the default implementation class for an optional service dependency. If no providers are found, iPOJO creates an instance of the default-implementation (nullary constructor) and injects it. The given class must implement the required service interface.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+
+				<xs:attribute name="from" type="xs:string"
+					use="optional">
+                    <xs:annotation>
+                    	<xs:documentation>Specific service provider. The dependency can only be fulfilled by the component with the matching name, or by the service with a matching PID.</xs:documentation>
+                    </xs:annotation>
+				</xs:attribute>
+				
+				<xs:attribute name="scope" use="optional">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="global"></xs:enumeration>
+							<xs:enumeration value="composite"></xs:enumeration>
+							<xs:enumeration value="composite+global"></xs:enumeration>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="DependencyCallbackType">
+        <xs:annotation>
+        	<xs:documentation>Dependency callbacks are used to receive notification when service providers arrive and leave.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="method" type="xs:string" use="required">
+        	<xs:annotation>
+        		<xs:documentation>Method to call</xs:documentation>
+        	</xs:annotation></xs:attribute>
+		<xs:attribute name="type" use="required">
+            <xs:annotation>
+            	<xs:documentation>Type of callback (bind or unbind). Bind means that the method will be called when a provider arrives. Unbind means that the method will be called when a provider leaves.</xs:documentation>
+            </xs:annotation>
+            <xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="bind"></xs:enumeration>
+					<xs:enumeration value="unbind"></xs:enumeration>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+	</xs:complexType>
+	<xs:complexType name="CallbackType">
+        <xs:annotation>
+        	<xs:documentation>Lifecycle Callback. Allows a POJO to be notified when the instance becomes valid or invalid.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="method" type="xs:string" use="required">
+        	<xs:annotation>
+        		<xs:documentation>Specifies the method to call on the transition.</xs:documentation>
+        	</xs:annotation></xs:attribute>
+		<xs:attribute name="transition" use="required">
+            <xs:annotation>
+            	<xs:documentation>Specifies the transition when the callback needs to be invoked.</xs:documentation>
+            </xs:annotation>
+            <xs:simpleType>
+                <xs:annotation>
+                	<xs:documentation>Lifecycle transition state. "validate" means that the component's instance was invalid and becomes valid, "invalidate" means that the component's intance was valid and becomes invalid.</xs:documentation>
+                </xs:annotation>
+                <xs:restriction base="xs:string">
+					<xs:enumeration value="validate"></xs:enumeration>
+					<xs:enumeration value="invalidate"></xs:enumeration>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+	</xs:complexType>
+	<xs:element name="provides" type="ProvidesType" id="provides"></xs:element>
+	<xs:complexType name="ProvidesType">
+        <xs:annotation>
+        	<xs:documentation>Provided service(s) description.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="property" type="PropertyType">
+				<xs:annotation>
+					<xs:documentation>List of service specific properties.</xs:documentation>
+				</xs:annotation></xs:element>
+		</xs:sequence>
+		<xs:attribute name="interface" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>The list of interfaces of the service to expose. By default, all interfaces implemented by the component implementation class are published.</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="factory" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>POJO factory policy. By default, the POJO object is created once (singleton). If the factory is set to "SERVICE", the creation policy follows the OSGi service factory policy (one object object per asking bundle).</xs:documentation>
+			</xs:annotation></xs:attribute>
+	</xs:complexType>
+	<xs:complexType name="PropertyType">
+        <xs:annotation>
+        	<xs:documentation>Defines a component property.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="field" type="xs:string" use="optional">
+        	<xs:annotation>
+        		<xs:documentation>Field of the property</xs:documentation>
+        	</xs:annotation></xs:attribute>
+        <xs:attribute name="method" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Setter method of the property. This method is called to inject property value.</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="name" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Name of the property.</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="value" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Default value of the property.</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="type" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Type of the property.</xs:documentation>
+			</xs:annotation></xs:attribute>
+	</xs:complexType>
+	<xs:element name="callback" type="CallbackType" id="callback"></xs:element>
+	<xs:element name="controller" type="ControllerType" id="controller">
+		<xs:annotation>
+			<xs:documentation></xs:documentation>
+		</xs:annotation></xs:element>
+	<xs:element name="requires" type="RequiresType" id="requires"></xs:element>
+	<xs:element name="component" type="ComponentType" id="component"></xs:element>
+	<xs:element name="handler" type="HandlerType" id="handler"></xs:element>
+	<xs:element name="instance" type="InstanceType" id="instance"></xs:element>
+
+    <xs:element name="properties" type="PropertiesType" id="properties"></xs:element>
+	<xs:complexType name="PropertiesType">
+        <xs:annotation>
+        	<xs:documentation>List of component, instance or service properties. This field will receive the property value.</xs:documentation>
+        </xs:annotation>
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="property" type="PropertyType">
+				<xs:annotation>
+					<xs:documentation>The list of properties.</xs:documentation>
+				</xs:annotation></xs:element>
+		</xs:sequence>
+		<xs:attribute name="propagation" type="xs:boolean" use="optional">
+			<xs:annotation>
+				<xs:documentation>Propagation of the component properties to the provided services. If this parameter is set to "true", each time properties are reconfigured, they are propagated to each service published by the component.</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="pid" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Unique identifier used to reconfigure components properties (via  Managed Services) with the Configuration Admin.</xs:documentation>
+			</xs:annotation></xs:attribute>
+	</xs:complexType>
+	
+	<xs:complexType name="ServiceDependencyType">
+	    <xs:attribute name="specification" type="xs:string" use="optional">
+	    	<xs:annotation>
+	    		<xs:documentation>The specification describing the required service type. This attribute is needed only when using aggregate dependencies with field injection and when the type of this field is a list, vector, collection and set.</xs:documentation>
+	    	</xs:annotation></xs:attribute>
+		<xs:attribute name="optional" type="xs:boolean" use="optional">
+            <xs:annotation>
+            	<xs:documentation>Sets the service dependency optionality</xs:documentation>
+            </xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="aggregate" type="xs:boolean" use="optional">
+            <xs:annotation>
+            	<xs:documentation>Sets the service dependency cardinality.</xs:documentation>
+            </xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="policy" use="optional">
+            <xs:annotation>
+            	<xs:documentation>Sets the binding policy of the dependency. Three policies are supported. The dynamic policy supports service providers dynamism. The static policy freezes the provider set as soon as the dependency is used. The dynamic-priority policy is an extension of the dynamic policy, but providers are ranked.</xs:documentation>
+            </xs:annotation>
+            <xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="dynamic"></xs:enumeration>
+					<xs:enumeration value="static"></xs:enumeration>
+					<xs:enumeration value="dynamic-priority"></xs:enumeration>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+		<xs:attribute name="comparator" type="xs:string" use="optional">
+            <xs:annotation>
+            	<xs:documentation>The comparator attribute allows specifying the class used to compare providers. This class must implemented the java.util.Comparator class and must support the comparison of service references.</xs:documentation>
+            </xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="filter" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>LDAP filter used to filter providers</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="id" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>id of the service dependency. The id allows to indentify and to refert to this dependency.</xs:documentation>
+			</xs:annotation></xs:attribute>
+	</xs:complexType>
+
+    <xs:complexType name="ControllerType">
+        <xs:annotation>
+        	<xs:documentation>Specifies the lifecycle controller of a component, which allows to validate or invalidate component instances.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="field" type="xs:string" use="required">
+            <xs:annotation>
+            	<xs:documentation>The name of the component lifecycle controller field. The type of the specified field must be boolean. Setting the value of the specified field to "true" means the validation of the component instance while setting it to "false" means the invalidation of the component instance.</xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+    </xs:complexType>
+</xs:schema>
\ No newline at end of file

Added: felix/trunk/ipojo/manipulator/src/main/resources/event-admin.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/resources/event-admin.xsd?rev=712637&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/resources/event-admin.xsd (added)
+++ felix/trunk/ipojo/manipulator/src/main/resources/event-admin.xsd Mon Nov 10 01:49:32 2008
@@ -0,0 +1,90 @@
+<!--
+	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.
+-->
+<xs:schema targetNamespace="org.apache.felix.ipojo.handlers.event.EventAdminHandler"
+	xmlns="org.apache.felix.ipojo.handlers.event.EventAdminHandler"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	elementFormDefault="qualified">	
+
+    <xs:complexType name="PublisherType">
+        <xs:annotation>
+        	<xs:documentation>Description of an event publisher.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="name" type="xs:string" use="required">
+        	<xs:annotation>
+        		<xs:documentation>The name of the event publisher, acting as a unique identifier.
+The name of the POJO's field that will be used to send events. The field is initialized at component instantiation time. The type of the field must be "org.apache.felix.ipojo.handlers.event.publisher.Publisher".</xs:documentation>
+        	</xs:annotation></xs:attribute>
+    	<xs:attribute name="field" type="xs:string" use="required">
+    		<xs:annotation>
+    			<xs:documentation>The name of the POJO field associated to this event publisher.
+Despite it creates a dependency between the component code and the handler, this system allows hiding the whole complexity of event sending.</xs:documentation>
+    		</xs:annotation></xs:attribute>
+    	<xs:attribute name="topics" type="xs:string" use="optional">
+    		<xs:annotation>
+    			<xs:documentation>The comma-separated-list of the topics on which events will be sent. All subscribers that are listening to one of these topics will receive the events.</xs:documentation></xs:annotation></xs:attribute>
+    	<xs:attribute name="synchronous" type="xs:boolean" use="optional">
+    		<xs:annotation>
+    			<xs:documentation>Determines if event sending is synchronous or not. By default, events are sent asynchronously, but you can specify there the desired behaviour of the Publisher.
+The default value of this attribute is "false".</xs:documentation>
+    		</xs:annotation></xs:attribute>
+    	<xs:attribute name="data-key" type="xs:string" use="optional">
+    		<xs:annotation>
+    			<xs:documentation>The data key is used when you want to send data events. This attribute's value is the key, in the event's dictionary, in which sent data are stored. When you use the sendData method of the Publisher, the given object is placed in the event dictionary, associated with the specified data-key.
+The default value of this attribute is user.data.</xs:documentation></xs:annotation></xs:attribute>
+    </xs:complexType>
+    
+    <xs:complexType name="SubscriberType">
+        <xs:annotation>
+        	<xs:documentation>Description of an event subscriber.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="name" type="xs:string" use="required">
+        	<xs:annotation>
+        		<xs:documentation>The name of the event subscriber, acting as a unique identifier.</xs:documentation></xs:annotation></xs:attribute>
+    	<xs:attribute name="callback" type="xs:string" use="required">
+    		<xs:annotation>
+    			<xs:documentation>The name of the POJO's method that will be called each time an event is received.
+This method takes only one parameter, of typeorg.osgi.service.event.Eventby default, but this type can be overridden by defining the data-key and/or the data-type attributes.</xs:documentation>
+    		</xs:annotation></xs:attribute>
+    	<xs:attribute name="topics" type="xs:string" use="optional">
+    		<xs:annotation>
+    			<xs:documentation>The comma-separated-list of the topics that the handler will listen to. Each event sent on a topic present in this list will be sent to the specified callback method.</xs:documentation></xs:annotation></xs:attribute>
+    	<xs:attribute name="filter" type="xs:string" use="optional">
+    		<xs:annotation>
+    			<xs:documentation>The event filter is used to filter incoming events before sending them to the callback.
+The syntax of this field is described in the OSGi EventAdmin Specification. If you don't specify a filter, all events sent on the listened topics will be considered.</xs:documentation>
+    		</xs:annotation></xs:attribute>
+    	<xs:attribute name="data-key" type="xs:string" use="optional">
+    		<xs:annotation>
+    			<xs:documentation>The data key is used when you want to receive data events. This attribute's value is the key corresponding to the received data in the event's dictionary.
+If you use this attribute, the parameter passed to the callback method is the the value associated to this key, not the whole event.
+This attribute is generally used with the data-typeattribute to specify the received object type.
+If an event is received and it does not contain such a key, it is ignored (with a warning message).</xs:documentation>
+    		</xs:annotation></xs:attribute>
+    	<xs:attribute name="data-type" type="xs:string" use="optional">
+    		<xs:annotation>
+    			<xs:documentation>This attribute is associated to the data-key attribute. It specifies the type of objects (java.lang.Object by default) that the callback expects.
+It is used to determine the unique callback method (in case of multiple methods with the same name) and to check type compliance at event reception.
+Data events that are not corresponding to the specified type will be ignored (with a warning message).</xs:documentation>
+    		</xs:annotation></xs:attribute>
+    </xs:complexType>
+    
+    <xs:element name="publisher" type="PublisherType"></xs:element>
+    <xs:element name="subscriber" type="SubscriberType"></xs:element>
+    
+</xs:schema>
\ No newline at end of file

Added: felix/trunk/ipojo/manipulator/src/main/resources/extender-pattern.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/resources/extender-pattern.xsd?rev=712637&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/resources/extender-pattern.xsd (added)
+++ felix/trunk/ipojo/manipulator/src/main/resources/extender-pattern.xsd Mon Nov 10 01:49:32 2008
@@ -0,0 +1,42 @@
+<!--
+	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.
+-->
+<xs:schema targetNamespace="org.apache.felix.ipojo.extender"
+	xmlns="org.apache.felix.ipojo.extender"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	elementFormDefault="qualified">
+	<xs:element name="extender" type="ExtenderType"></xs:element>
+	<xs:complexType name="ExtenderType">
+        <xs:annotation>
+        	<xs:documentation>Description of the extender pattern configuration.
+The extender tracks extensions. The particularity of this architecture-style is that extensions are packaged in different bundles. An extension is detected by analyzing the bundle. The mark is currently a header in the bundle manifest. At each time a matching bundle appears or disappears, a callback is invoked. </xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="onArrival" type="xs:string" use="required">
+        	<xs:annotation>
+        		<xs:documentation>Declaring the method to invoke when a matching bundle arrives</xs:documentation>
+        	</xs:annotation></xs:attribute>
+		<xs:attribute name="onDeparture" type="xs:string" use="required">
+			<xs:annotation>
+				<xs:documentation>Declaring the method to invoke when a matching bundle leaves</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="extension" type="xs:string" use="required">
+			<xs:annotation>
+				<xs:documentation>Declaring the looked manifest header.</xs:documentation>
+			</xs:annotation></xs:attribute>
+	</xs:complexType>	
+</xs:schema>
\ No newline at end of file

Added: felix/trunk/ipojo/manipulator/src/main/resources/jmx.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/resources/jmx.xsd?rev=712637&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/resources/jmx.xsd (added)
+++ felix/trunk/ipojo/manipulator/src/main/resources/jmx.xsd Mon Nov 10 01:49:32 2008
@@ -0,0 +1,177 @@
+<!--
+	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.
+-->
+<xs:schema targetNamespace="org.apache.felix.ipojo.handlers.jmx"
+	xmlns="org.apache.felix.ipojo.handlers.jmx"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	elementFormDefault="qualified">
+	<xs:element name="config" type="JMXType"></xs:element>
+
+	<xs:complexType name="JMXType">
+
+		<xs:annotation>
+			<xs:documentation>
+				Description of a JMX managed component.
+			</xs:documentation>
+		</xs:annotation>
+		<xs:choice minOccurs="0" maxOccurs="unbounded">
+			<xs:element name="method" type="JMXMethod">
+				<xs:annotation>
+					<xs:documentation>
+						The list of methods to expose.
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="property" type="JMXProperty">
+				<xs:annotation>
+					<xs:documentation>
+						The list of attributes to expose.
+					</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:choice>
+		<xs:attribute name="usesMOSGi" type="xs:boolean"
+			use="optional">
+			<xs:annotation>
+				<xs:documentation>
+					Determines if the component must be register on the
+					MOSGi MBean server or not.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="objectName" type="xs:string"
+			use="optional">
+			<xs:annotation>
+				<xs:documentation>
+					The complete object name of the managed component.
+					The syntax of this attribute must be compliant with
+					the ObjectName syntax, detailed in the JMX
+					specification. If neither domain nor name attributes
+					are specified, the default value is determined by
+					the package, the type and the instance name of the
+					component. This attribute overrides the domain and
+					name attributes.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="domain" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>
+					The domain of the managed object (i.e., the left
+					part of the object name). This attribute must be
+					compliant with the domain syntax, as described in
+					the JMX specification.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="name" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>
+					The name property of the managed object. The value
+					of this attribute must comply with the ObjectName
+					value syntax, as described in the JMX specification.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+
+		<xs:attribute name="preRegister" type="xs:string"
+			use="optional">
+			<xs:annotation>
+				<xs:documentation>
+					Specifies method to carry out operations before
+					beeing registered from the MBean server. The
+					signature of the specified method must be :
+					"ObjectName preRegister(MBeanServer server,
+					ObjectName name) throws Exception".
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="postRegister" type="xs:string"
+			use="optional">
+			<xs:annotation>
+				<xs:documentation>
+					Specifies method to carry out operations after
+					beeing registered from the MBean server. The
+					signature of the specified method must be : "void
+					postRegister(Boolean registrationDone)".
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="preDeregister" type="xs:string"
+			use="optional">
+			<xs:annotation>
+				<xs:documentation>
+					Specifies method to carry out operations before
+					beeing unregistered from the MBean server. The
+					signature of the specified method must be : "void
+					preDeregister() throws Exception".
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="postDeregister" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>
+					Specifies method to carry out operations after
+					beeing unregistered from the MBean server. The
+					signature of the specified method must be : 
+					"void postDeregister()".</xs:documentation>
+			</xs:annotation></xs:attribute>
+	</xs:complexType>
+
+	<xs:complexType name="JMXProperty">
+        <xs:annotation>
+        	<xs:documentation>Description of an attribute to expose.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="field" type="xs:string" use="required">
+        	<xs:annotation>
+        		<xs:documentation>The name of the component's field to expose.</xs:documentation></xs:annotation></xs:attribute>
+		<xs:attribute name="name" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>The name of the property as it will appear in JMX. If unspecified, the default value is the name of the exposed field.</xs:documentation></xs:annotation></xs:attribute>
+		<xs:attribute name="rights" use="optional">
+            <xs:annotation>
+            	<xs:documentation>Specify the access permission of the exposed field.</xs:documentation>
+            </xs:annotation>
+            <xs:simpleType>
+                <xs:annotation>
+                	<xs:documentation>Access permission of an exposed field. Accepted values are "r" (read-only access, the default value) and "w" (read and write access).</xs:documentation>
+                </xs:annotation>
+                <xs:restriction base="xs:string">
+					<xs:enumeration value="r"></xs:enumeration>
+					<xs:enumeration value="w"></xs:enumeration>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+		<xs:attribute name="notification" type="xs:boolean" use="optional">
+			<xs:annotation>
+				<xs:documentation>Enable or disable attribute change notification sending for this property. If set to &quot;true&quot;, a notification is sent each time the value of the field changes.</xs:documentation></xs:annotation></xs:attribute>
+	</xs:complexType>
+
+	<xs:complexType name="JMXMethod">
+        <xs:annotation>
+        	<xs:documentation>Description of a method to expose.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="name" type="xs:string" use="required">
+        	<xs:annotation>
+        		<xs:documentation>The name of the method to expose. If multiple methods have the same name, all of them are exposed.</xs:documentation>
+        	</xs:annotation></xs:attribute>
+		<xs:attribute name="description" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>The description of the exposed method, as it will appear in JMX.</xs:documentation></xs:annotation></xs:attribute>
+	</xs:complexType>
+</xs:schema>
\ No newline at end of file

Added: felix/trunk/ipojo/manipulator/src/main/resources/temporal.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/resources/temporal.xsd?rev=712637&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/resources/temporal.xsd (added)
+++ felix/trunk/ipojo/manipulator/src/main/resources/temporal.xsd Mon Nov 10 01:49:32 2008
@@ -0,0 +1,47 @@
+<!--
+	Licensed to the Apache Software Foundation (ASF) under one
+	or more contributor license agreements.  See the NOTICE file
+	distributed with this work for additional information
+	regarding copyright ownership.  The ASF licenses this file
+	to you under the Apache License, Version 2.0 (the
+	"License"); you may not use this file except in compliance
+	with the License.  You may obtain a copy of the License at
+	
+	http://www.apache.org/licenses/LICENSE-2.0
+	
+	Unless required by applicable law or agreed to in writing,
+	software distributed under the License is distributed on an
+	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+	KIND, either express or implied.  See the License for the
+	specific language governing permissions and limitations
+	under the License.
+-->
+<xs:schema targetNamespace="org.apache.felix.ipojo.handler.temporal"
+	xmlns="org.apache.felix.ipojo.handler.temporal"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	elementFormDefault="qualified">
+	<xs:element name="requires" type="TemporalServiceDependencyType"></xs:element>
+
+	<xs:complexType name="TemporalServiceDependencyType">
+
+        <xs:annotation>
+        	<xs:documentation>Description of a temporal dependency.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="field" type="xs:string" use="required">
+        	<xs:annotation>
+        		<xs:documentation>The implementation field supporting the dependency.</xs:documentation>
+        	</xs:annotation></xs:attribute>
+		<xs:attribute name="filter" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Filter use to discover matching filter.</xs:documentation></xs:annotation></xs:attribute>
+		<xs:attribute name="timeout" type="xs:int" use="optional">
+			<xs:annotation>
+				<xs:documentation>Specifies the timeout after which the onTimeout policy is executed. The value is the time in ms to wait. -1 is used to indicate an infinite wait.</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="onTimeout" use="optional" type="xs:string">
+            <xs:annotation>
+            	<xs:documentation>Specifies the onTimeout policy. This determines the object to inject when the service stills unavailable when the timeout expires. Several values are supported: 'nullable' means that a Nullable object will be injected, 'empty-array' injects an empty array (only for aggregate dependency), 'null' injects Null, any other value are interpreted as the default implementation class to use. If the onTimetout attribute is not specified, a RuntimeException is thrown when the timeout is reached.</xs:documentation>
+            </xs:annotation>
+		</xs:attribute>
+	</xs:complexType>
+</xs:schema>
\ No newline at end of file

Added: felix/trunk/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd?rev=712637&view=auto
==============================================================================
--- felix/trunk/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd (added)
+++ felix/trunk/ipojo/manipulator/src/main/resources/whiteboard-pattern.xsd Mon Nov 10 01:49:32 2008
@@ -0,0 +1,45 @@
+<!--
+	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.
+-->
+<xs:schema targetNamespace="org.apache.felix.ipojo.white-board-pattern"
+	xmlns="org.apache.felix.ipojo.white-board-pattern"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	elementFormDefault="qualified">
+	<xs:element name="wbp" type="WBPType"></xs:element>
+	<xs:complexType name="WBPType">
+        <xs:annotation>
+        	<xs:documentation>Description of the white-board architecture.</xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="onArrival" type="xs:string" use="required">
+        	<xs:annotation>
+        		<xs:documentation>Declaring the method to invoke when a matching service arrives.</xs:documentation>
+        	</xs:annotation></xs:attribute>
+		<xs:attribute name="onDeparture" type="xs:string" use="required">
+			<xs:annotation>
+				<xs:documentation>Declaring the method to invoke when a matching service leaves.</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="onModification" type="xs:string" use="optional">
+			<xs:annotation>
+				<xs:documentation>Method called when an injected service reference is modified but stills valid against the filter.</xs:documentation>
+			</xs:annotation></xs:attribute>
+		<xs:attribute name="filter" type="xs:string" use="required">
+			<xs:annotation>
+				<xs:documentation>Filter use to discover matching filter.</xs:documentation>
+			</xs:annotation></xs:attribute>
+	</xs:complexType>	
+</xs:schema>
\ No newline at end of file

Modified: felix/trunk/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java?rev=712637&r1=712636&r2=712637&view=diff
==============================================================================
--- felix/trunk/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java (original)
+++ felix/trunk/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java Mon Nov 10 01:49:32 2008
@@ -106,6 +106,12 @@
      */
     private boolean m_ignoreAnnotations;
 
+    /**
+     * Ignore embedded XSD parameter.
+     * @parameter alias="IgnoreEmbeddedSchemas" default-value="false"
+     */
+    private boolean m_ignoreEmbeddedXSD;
+
     protected MavenProject getProject() {
         return this.m_project;
     }
@@ -156,6 +162,7 @@
 
         Pojoization pojo = new Pojoization();
         if (!m_ignoreAnnotations) { pojo.setAnnotationProcessing(); }
+        if (!m_ignoreEmbeddedXSD) { pojo.setUseLocalXSD(); }
         pojo.pojoization(in, out, meta);
         for (int i = 0; i < pojo.getWarnings().size(); i++) {
             getLog().warn((String) pojo.getWarnings().get(i));