Return-Path: X-Original-To: apmail-aries-commits-archive@www.apache.org Delivered-To: apmail-aries-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9CD44D8A3 for ; Thu, 13 Sep 2012 19:22:25 +0000 (UTC) Received: (qmail 52671 invoked by uid 500); 13 Sep 2012 19:22:25 -0000 Delivered-To: apmail-aries-commits-archive@aries.apache.org Received: (qmail 52613 invoked by uid 500); 13 Sep 2012 19:22:25 -0000 Mailing-List: contact commits-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list commits@aries.apache.org Received: (qmail 52605 invoked by uid 99); 13 Sep 2012 19:22:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2012 19:22:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2012 19:22:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E762E238890D; Thu, 13 Sep 2012 19:21:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1384481 - in /aries/trunk/spi-fly: spi-fly-examples/ spi-fly-examples/spi-fly-example-resource-client-bundle/ spi-fly-examples/spi-fly-example-resource-client-bundle/src/ spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/ sp... Date: Thu, 13 Sep 2012 19:21:36 -0000 To: commits@aries.apache.org From: davidb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120913192136.E762E238890D@eris.apache.org> Author: davidb Date: Thu Sep 13 19:21:35 2012 New Revision: 1384481 URL: http://svn.apache.org/viewvc?rev=1384481&view=rev Log: Fix some issues with the static bundle manifest and add a demo that shows how SPI Fly can be used with TCCL.getResource() Added: aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/pom.xml aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/Activator.java aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/Foo.java aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/pom.xml aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/org/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/org/apache/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/org/apache/aries/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/org/apache/aries/spifly/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/org/apache/aries/spifly/test/ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/org/apache/aries/spifly/test/blah.txt Modified: aries/trunk/spi-fly/spi-fly-examples/pom.xml aries/trunk/spi-fly/spi-fly-static-bundle/pom.xml Modified: aries/trunk/spi-fly/spi-fly-examples/pom.xml URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-examples/pom.xml?rev=1384481&r1=1384480&r2=1384481&view=diff ============================================================================== --- aries/trunk/spi-fly/spi-fly-examples/pom.xml (original) +++ aries/trunk/spi-fly/spi-fly-examples/pom.xml Thu Sep 13 19:21:35 2012 @@ -46,5 +46,7 @@ spi-fly-example-client1-jar spi-fly-example-client1-bundle spi-fly-example-client2-bundle + spi-fly-example-resource-provider-bundle + spi-fly-example-resource-client-bundle Added: aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/pom.xml URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/pom.xml?rev=1384481&view=auto ============================================================================== --- aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/pom.xml (added) +++ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/pom.xml Thu Sep 13 19:21:35 2012 @@ -0,0 +1,67 @@ + + + + 4.0.0 + + org.apache.aries.spifly.examples + examples + 1.0.0-SNAPSHOT + + + org.apache.aries.spifly.examples.resource.client.bundle + bundle + Apache Aries Example Resource Client Bundle + + A Bundle obtaining a resource from the TCCL + + + + + org.osgi + org.osgi.core + provided + + + + + + + org.apache.felix + maven-bundle-plugin + + + + * + + + +org.apache.aries.spifly.example.resource.client + + org.apache.aries.spifly.example.resource.client.Activator + org.apache.aries.spifly.example.resource.client.Foo#doit() + + + + + + Added: aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/Activator.java URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/Activator.java?rev=1384481&view=auto ============================================================================== --- aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/Activator.java (added) +++ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/Activator.java Thu Sep 13 19:21:35 2012 @@ -0,0 +1,33 @@ +/** + * 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.example.resource.client; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + @Override + public void start(BundleContext context) throws Exception { + Foo.doit(); + } + + @Override + public void stop(BundleContext context) throws Exception { + } +} Added: aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/Foo.java URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/Foo.java?rev=1384481&view=auto ============================================================================== --- aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/Foo.java (added) +++ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-client-bundle/src/main/java/org/apache/aries/spifly/example/resource/client/Foo.java Thu Sep 13 19:21:35 2012 @@ -0,0 +1,33 @@ +/** + * 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.example.resource.client; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; + +class Foo { + static void doit() throws Exception { + System.out.println("*** About to invoke getThreadContextClassLoader().getResource()"); + + URL r = Thread.currentThread().getContextClassLoader().getResource("/org/apache/aries/spifly/test/blah.txt"); + System.out.println("*** Found resource: " + r); + System.out.println("*** First line of content: " + new BufferedReader(new InputStreamReader(r.openStream())).readLine()); + } +} Added: aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/pom.xml URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/pom.xml?rev=1384481&view=auto ============================================================================== --- aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/pom.xml (added) +++ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/pom.xml Thu Sep 13 19:21:35 2012 @@ -0,0 +1,54 @@ + + + + 4.0.0 + + org.apache.aries.spifly.examples + examples + 1.0.0-SNAPSHOT + + + org.apache.aries.spifly.examples.resource.provider.bundle + bundle + Apache Aries Example Resource Provider Bundle + + A Bundle providing a resource that another bundle attempts to obtain via the TCCL + + + + + + org.apache.felix + maven-bundle-plugin + + + + + + org.apache.aries.spifly.example.resource.client.Foo + + + + + + Added: aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/org/apache/aries/spifly/test/blah.txt URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/org/apache/aries/spifly/test/blah.txt?rev=1384481&view=auto ============================================================================== --- aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/org/apache/aries/spifly/test/blah.txt (added) +++ aries/trunk/spi-fly/spi-fly-examples/spi-fly-example-resource-provider-bundle/src/main/resources/org/apache/aries/spifly/test/blah.txt Thu Sep 13 19:21:35 2012 @@ -0,0 +1 @@ +This is a test resource. Modified: aries/trunk/spi-fly/spi-fly-static-bundle/pom.xml URL: http://svn.apache.org/viewvc/aries/trunk/spi-fly/spi-fly-static-bundle/pom.xml?rev=1384481&r1=1384480&r2=1384481&view=diff ============================================================================== --- aries/trunk/spi-fly/spi-fly-static-bundle/pom.xml (original) +++ aries/trunk/spi-fly/spi-fly-static-bundle/pom.xml Thu Sep 13 19:21:35 2012 @@ -49,6 +49,12 @@ org.osgi.core provided + + + org.osgi + org.osgi.compendium + provided + @@ -69,6 +75,7 @@ org.apache.aries.spifly.staticbundle org.apache.aries.spifly.staticbundle.StaticWeavingActivator + osgi.extender;osgi.extender=osgi.serviceloader.registrar