aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1716903 - in /aries/trunk/spi-fly/spi-fly-examples: spi-fly-example-client3-bundle/ spi-fly-example-client3-bundle/src/ spi-fly-example-client3-bundle/src/main/ spi-fly-example-client3-bundle/src/main/java/ spi-fly-example-client3-bundle/s...
Date Fri, 27 Nov 2015 17:25:10 GMT
Author: davidb
Date: Fri Nov 27 17:25:10 2015
New Revision: 1716903

URL: http://svn.apache.org/viewvc?rev=1716903&view=rev
Log:
ARIES-1461 Example for an SPI client based on a fragment.

This example does not work yet, the relevant code still needs to be added.

Added:
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/pom.xml
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/aries/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/aries/spifly/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/aries/spifly/examples/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/aries/spifly/examples/client3/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/aries/spifly/examples/client3/impl/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/aries/spifly/examples/client3/impl/Activator.java
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-fragment/
    aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-fragment/pom.xml

Added: aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/pom.xml?rev=1716903&view=auto
==============================================================================
--- aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/pom.xml (added)
+++ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/pom.xml Fri Nov 27
17:25:10 2015
@@ -0,0 +1,78 @@
+<?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.spifly.examples</groupId>
+        <artifactId>spi-fly-examples</artifactId>
+        <version>1.0.1-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>org.apache.aries.spifly.examples.client3.bundle</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache Aries Example SPI Client Bundle 3</name>
+    <description>
+        A Bundle that uses the java.util.ServiceLoader() API but does not have any SPI Fly
headers
+        they are provided by a separate fragment.
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>        
+
+        <dependency>
+            <groupId>org.apache.aries.spifly.examples</groupId>
+            <artifactId>org.apache.aries.spifly.examples.spi.bundle</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>        
+    </dependencies>
+
+    <properties>
+        <aries.osgi.export.pkg />
+        <lastReleaseVersion>1.0.1-SNAPSHOT</lastReleaseVersion>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Import-Package>
+                            *
+                        </Import-Package>
+                        <Export-Package />
+                        <Private-Package>
+                            org.apache.aries.spifly.examples.client3.impl
+                        </Private-Package>
+                        <Bundle-Activator>org.apache.aries.spifly.examples.client3.impl.Activator</Bundle-Activator>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/aries/spifly/examples/client3/impl/Activator.java
URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/aries/spifly/examples/client3/impl/Activator.java?rev=1716903&view=auto
==============================================================================
--- aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/aries/spifly/examples/client3/impl/Activator.java
(added)
+++ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-bundle/src/main/java/org/apache/aries/spifly/examples/client3/impl/Activator.java
Fri Nov 27 17:25:10 2015
@@ -0,0 +1,40 @@
+/**
+ * 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.spifly.examples.client3.impl;
+
+import java.util.ServiceLoader;
+
+import org.apache.aries.spifly.mysvc.SPIProvider;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+    @Override
+    public void start(BundleContext context) throws Exception {
+        System.out.println("*** Result from invoking the SPI from untreated bundle: ");
+        ServiceLoader<SPIProvider> ldr = ServiceLoader.load(SPIProvider.class);
+        for (SPIProvider spiObject : ldr) {
+            System.out.println(spiObject.doit()); // invoke the SPI object
+        }
+    }
+
+    @Override
+    public void stop(BundleContext context) throws Exception {
+    }
+}

Added: aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-fragment/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-fragment/pom.xml?rev=1716903&view=auto
==============================================================================
--- aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-fragment/pom.xml (added)
+++ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-client3-fragment/pom.xml Fri Nov
27 17:25:10 2015
@@ -0,0 +1,59 @@
+<?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.spifly.examples</groupId>
+        <artifactId>spi-fly-examples</artifactId>
+        <version>1.0.1-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>org.apache.aries.spifly.examples.client3.fragment</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache Aries Example SPI Client Bundle 3 Fragment</name>
+    <description>
+        A fragment that adds the SPI Fly headers to an untreated bundle using serviceloader.
+    </description>
+
+    <properties>
+        <aries.osgi.export.pkg />
+        <lastReleaseVersion>1.0.1-SNAPSHOT</lastReleaseVersion>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <Fragment-Host>org.apache.aries.spifly.examples.client3.bundle</Fragment-Host>
+                        <Import-Package />
+                        <Export-Package />
+                        <Private-Package />
+                        <Require-Capability>osgi.serviceloader; filter:="(osgi.serviceloader=org.apache.aries.spifly.mysvc.SPIProvider)";cardinality:=multiple,osgi.extender;
filter:="(osgi.extender=osgi.serviceloader.processor)"</Require-Capability>        
               
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>



Mime
View raw message