tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r689597 - in /tuscany/java/sca/modules/extensibility-equinox: pom.xml src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
Date Wed, 27 Aug 2008 20:13:28 GMT
Author: rfeng
Date: Wed Aug 27 13:13:27 2008
New Revision: 689597

URL: http://svn.apache.org/viewvc?rev=689597&view=rev
Log:
Add a bundle activator to set up the ServiceDiscovery

Added:
    tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
  (with props)
Modified:
    tuscany/java/sca/modules/extensibility-equinox/pom.xml

Modified: tuscany/java/sca/modules/extensibility-equinox/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/extensibility-equinox/pom.xml?rev=689597&r1=689596&r2=689597&view=diff
==============================================================================
--- tuscany/java/sca/modules/extensibility-equinox/pom.xml (original)
+++ tuscany/java/sca/modules/extensibility-equinox/pom.xml Wed Aug 27 13:13:27 2008
@@ -75,6 +75,8 @@
                         <Bundle-SymbolicName>org.apache.tuscany.sca.extensibility.equinox
                         </Bundle-SymbolicName>
                         <Bundle-Description>${pom.name}</Bundle-Description>
+                        <Bundle-Activator>org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator</Bundle-Activator>
+                        <!-- This bundle will be the gateway to all exported packages
-->
                         <DynamicImport-Package>*</DynamicImport-Package>
                     </instructions>
                 </configuration>

Added: tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java?rev=689597&view=auto
==============================================================================
--- tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
(added)
+++ tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
Wed Aug 27 13:13:27 2008
@@ -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.tuscany.sca.extensibility.equinox;
+
+import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The Bundle Activator that creates the Equinox-based service discoverer 
+ */
+public class EquinoxServiceDiscoveryActivator implements BundleActivator {
+    private static BundleContext bundleContext;
+
+    public void start(BundleContext context) throws Exception {
+        if (bundleContext == null) {
+            bundleContext = context;
+            EquinoxServiceDiscoverer discoverer = new EquinoxServiceDiscoverer(bundleContext);
+            ServiceDiscovery.setServiceDiscoverer(discoverer);
+        }
+    }
+
+    public void stop(BundleContext context) throws Exception {
+        bundleContext = null;
+        // ServiceDiscovery.setServiceDiscoverer(discoverer);
+    }
+
+}

Propchange: tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoveryActivator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message