Author: ozzy
Date: Tue Jan 5 15:30:02 2010
New Revision: 896094
URL: http://svn.apache.org/viewvc?rev=896094&view=rev
Log:
ARIES-86 Initial commit
Added:
incubator/aries/trunk/blueprint/blueprint-testbundleb/pom.xml
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/Activator.java
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/BeanForBeanProcessorTest.java
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/OtherBean.java
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/TestBean.java
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml
Modified:
incubator/aries/trunk/blueprint/blueprint-testbundleb/ (props changed)
Propchange: incubator/aries/trunk/blueprint/blueprint-testbundleb/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Jan 5 15:30:02 2010
@@ -0,0 +1,4 @@
+.settings
+target
+.classpath
+.project
Added: incubator/aries/trunk/blueprint/blueprint-testbundleb/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundleb/pom.xml?rev=896094&view=auto
==============================================================================
--- incubator/aries/trunk/blueprint/blueprint-testbundleb/pom.xml (added)
+++ incubator/aries/trunk/blueprint/blueprint-testbundleb/pom.xml Tue Jan 5
15:30:02 2010
@@ -0,0 +1,69 @@
+<!--
+ 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 B, tests namespace handlers, bean
processors etc provided by Test Bundle A</description>
+ <parent>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>blueprint</artifactId>
+ <version>1.0.0-incubating-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.apache.aries.blueprint.testbundleb</artifactId>
+ <name>Apache Aries Blueprint Test Bundle B</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}.testbundleb</Bundle-SymbolicName>
+ <Bundle-Activator>
+ org.apache.aries.blueprint.testbundleb.Activator
+ </Bundle-Activator>
+ </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.testbundlea</artifactId>
+ <version>1.0.0-incubating-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint.core</artifactId>
+ <version>1.0.0-incubating-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
Added:
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/Activator.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/Activator.java?rev=896094&view=auto
==============================================================================
---
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/Activator.java
(added)
+++
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/Activator.java
Tue Jan 5 15:30:02 2010
@@ -0,0 +1,30 @@
+/**
+ * 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.testbundleb;
+
+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-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/BeanForBeanProcessorTest.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/BeanForBeanProcessorTest.java?rev=896094&view=auto
==============================================================================
---
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/BeanForBeanProcessorTest.java
(added)
+++
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/BeanForBeanProcessorTest.java
Tue Jan 5 15:30:02 2010
@@ -0,0 +1,75 @@
+/**
+ * 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.testbundleb;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.aries.blueprint.BeanProcessor;
+import org.apache.aries.blueprint.testbundlea.ProcessableBean;
+
+public class BeanForBeanProcessorTest implements ProcessableBean{
+
+ Set<BeanProcessor> bps = new HashSet<BeanProcessor>();
+ Set<BeanProcessor> ad_bps = new HashSet<BeanProcessor>();
+ Set<BeanProcessor> ai_bps = new HashSet<BeanProcessor>();
+ Set<BeanProcessor> bd_bps = new HashSet<BeanProcessor>();
+ Set<BeanProcessor> bi_bps = new HashSet<BeanProcessor>();
+
+ private List<BeanProcessor> toList(Set<BeanProcessor> s){
+ List<BeanProcessor> lbps = new ArrayList<BeanProcessor>();
+ lbps.addAll(s);
+ return lbps;
+ }
+
+ public List<BeanProcessor> getProcessedBy() {
+ return toList(bps);
+ }
+
+ public List<BeanProcessor> getProcessedBy(Phase p) {
+ switch(p){
+ case BEFORE_INIT : return toList(bi_bps);
+ case AFTER_INIT : return toList(ai_bps);
+ case BEFORE_DESTROY : return toList(bd_bps);
+ case AFTER_DESTROY : return toList(ad_bps);
+ default: return null;
+ }
+ }
+
+ public void processAfterDestroy(BeanProcessor bp) {
+ bps.add(bp);
+ ad_bps.add(bp);
+ }
+
+ public void processAfterInit(BeanProcessor bp) {
+ bps.add(bp);
+ ai_bps.add(bp);
+ }
+
+ public void processBeforeDestroy(BeanProcessor bp) {
+ bps.add(bp);
+ bd_bps.add(bp);
+ }
+
+ public void processBeforeInit(BeanProcessor bp) {
+ bps.add(bp);
+ bi_bps.add(bp);
+ }
+
+}
Added:
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/OtherBean.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/OtherBean.java?rev=896094&view=auto
==============================================================================
---
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/OtherBean.java
(added)
+++
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/OtherBean.java
Tue Jan 5 15:30:02 2010
@@ -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.
+ */
+package org.apache.aries.blueprint.testbundleb;
+
+public class OtherBean {
+ private TestBean testBean;
+ private String testValue;
+
+public String getTestValue() {
+ return testValue;
+}
+
+public void setTestValue(String testValue) {
+ this.testValue = testValue;
+}
+
+public TestBean getTestBean() {
+ return testBean;
+}
+
+public void setTestBean(TestBean testBean) {
+ this.testBean = testBean;
+}
+
+public void init(){
+ try{
+ this.testBean.methodToInvoke(testValue);
+ }catch(Throwable t){
+ //ignore error.
+ }
+}
+
+}
Added:
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/TestBean.java
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/TestBean.java?rev=896094&view=auto
==============================================================================
---
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/TestBean.java
(added)
+++
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/java/org/apache/aries/blueprint/testbundleb/TestBean.java
Tue Jan 5 15:30:02 2010
@@ -0,0 +1,60 @@
+/**
+ * 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.testbundleb;
+
+public class TestBean {
+ private String red;
+ private String green;
+ private String blue;
+
+ public void init(){
+ setRed("EMPTY");
+ setGreen("EMPTY");
+ setBlue("EMPTY");
+ }
+
+ public String getRed() {
+ return red;
+ }
+ public void setRed(String red) {
+ this.red = red;
+ }
+ public String getGreen() {
+ return green;
+ }
+ public void setGreen(String green) {
+ this.green = green;
+ }
+ public String getBlue() {
+ return blue;
+ }
+ public void setBlue(String blue) {
+ this.blue = blue;
+ }
+
+ public boolean methodToInvoke(String argument){
+ if(argument!=null){
+ if(argument.equals(red)){
+ return true;
+ }
+ if(argument.equals(green)){
+ throw new RuntimeException("MATCHED ON GREEN ("+green+")");
+ }
+ }
+ return false;
+ }
+}
Added:
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml
URL:
http://svn.apache.org/viewvc/incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml?rev=896094&view=auto
==============================================================================
---
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml
(added)
+++
incubator/aries/trunk/blueprint/blueprint-testbundleb/src/main/resources/OSGI-INF/blueprint/config.xml
Tue Jan 5 15:30:02 2010
@@ -0,0 +1,62 @@
+<?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"
+ xmlns:one="http://ns.handler.one"
+ xmlns:two="http://ns.handler.two"
+ xmlns:three="http://ns.handler.three"
+ default-availability="optional">
+
+ <!-- Default test.. no other ns interaction. -->
+ <bean id="TestBeanA" class="org.apache.aries.blueprint.testbundleb.TestBean"
scope="singleton">
+ <property name="red" value="RED"/>
+ <property name="green" value="GREEN"/>
+ <property name="blue" value="BLUE"/>
+ </bean>
+
+ <!-- NShandler one test, custom element, component injection, metadata
modification, passthrumetadata -->
+ <one:nshandlerone one:attribone="ONE" one:attribtwo="ONE_VALUE"/>
+ <bean id="TestBeanB" class="org.apache.aries.blueprint.testbundleb.TestBean"
scope="singleton" one:attribone="red" one:attribtwo="ONE" >
+ <property name="green" value="GREEN"/>
+ <property name="blue" value="BLUE"/>
+ </bean>
+
+ <!-- Nshandler two test, interceptors -->
+ <bean id="TestBeanC" class="org.apache.aries.blueprint.testbundleb.TestBean"
scope="singleton" two:attribone="dummy">
+ <property name="red" value="RED"/>
+ <property name="green" value="GREEN"/>
+ <property name="blue" value="BLUE"/>
+ </bean>
+
+ <!-- drives a method on intercepted TestBeanC expects true as response -->
+ <bean id="OtherBeanA"
class="org.apache.aries.blueprint.testbundleb.OtherBean" init-method="init">
+ <property name="testBean" ref="TestBeanC" />
+ <property name="testValue" value="RED"/>
+ </bean>
+
+ <!-- drives a method on intercepted TestBeanC expects false as response -->
+ <bean id="OtherBeanB"
class="org.apache.aries.blueprint.testbundleb.OtherBean" init-method="init">
+ <property name="testBean" ref="TestBeanC" />
+ <property name="testValue" value="BLUE"/>
+ </bean>
+
+ <!-- causes injection of a bean processor, which understands this sort of
bean.. -->
+ <bean id="ProcessedBean"
class="org.apache.aries.blueprint.testbundleb.BeanForBeanProcessorTest"
three:attribone="true"/>
+</blueprint>
+