You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by oz...@apache.org on 2010/01/05 16:25:29 UTC

svn commit: r896091 - in /incubator/aries/trunk/blueprint/blueprint-testbundlea: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/aries/ src/main/java/org/apache/aries/blueprint/ src/main/java/org/a...

Author: ozzy
Date: Tue Jan  5 15:25:28 2010
New Revision: 896091

URL: http://svn.apache.org/viewvc?rev=896091&view=rev
Log:
ARIES-86 Initial commit

Added:
    incubator/aries/trunk/blueprint/blueprint-testbundlea/pom.xml
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/Activator.java
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/BeanProcessorTest.java
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerOne.java
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerThree.java
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/ProcessableBean.java
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlerone.xsd
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlerthree.xsd
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlertwo.xsd
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/
    incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/config.xml
Modified:
    incubator/aries/trunk/blueprint/blueprint-testbundlea/   (props changed)

Propchange: incubator/aries/trunk/blueprint/blueprint-testbundlea/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Jan  5 15:25:28 2010
@@ -0,0 +1,4 @@
+target
+.settings
+.classpath
+.project

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/pom.xml?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/pom.xml (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/pom.xml Tue Jan  5 15:25:28 2010
@@ -0,0 +1,64 @@
+<!--
+    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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <description>Blueprint Test Bundle A, provides NamespaceHandler, BeanProcessor etc implementations for Test Bundle B</description>
+    <parent>
+        <groupId>org.apache.aries.blueprint</groupId>
+        <artifactId>blueprint</artifactId>
+        <version>1.0.0-incubating-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>org.apache.aries.blueprint.testbundlea</artifactId>
+    <name>Apache Aries Blueprint Test Bundle A</name>
+    <packaging>bundle</packaging>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin
+                </artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${pom.groupId}.testbundlea</Bundle-SymbolicName>
+                        <Bundle-Activator>
+                            org.apache.aries.blueprint.testbundlea.Activator
+                        </Bundle-Activator>
+                        <Export-Package>org.apache.aries.blueprint.testbundlea.*</Export-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.eclipse</groupId>
+            <artifactId>osgi</artifactId>
+            <scope>provided</scope>
+        </dependency>
+       <dependency>
+           <groupId>org.apache.aries.blueprint</groupId>
+           <artifactId>org.apache.aries.blueprint.api</artifactId>
+       </dependency>
+       <dependency>
+           <groupId>org.apache.aries.blueprint</groupId>
+           <artifactId>org.apache.aries.blueprint.core</artifactId>
+       </dependency>       
+    </dependencies>
+</project>

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/Activator.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/Activator.java?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/Activator.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/Activator.java Tue Jan  5 15:25:28 2010
@@ -0,0 +1,28 @@
+/**
+ *  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.aries.blueprint.testbundlea;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+    public void start(BundleContext context) { 
+    }
+    public void stop(BundleContext context) {
+    }
+   
+}

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/BeanProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/BeanProcessorTest.java?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/BeanProcessorTest.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/BeanProcessorTest.java Tue Jan  5 15:25:28 2010
@@ -0,0 +1,49 @@
+/**
+ *  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.aries.blueprint.testbundlea;
+
+import org.apache.aries.blueprint.BeanProcessor;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+
+public class BeanProcessorTest implements BeanProcessor {
+    
+    public Object beforeInit(Object bean, String beanName,
+            BeanCreator beanCreator, BeanMetadata beanData) {
+        if(bean instanceof ProcessableBean){
+            ProcessableBean pb = (ProcessableBean)bean;
+            pb.processBeforeInit(this);
+        }
+        return bean;
+    }
+    public Object afterInit(Object bean, String beanName,
+            BeanCreator beanCreator, BeanMetadata beanData) {
+        if(bean instanceof ProcessableBean){
+            ((ProcessableBean)bean).processAfterInit(this);
+        }
+        return bean;
+    }
+    public void beforeDestroy(Object bean, String beanName) {
+        if(bean instanceof ProcessableBean){
+            ((ProcessableBean)bean).processBeforeDestroy(this);
+        }
+    }
+    public void afterDestroy(Object bean, String beanName) {
+        if(bean instanceof ProcessableBean){
+            ((ProcessableBean)bean).processAfterDestroy(this);
+        }
+    }
+}
\ No newline at end of file

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerOne.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerOne.java?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerOne.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerOne.java Tue Jan  5 15:25:28 2010
@@ -0,0 +1,127 @@
+/**
+ *  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.aries.blueprint.testbundlea;
+
+import java.net.URL;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.PassThroughMetadata;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.aries.blueprint.mutable.MutableRefMetadata;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.RefMetadata;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * A simple example namespace handler, that understands an element, and 2 attributes
+ * 
+ * When the element is encountered in a top level blueprint element, the handler will add a 
+ * passthroughmetadata with it's id as the contained attribone.
+ * The passthroughmetadata will return a string with the value from the contained 
+ * attrib two.
+ * 
+ * If the element is encountered during processing of a bean, it will add a property to the 
+ * bean with the name of the attribone value, and a value of the passthroughmetadata with id
+ * matching attribtwo
+ * 
+ * This handler is designed to exercise aspects of the NamespaceHandler capability set.
+ *
+ */
+public class NSHandlerOne implements NamespaceHandler {
+    
+    public static String NSURI = "http://ns.handler.one";
+    
+    private static String ELT_NAME = "nshandlerone";
+    private static String ATTRIB_ONE = "attribone";
+    private static String ATTRIB_TWO = "attribtwo";
+
+    //process attributes
+    public ComponentMetadata decorate(Node node, ComponentMetadata component,
+            ParserContext context) {
+        
+        //this test makes use of the 'Mutable' implementations
+        //without which the code would need to implement our own BeanMetadata,
+        //and RefMetadata.
+        if(component !=null && component instanceof MutableBeanMetadata){
+            MutableBeanMetadata mbm = (MutableBeanMetadata)component;
+            
+            Attr a = (Attr)node;
+            Element bean = a.getOwnerElement();            
+            
+            String propname = bean.getAttributeNS(NSURI,ATTRIB_ONE);
+            
+            //if this were not a test, we might attempt to ensure this ref existed
+            String passthruref = bean.getAttributeNS(NSURI,ATTRIB_TWO);
+            
+            MutableRefMetadata ref = (MutableRefMetadata)context.createMetadata(RefMetadata.class);
+            ref.setComponentId(passthruref);
+            
+            mbm.addProperty(propname, ref);
+        }
+        return component;
+    }
+    
+    //process elements
+    public Metadata parse(Element element, ParserContext context) {
+        Metadata retval = null;       
+        if( element.getLocalName().equals(ELT_NAME) ) {
+            
+            final String id = element.getAttributeNS(NSURI,ATTRIB_ONE);
+            final String value = element.getAttributeNS(NSURI,ATTRIB_TWO);
+            
+            PassThroughMetadata ptm = new PassThroughMetadata() {
+                
+                public String getId() {
+                    return id;
+                }
+                
+                //not used currently
+                public List<String> getDependsOn() {
+                    return null;
+                }
+                
+                //also not used currently
+                public int getActivation() {
+                    return 0;
+                }
+                
+                public Object getObject() {
+                    return value;
+                }
+            };
+            
+            retval = ptm;
+        }
+        return retval;
+    }    
+
+    //supply schema back to blueprint.
+    public URL getSchemaLocation(String namespace) {
+        return this.getClass().getResource("nshandlerone.xsd");
+    }
+
+    public Set<Class> getManagedClasses() {
+        return null;
+    }
+    
+}

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerThree.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerThree.java?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerThree.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerThree.java Tue Jan  5 15:25:28 2010
@@ -0,0 +1,70 @@
+/**
+ *  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.aries.blueprint.testbundlea;
+
+import java.net.URL;
+import java.util.Set;
+
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.osgi.service.blueprint.reflect.BeanMetadata;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+public class NSHandlerThree implements NamespaceHandler{
+    public static String NSURI = "http://ns.handler.three";
+    
+    private static String ELT_NAME = "nshandlerthree";
+    private static String ATTRIB_ONE = "attribone";
+    private static String ATTRIB_TWO = "attribtwo";
+    
+    public ComponentMetadata decorate(Node node, ComponentMetadata component,
+            ParserContext context) {
+        if(node.getLocalName().equals(ATTRIB_ONE)){
+            if(component instanceof BeanMetadata){
+                if(context.getComponentDefinitionRegistry().getComponentDefinition(NSURI+"/BeanProcessor")==null){
+                    BeanMetadata bm = context.createMetadata(BeanMetadata.class);
+                    MutableBeanMetadata mbm = (MutableBeanMetadata)bm;
+                    mbm.setProcessor(true);
+                    mbm.setRuntimeClass(BeanProcessorTest.class);
+                    mbm.setScope(BeanMetadata.SCOPE_SINGLETON);
+                    mbm.setId(NSURI+"/BeanProcessor");
+                    context.getComponentDefinitionRegistry().registerComponentDefinition(mbm);
+                }
+            }
+        }
+        return component;
+    }
+
+    //process elements
+    public Metadata parse(Element element, ParserContext context) {
+        return null;
+    }    
+
+    //supply schema back to blueprint.
+    public URL getSchemaLocation(String namespace) {
+        return this.getClass().getResource("nshandlerthree.xsd");
+    }
+
+    public Set<Class> getManagedClasses() {
+        return null;
+    }
+
+}

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/NSHandlerTwo.java Tue Jan  5 15:25:28 2010
@@ -0,0 +1,117 @@
+/**
+ *  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.aries.blueprint.testbundlea;
+
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.aries.blueprint.Interceptor;
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.ParserContext;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * A simple example namespace handler, that understands an element, and 2 attributes
+ * 
+ * When attribone is found on a bean, an interceptor is added that will track invocations.
+ * 
+ * This handler is designed to exercise aspects of the NamespaceHandler capability set.
+ *
+ */
+public class NSHandlerTwo implements NamespaceHandler{
+    
+    public static String NSURI = "http://ns.handler.two";
+    
+    private static String ELT_NAME = "nshandlertwo";
+    private static String ATTRIB_ONE = "attribone";
+    private static String ATTRIB_TWO = "attribtwo";
+    
+    private static List<String> interceptorLog = new ArrayList<String>();
+    
+    private static Interceptor tracker = new Interceptor() {
+        
+        public Object preCall(ComponentMetadata cm, Method m, Object... parameters)
+                throws Throwable {
+            String args = "[";
+            if(parameters!=null){
+                if(parameters.length>0){
+                    args+=parameters[0]==null ? "null" : parameters[0].toString();
+                }
+                for(int index=1; index<parameters.length; index++){
+                    args+=","+(parameters[index]==null ? "null" : parameters[index].toString());
+                }
+            }
+            args+="]";
+            String token = cm.getId() +":"+ m.getName() +":"+args+":"+System.currentTimeMillis();
+            interceptorLog.add("PRECALL:"+token);
+            return token;
+        }
+        
+        public void postCallWithReturn(ComponentMetadata cm, Method m,
+                Object returnType, Object preCallToken) throws Throwable {
+            interceptorLog.add("POSTCALL["+returnType.toString()+"]:"+preCallToken);
+        }
+        
+        public void postCallWithException(ComponentMetadata cm, Method m,
+                Exception ex, Object preCallToken) throws Throwable {
+            interceptorLog.add("POSTCALLEXCEPTION["+ex.toString()+"]:"+preCallToken);
+        }
+        
+        public int getRank() {
+            return 0;
+        }
+    };
+    
+    //
+    public ComponentMetadata decorate(Node node, ComponentMetadata component,
+            ParserContext context) {
+        
+        if(node.getLocalName().equals(ATTRIB_ONE)){
+            if(context.getComponentDefinitionRegistry().getInterceptors(component) == null ||
+               !context.getComponentDefinitionRegistry().getInterceptors(component).contains(tracker) ){
+                context.getComponentDefinitionRegistry().registerInterceptorWithComponent(component, tracker);
+            }
+        }
+        return component;
+    }
+    
+    //process elements
+    public Metadata parse(Element element, ParserContext context) {
+        return null;
+    }    
+
+    //supply schema back to blueprint.
+    public URL getSchemaLocation(String namespace) {
+        return this.getClass().getResource("nshandlertwo.xsd");
+    }
+
+    public Set<Class> getManagedClasses() {
+        return null;
+    }
+
+    public List<String> getLog() {
+        return Collections.unmodifiableList(interceptorLog);
+    }
+    
+}

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/ProcessableBean.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/ProcessableBean.java?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/ProcessableBean.java (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/ProcessableBean.java Tue Jan  5 15:25:28 2010
@@ -0,0 +1,38 @@
+/**
+ * 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.aries.blueprint.testbundlea;
+
+import java.util.List;
+
+import org.apache.aries.blueprint.BeanProcessor;
+
+/**
+ * Simple little interface to allow testing of BeanProcessors.
+ */
+public interface ProcessableBean {
+    public enum Phase {BEFORE_INIT, AFTER_INIT, BEFORE_DESTROY, AFTER_DESTROY};
+    
+    List<BeanProcessor> getProcessedBy();
+    List<BeanProcessor> getProcessedBy(Phase p);
+    
+    void processBeforeInit(BeanProcessor bp);
+    void processAfterInit(BeanProcessor bp);
+    void processBeforeDestroy(BeanProcessor bp);
+    void processAfterDestroy(BeanProcessor bp);
+}

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlerone.xsd
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlerone.xsd?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlerone.xsd (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlerone.xsd Tue Jan  5 15:25:28 2010
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" 
+        targetNamespace="http://ns.handler.one" 
+        xmlns:tns="http://ns.handler.one"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+        elementFormDefault="qualified" 
+        attributeFormDefault="qualified" >
+   <element name="nshandlerone">
+      <complexType>
+           <attribute ref="tns:attribone"/>
+           <attribute ref="tns:attribtwo"/>
+      </complexType>
+   </element>
+   <attribute name="attribone" type="xsd:string"/>
+   <attribute name="attribtwo" type="xsd:string"/>
+</schema>
\ No newline at end of file

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlerthree.xsd
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlerthree.xsd?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlerthree.xsd (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlerthree.xsd Tue Jan  5 15:25:28 2010
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" 
+        targetNamespace="http://ns.handler.three" 
+        xmlns:tns="http://ns.handler.three"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+        elementFormDefault="qualified" 
+        attributeFormDefault="qualified" >
+   <element name="nshandlerthree">
+      <complexType>
+           <attribute ref="tns:attribone"/>
+           <attribute ref="tns:attribtwo"/>
+      </complexType>
+   </element>
+   <attribute name="attribone" type="xsd:string"/>
+   <attribute name="attribtwo" type="xsd:string"/>
+</schema>
\ No newline at end of file

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlertwo.xsd
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlertwo.xsd?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlertwo.xsd (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/java/org/apache/aries/blueprint/testbundlea/nshandlertwo.xsd Tue Jan  5 15:25:28 2010
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" 
+        targetNamespace="http://ns.handler.two" 
+        xmlns:tns="http://ns.handler.two"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+        elementFormDefault="qualified" 
+        attributeFormDefault="qualified" >
+   <element name="nshandlertwo">
+      <complexType>
+           <attribute ref="tns:attribone"/>
+           <attribute ref="tns:attribtwo"/>
+      </complexType>
+   </element>
+   <attribute name="attribone" type="xsd:string"/>
+   <attribute name="attribtwo" type="xsd:string"/>
+</schema>
\ No newline at end of file

Added: incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/config.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/config.xml?rev=896091&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/config.xml (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundlea/src/main/resources/OSGI-INF/blueprint/config.xml Tue Jan  5 15:25:28 2010
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+    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.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
+
+    <bean id="NSHandlerOne" class="org.apache.aries.blueprint.testbundlea.NSHandlerOne">
+    </bean>
+
+    <bean id="NSHandlerTwo" class="org.apache.aries.blueprint.testbundlea.NSHandlerTwo">
+    </bean>
+    
+    <bean id="NSHandlerThree" class="org.apache.aries.blueprint.testbundlea.NSHandlerThree">
+    </bean>
+    
+    <service interface="org.apache.aries.blueprint.NamespaceHandler" ref="NSHandlerOne">
+        <service-properties>
+            <entry key="osgi.service.blueprint.namespace" value="http://ns.handler.one"/>
+        </service-properties>
+    </service>
+
+    <service interface="org.apache.aries.blueprint.NamespaceHandler" ref="NSHandlerTwo">
+        <service-properties>
+            <entry key="osgi.service.blueprint.namespace" value="http://ns.handler.two"/>
+        </service-properties>
+    </service>
+
+    <service interface="org.apache.aries.blueprint.NamespaceHandler" ref="NSHandlerThree">
+        <service-properties>
+            <entry key="osgi.service.blueprint.namespace" value="http://ns.handler.three"/>
+        </service-properties>
+    </service>
+    
+</blueprint>
+