You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by zo...@apache.org on 2010/06/17 19:48:56 UTC
svn commit: r955686 - in /incubator/aries/trunk/samples/goat: ./
goat-assembly/ goat-assembly/src/main/filtered-resources/configuration/
goat-dummy2-provider/ goat-dummy2-provider/src/
goat-dummy2-provider/src/main/ goat-dummy2-provider/src/main/java/ ...
Author: zoe
Date: Thu Jun 17 17:48:56 2010
New Revision: 955686
URL: http://svn.apache.org/viewvc?rev=955686&view=rev
Log:
ARIES-319 A second provider to help with debugging provider switches
Added:
incubator/aries/trunk/samples/goat/goat-dummy2-provider/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/pom.xml
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyInfoProvider.java
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyModelService2.java
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyRelationshipProvider.java
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/resources/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/resources/OSGI-INF/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/resources/OSGI-INF/blueprint/
incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml
Modified:
incubator/aries/trunk/samples/goat/goat-assembly/pom.xml
incubator/aries/trunk/samples/goat/goat-assembly/src/main/filtered-resources/configuration/config.ini
incubator/aries/trunk/samples/goat/goat-eba/pom.xml
incubator/aries/trunk/samples/goat/pom.xml
Modified: incubator/aries/trunk/samples/goat/goat-assembly/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-assembly/pom.xml?rev=955686&r1=955685&r2=955686&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-assembly/pom.xml (original)
+++ incubator/aries/trunk/samples/goat/goat-assembly/pom.xml Thu Jun 17 17:48:56 2010
@@ -122,6 +122,10 @@
</dependency>
<dependency>
<groupId>org.apache.aries.samples.goat</groupId>
+ <artifactId>org.apache.aries.samples.goat.dummy2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.samples.goat</groupId>
<artifactId>org.apache.aries.samples.goat.bundlecontextmodel</artifactId>
</dependency>
<dependency>
Modified: incubator/aries/trunk/samples/goat/goat-assembly/src/main/filtered-resources/configuration/config.ini
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-assembly/src/main/filtered-resources/configuration/config.ini?rev=955686&r1=955685&r2=955686&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-assembly/src/main/filtered-resources/configuration/config.ini (original)
+++ incubator/aries/trunk/samples/goat/goat-assembly/src/main/filtered-resources/configuration/config.ini Thu Jun 17 17:48:56 2010
@@ -30,6 +30,7 @@ services-3.1.200-v20070605.jar@start,\
org.apache.aries.samples.goat.api-${version}@start,\
org.apache.aries.samples.goat.web-${version}.jar@start,\
org.apache.aries.samples.goat.dummy-${version}.jar@start,\
+org.apache.aries.samples.goat.dummy2-${version}.jar@start,\
org.apache.aries.samples.goat.bundlecontextmodel-${version}.jar@start,\
org.apache.aries.samples.goat.info.enhancer-${version}.jar@start
eclipse.ignoreApp=true
Added: incubator/aries/trunk/samples/goat/goat-dummy2-provider/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-dummy2-provider/pom.xml?rev=955686&view=auto
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-dummy2-provider/pom.xml (added)
+++ incubator/aries/trunk/samples/goat/goat-dummy2-provider/pom.xml Thu Jun 17 17:48:56 2010
@@ -0,0 +1,60 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.aries.samples.goat</groupId>
+ <artifactId>goat</artifactId>
+ <version>0.2-incubating-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.apache.aries.samples.goat.dummy2</artifactId>
+ <name>Apache Aries GOAT dummy2 provider</name>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.aries.samples.goat</groupId>
+ <artifactId>org.apache.aries.samples.goat.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.samples.goat</groupId>
+ <artifactId>org.apache.aries.samples.goat.web</artifactId>
+ </dependency>
+ </dependencies>
+
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+ <Private-Package>org.apache.aries.samples.goat.dummy2.*</Private-Package>
+ <Export-Package>!org.apache.aries.samples.goat.dummy2.*</Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
Added: incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyInfoProvider.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyInfoProvider.java?rev=955686&view=auto
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyInfoProvider.java (added)
+++ incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyInfoProvider.java Thu Jun 17 17:48:56 2010
@@ -0,0 +1,88 @@
+/**
+ * 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.samples.goat.dummy2;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.aries.samples.goat.info.ComponentInfoImpl;
+
+import org.apache.aries.samples.goat.api.ComponentInfo;
+import org.apache.aries.samples.goat.api.ComponentInfoProvider;
+
+public class DummyInfoProvider implements ComponentInfoProvider {
+
+ ComponentInfoImpl a = new ComponentInfoImpl();
+ ComponentInfoImpl b = new ComponentInfoImpl();
+ ComponentInfoImpl c = new ComponentInfoImpl();
+
+ public DummyInfoProvider(){
+
+ a.setId("/root/"+1);
+ Map<String,String> props = new HashMap<String,String>();
+ props.put("SymbolicName", "Mickey.Bundle");
+ props.put("Version", "1.0.0");
+ props.put("State", "RESOLVED");
+ props.put("BundleID", "1");
+ a.setComponentProperties(props);
+
+ b.setId("/root/"+2);
+ props = new HashMap<String,String>();
+ props.put("SymbolicName", "Mouse");
+ props.put("Version", "1.0.0");
+ props.put("State", "ACTIVE");
+ props.put("BundleID", "2");
+ b.setComponentProperties(props);
+
+ c.setId("/root/"+3);
+ props = new HashMap<String,String>();
+ props.put("SymbolicName", "Barney");
+ props.put("Version", "1.0.0");
+ props.put("State", "ACTIVE");
+ props.put("BundleID", "3");
+ c.setComponentProperties(props);
+ }
+
+ @Override
+ public List<ComponentInfo> getComponents() {
+ List<ComponentInfo> result = new ArrayList<ComponentInfo>();
+ result.add(a);
+ result.add(b);
+ result.add(c);
+ return result;
+ }
+
+ @Override
+ public ComponentInfo getComponentForId(String id) {
+ if("/root/1".equals(id)) return a;
+ if("/root/2".equals(id)) return b;
+ if("/root/3".equals(id)) return c;
+ return null;
+ }
+
+ @Override
+ public void registerComponentInfoListener(ComponentInfoListener listener) {
+ //no-op
+ }
+
+}
+
Added: incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyModelService2.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyModelService2.java?rev=955686&view=auto
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyModelService2.java (added)
+++ incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyModelService2.java Thu Jun 17 17:48:56 2010
@@ -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.
+ */
+package org.apache.aries.samples.goat.dummy2;
+
+import org.apache.aries.samples.goat.api.ComponentInfoProvider;
+import org.apache.aries.samples.goat.api.ModelInfoService;
+import org.apache.aries.samples.goat.api.RelationshipInfoProvider;
+
+public class DummyModelService2 implements ModelInfoService {
+
+ private final static ComponentInfoProvider cip = new DummyInfoProvider();
+ private final static RelationshipInfoProvider rip = new DummyRelationshipProvider(cip);
+
+ @Override
+ public String getName() {
+ return "Dummy Model Service";
+ }
+
+ @Override
+ public ComponentInfoProvider getComponentInfoProvider() {
+ return cip;
+ }
+
+ @Override
+ public RelationshipInfoProvider getRelationshipInfoProvider() {
+ return rip;
+ }
+
+}
Added: incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyRelationshipProvider.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyRelationshipProvider.java?rev=955686&view=auto
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyRelationshipProvider.java (added)
+++ incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/java/org/apache/aries/samples/goat/dummy/DummyRelationshipProvider.java Thu Jun 17 17:48:56 2010
@@ -0,0 +1,112 @@
+/**
+ * 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.samples.goat.dummy2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.aries.samples.goat.info.RelationshipInfoImpl;
+
+import org.apache.aries.samples.goat.api.ComponentInfo;
+import org.apache.aries.samples.goat.api.ComponentInfoProvider;
+import org.apache.aries.samples.goat.api.RelationshipInfo;
+import org.apache.aries.samples.goat.api.RelationshipInfoProvider;
+
+public class DummyRelationshipProvider implements RelationshipInfoProvider {
+
+ ComponentInfoProvider cip = null;
+
+ public DummyRelationshipProvider(ComponentInfoProvider cip){
+ this.cip = cip;
+ }
+
+ @Override
+ public List<RelationshipInfo> getRelationships() {
+
+ ArrayList<RelationshipInfo> ris = new ArrayList<RelationshipInfo>();
+
+ ComponentInfo ci1 = cip.getComponentForId("/root/1");
+ ComponentInfo ci2 = cip.getComponentForId("/root/2");
+ ComponentInfo ci3 = cip.getComponentForId("/root/3");
+
+ RelationshipInfoImpl ri1 = new RelationshipInfoImpl();
+ RelationshipInfoImpl ri2 = new RelationshipInfoImpl();
+ RelationshipInfoImpl ri3 = new RelationshipInfoImpl();
+ RelationshipInfoImpl ri4 = new RelationshipInfoImpl();
+ RelationshipInfoImpl ri5 = new RelationshipInfoImpl();
+ RelationshipInfoImpl ri6 = new RelationshipInfoImpl();
+ ris.add(ri1);
+ ris.add(ri2);
+ ris.add(ri3);
+ ris.add(ri4);
+ ris.add(ri5);
+ ris.add(ri6);
+
+ ri1.setName("i.am.exported.by.1.and.used.by.2.and.3");
+ ri1.setProvidedBy(ci1);
+ ArrayList<ComponentInfo> c = new ArrayList<ComponentInfo>();
+ c.add(ci2);
+ c.add(ci3);
+ ri1.setConsumedBy(c);
+ ri1.setType("Package");
+
+ ri2.setName("i.am.exported.by.1.and.used.by.3");
+ ri2.setProvidedBy(ci1);
+ c = new ArrayList<ComponentInfo>();
+ c.add(ci3);
+ ri2.setConsumedBy(c);
+ ri2.setType("Package");
+
+ ri3.setName("i.am.exported.by.2.and.used.by.3");
+ ri3.setProvidedBy(ci2);
+ c = new ArrayList<ComponentInfo>();
+ c.add(ci3);
+ ri3.setConsumedBy(c);
+ ri3.setType("Package");
+
+ ri4.setName("i.am.exported.by.3.and.used.by.2");
+ ri4.setProvidedBy(ci3);
+ c = new ArrayList<ComponentInfo>();
+ c.add(ci2);
+ ri4.setConsumedBy(c);
+ ri4.setType("Package");
+
+ ri5.setName("i.am.a.funky.service.from.3.used.by.2");
+ ri5.setProvidedBy(ci3);
+ c = new ArrayList<ComponentInfo>();
+ c.add(ci2);
+ ri5.setConsumedBy(c);
+ ri5.setType("Service");
+
+ ri6.setName("i.am.a.funky.service.from.1.used.by.2");
+ ri6.setProvidedBy(ci1);
+ c = new ArrayList<ComponentInfo>();
+ c.add(ci2);
+ ri6.setConsumedBy(c);
+ ri6.setType("Service");
+ return ris;
+ }
+
+ @Override
+ public void registerRelationshipInfoListener(RelationshipInfoListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=955686&view=auto
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml (added)
+++ incubator/aries/trunk/samples/goat/goat-dummy2-provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml Thu Jun 17 17:48:56 2010
@@ -0,0 +1,26 @@
+<?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.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+ <bean id="dummyInfoProvider2" class="org.apache.aries.samples.goat.dummy2.DummyModelService2">
+ </bean>
+ <service ref="dummyInfoProvider2" interface="org.apache.aries.samples.goat.api.ModelInfoService">
+ <service-properties>
+ <entry key="displayName" value="DummyInfoProvider2"/>
+ </service-properties>
+ </service>
+</blueprint>
Modified: incubator/aries/trunk/samples/goat/goat-eba/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-eba/pom.xml?rev=955686&r1=955685&r2=955686&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-eba/pom.xml (original)
+++ incubator/aries/trunk/samples/goat/goat-eba/pom.xml Thu Jun 17 17:48:56 2010
@@ -60,6 +60,11 @@ under the License.
</dependency>
<dependency>
<groupId>org.apache.aries.samples.goat</groupId>
+ <artifactId>org.apache.aries.samples.goat.dummy2</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.samples.goat</groupId>
<artifactId>org.apache.aries.samples.goat.info.enhancer</artifactId>
<version>${version}</version>
</dependency>
Modified: incubator/aries/trunk/samples/goat/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/pom.xml?rev=955686&r1=955685&r2=955686&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/pom.xml (original)
+++ incubator/aries/trunk/samples/goat/pom.xml Thu Jun 17 17:48:56 2010
@@ -53,6 +53,11 @@
</dependency>
<dependency>
<groupId>org.apache.aries.samples.goat</groupId>
+ <artifactId>org.apache.aries.samples.goat.dummy2</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.samples.goat</groupId>
<artifactId>org.apache.aries.samples.goat.bundlecontextmodel</artifactId>
<version>${version}</version>
</dependency>
@@ -69,6 +74,7 @@
<module>goat-api</module>
<module>goat-web</module>
<module>goat-dummy-provider</module>
+ <module>goat-dummy2-provider</module>
<module>goat-assembly</module>
<module>goat-eba</module>
<module>goat-bundlecontext-modelprovider</module>