incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1030981 - in /incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl: ./ META-INF/ META-INF/services/ src/ src/org/ src/org/apache/ src/org/apache/aries/ src/org/apache/aries/spifly/ src/org/apache/aries/spifly/mysvc/ ...
Date Thu, 04 Nov 2010 13:44:50 GMT
Author: davidb
Date: Thu Nov  4 13:44:49 2010
New Revision: 1030981

URL: http://svn.apache.org/viewvc?rev=1030981&view=rev
Log:
Initial import.

Added:
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/.classpath
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/.project
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/MANIFEST.MF
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/services/
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/services/org.apache.aries.spifly.mysvc.SPIProvider
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/build.properties
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/impl/
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/impl/SPIProviderImpl.java
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/internal/
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/internal/Activator.java
Modified:
    incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/   (props
changed)

Propchange: incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Nov  4 13:44:49 2010
@@ -0,0 +1,2 @@
+.settings
+bin

Added: incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/.classpath
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/.classpath?rev=1030981&view=auto
==============================================================================
--- incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/.classpath
(added)
+++ incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/.classpath
Thu Nov  4 13:44:49 2010
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/.project
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/.project?rev=1030981&view=auto
==============================================================================
--- incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/.project (added)
+++ incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/.project Thu
Nov  4 13:44:49 2010
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>MyServiceImpl</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/MANIFEST.MF?rev=1030981&view=auto
==============================================================================
--- incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/MANIFEST.MF
(added)
+++ incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/MANIFEST.MF
Thu Nov  4 13:44:49 2010
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ServiceLoaderService
+Bundle-SymbolicName: MyServiceImpl
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.apache.aries.spifly.api,
+ org.apache.aries.spifly.mysvc,
+ org.osgi.framework
+Export-Package: org.apache.aries.spifly.mysvc.impl
+Bundle-Activator: org.apache.aries.spifly.mysvc.internal.Activator
+SPI-Provider: org.apache.aries.spifly.mysvc.SPIProvider
+

Added: incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/services/org.apache.aries.spifly.mysvc.SPIProvider
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/services/org.apache.aries.spifly.mysvc.SPIProvider?rev=1030981&view=auto
==============================================================================
--- incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/services/org.apache.aries.spifly.mysvc.SPIProvider
(added)
+++ incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/META-INF/services/org.apache.aries.spifly.mysvc.SPIProvider
Thu Nov  4 13:44:49 2010
@@ -0,0 +1 @@
+org.apache.aries.spifly.mysvc.impl.SPIProviderImpl
\ No newline at end of file

Added: incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/build.properties
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/build.properties?rev=1030981&view=auto
==============================================================================
--- incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/build.properties
(added)
+++ incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/build.properties
Thu Nov  4 13:44:49 2010
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .

Added: incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/impl/SPIProviderImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/impl/SPIProviderImpl.java?rev=1030981&view=auto
==============================================================================
--- incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/impl/SPIProviderImpl.java
(added)
+++ incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/impl/SPIProviderImpl.java
Thu Nov  4 13:44:49 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.spifly.mysvc.impl;
+
+import org.apache.aries.spifly.mysvc.SPIProvider;
+
+public class SPIProviderImpl extends SPIProvider {
+	@Override
+	public void doit() {
+		System.out.println("Doing it!");
+	}
+}

Added: incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/internal/Activator.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/internal/Activator.java?rev=1030981&view=auto
==============================================================================
--- incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/internal/Activator.java
(added)
+++ incubator/aries/trunk/spi-fly/contrib/pilot_using_weavinghook/MyServiceImpl/src/org/apache/aries/spifly/mysvc/internal/Activator.java
Thu Nov  4 13:44:49 2010
@@ -0,0 +1,56 @@
+/**
+ * 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.mysvc.internal;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.apache.aries.spifly.api.SPIClassloaderAdviceService;
+import org.apache.aries.spifly.mysvc.SPIProvider;
+import org.apache.aries.spifly.mysvc.impl.SPIProviderImpl;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+// Everything that happens here could also be done with an extender...
+public class Activator implements BundleActivator {
+    private ServiceRegistration reg;
+
+    @Override
+    public void start(BundleContext context) throws Exception {
+        SPIClassloaderAdviceService svc = new SPIClassloaderAdviceService() {           

+            @Override
+            public ClassLoader getServiceClassLoader(Class<?> cls) {
+                if (cls.equals(SPIProvider.class)) {
+                    return SPIProviderImpl.class.getClassLoader();
+                }
+                return null;
+            }
+        };
+
+        Dictionary<String, Object> props = new Hashtable<String, Object>();
+        props.put("AdviceClass", SPIProvider.class.getName());
+        reg = context.registerService(SPIClassloaderAdviceService.class.getName(), svc, props);
+    }
+
+    @Override
+    public void stop(BundleContext context) throws Exception {
+        reg.unregister();
+    }
+}



Mime
View raw message