tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r826369 - in /tuscany/java/sca/modules/node-impl-osgi: ./ META-INF/ src/main/java/org/apache/tuscany/sca/node/osgi/impl/ src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ src/main/java/org/apache/tuscany/sca/osgi/remoteservicead...
Date Sun, 18 Oct 2009 07:24:04 GMT
Author: rfeng
Date: Sun Oct 18 07:24:02 2009
New Revision: 826369

URL: http://svn.apache.org/viewvc?rev=826369&view=rev
Log:
Refactor the OSGi remote services implementation and improve the notifications

Added:
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointDescription.java
      - copied, changed from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointDescription.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointListener.java
      - copied, changed from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointListener.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointPermission.java
      - copied, changed from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointPermission.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ExportRegistration.java
      - copied, changed from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/ExportRegistration.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ImportRegistration.java
      - copied, changed from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/ImportRegistration.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteConstants.java
      - copied, changed from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteConstants.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdmin.java
      - copied, changed from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdmin.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdminEvent.java
      - copied, changed from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdminEvent.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdminListener.java
      - copied, changed from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdminListener.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/
      - copied from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/impl/
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/TopologyManagerImpl.java
      - copied, changed from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/impl/RemoteControllerImpl.java
Removed:
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteControllerImpl.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointDescription.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointListener.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointPermission.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/ExportRegistration.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/ImportRegistration.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteConstants.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdmin.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdminEvent.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdminListener.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/impl/
Modified:
    tuscany/java/sca/modules/node-impl-osgi/META-INF/MANIFEST.MF
    tuscany/java/sca/modules/node-impl-osgi/pom.xml
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeActivator.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/EndpointHelper.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/EndpointIntrospector.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/ExportRegistrationImpl.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/ImportRegistrationImpl.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiHelper.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiServiceExporter.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiServiceImporter.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/AbstractDiscoveryService.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java
    tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/LocalDiscoveryService.java

Modified: tuscany/java/sca/modules/node-impl-osgi/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/META-INF/MANIFEST.MF?rev=826369&r1=826368&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/META-INF/MANIFEST.MF (original)
+++ tuscany/java/sca/modules/node-impl-osgi/META-INF/MANIFEST.MF Sun Oct 18 07:24:02 2009
@@ -32,7 +32,7 @@
  org.apache.tuscany.sca.node;version="2.0.0",
  org.apache.tuscany.sca.node.configuration;version="2.0.0",
  org.apache.tuscany.sca.node.impl;version="2.0.0",
- org.apache.tuscany.sca.osgi.service.remoteadmin;version="2.0.0",
+ org.apache.tuscany.sca.osgi.remoteserviceadmin;version="2.0.0",
  org.apache.tuscany.sca.policy;version="2.0.0",
  org.apache.tuscany.sca.provider;version="2.0.0",
  org.apache.tuscany.sca.runtime;version="2.0.0",
@@ -41,10 +41,11 @@
  org.oasisopen.sca.annotation;version="2.0.0";resolution:=optional,
  org.osgi.framework;version="1.4.0",
  org.osgi.framework.hooks.service;version="1.0.0";resolution:=optional,
+ org.osgi.service.event;version="1.2.0",
  org.osgi.service.packageadmin;version="1.2.0";resolution:=optional,
  org.osgi.util.tracker;version="1.3.0";resolution:=optional
 Bundle-SymbolicName: org.apache.tuscany.sca.node.osgi.impl
 Bundle-DocURL: http://www.apache.org/
 Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
 Bundle-ActivationPolicy: lazy
-Export-Package: org.apache.tuscany.sca.osgi.service.remoteadmin;version="2.0.0"
+Export-Package: org.apache.tuscany.sca.osgi.remoteserviceadmin;version="2.0.0"

Modified: tuscany/java/sca/modules/node-impl-osgi/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/pom.xml?rev=826369&r1=826368&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/pom.xml (original)
+++ tuscany/java/sca/modules/node-impl-osgi/pom.xml Sun Oct 18 07:24:02 2009
@@ -52,7 +52,7 @@
             <groupId>org.eclipse.osgi</groupId>
             <artifactId>services</artifactId>
             <version>3.2.0-v20090520-1800</version>
-            <scope>test</scope>
+            <scope>compile</scope>
         </dependency>
 
         <!-- Equinox Declarative Services -->

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeActivator.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeActivator.java?rev=826369&r1=826368&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeActivator.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeActivator.java Sun Oct 18 07:24:02 2009
@@ -21,9 +21,9 @@
 
 import static org.apache.tuscany.sca.node.osgi.impl.NodeManager.isSCABundle;
 
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.impl.TopologyManagerImpl;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.impl.RemoteServiceAdminImpl;
 import org.apache.tuscany.sca.osgi.service.discovery.impl.DiscoveryActivator;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.impl.RemoteServiceAdminImpl;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.impl.RemoteControllerImpl;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
@@ -40,7 +40,7 @@
     
     private DiscoveryActivator discoveryActivator = new DiscoveryActivator();
     private RemoteServiceAdminImpl remoteAdmin;
-    private RemoteControllerImpl controller;
+    private TopologyManagerImpl controller;
 
     private void init() {
         synchronized (this) {
@@ -63,7 +63,7 @@
         remoteAdmin = new RemoteServiceAdminImpl(context);
         remoteAdmin.start();
         
-        controller = new RemoteControllerImpl(context);
+        controller = new TopologyManagerImpl(context);
         controller.start();
         
 //        exporter = new OSGiServiceExporter(context);

Copied: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointDescription.java (from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointDescription.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointDescription.java?p2=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointDescription.java&p1=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointDescription.java&r1=825940&r2=826369&rev=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointDescription.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointDescription.java Sun Oct 18 07:24:02 2009
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.tuscany.sca.osgi.service.remoteadmin;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin;
 
 import java.util.Arrays;
 import java.util.Collections;

Copied: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointListener.java (from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointListener.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointListener.java?p2=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointListener.java&p1=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointListener.java&r1=825940&r2=826369&rev=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointListener.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointListener.java Sun Oct 18 07:24:02 2009
@@ -1,4 +1,4 @@
-package org.apache.tuscany.sca.osgi.service.remoteadmin;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin;
 
 /**
  * A white board service that represents a listener for endpoints.

Copied: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointPermission.java (from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointPermission.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointPermission.java?p2=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointPermission.java&p1=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointPermission.java&r1=825940&r2=826369&rev=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/EndpointPermission.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/EndpointPermission.java Sun Oct 18 07:24:02 2009
@@ -1,4 +1,4 @@
-package org.apache.tuscany.sca.osgi.service.remoteadmin;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin;
 
 // TODO Hacked from ServiePermission
 

Copied: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ExportRegistration.java (from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/ExportRegistration.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ExportRegistration.java?p2=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ExportRegistration.java&p1=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/ExportRegistration.java&r1=825940&r2=826369&rev=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/ExportRegistration.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ExportRegistration.java Sun Oct 18 07:24:02 2009
@@ -1,4 +1,4 @@
-package org.apache.tuscany.sca.osgi.service.remoteadmin;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin;
 
 import org.osgi.framework.ServiceReference;
 

Copied: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ImportRegistration.java (from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/ImportRegistration.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ImportRegistration.java?p2=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ImportRegistration.java&p1=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/ImportRegistration.java&r1=825940&r2=826369&rev=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/ImportRegistration.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/ImportRegistration.java Sun Oct 18 07:24:02 2009
@@ -1,4 +1,4 @@
-package org.apache.tuscany.sca.osgi.service.remoteadmin;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin;
 
 import org.osgi.framework.ServiceReference;
 

Copied: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteConstants.java (from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteConstants.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteConstants.java?p2=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteConstants.java&p1=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteConstants.java&r1=825940&r2=826369&rev=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteConstants.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteConstants.java Sun Oct 18 07:24:02 2009
@@ -1,4 +1,4 @@
-package org.apache.tuscany.sca.osgi.service.remoteadmin;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin;
 
 /**
  * Provide the definition of the constants used in the Remote Services API.

Copied: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdmin.java (from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdmin.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdmin.java?p2=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdmin.java&p1=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdmin.java&r1=825940&r2=826369&rev=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdmin.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdmin.java Sun Oct 18 07:24:02 2009
@@ -1,4 +1,4 @@
-package org.apache.tuscany.sca.osgi.service.remoteadmin;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin;
 
 import java.util.Collection;
 import java.util.List;

Copied: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdminEvent.java (from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdminEvent.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdminEvent.java?p2=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdminEvent.java&p1=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdminEvent.java&r1=825940&r2=826369&rev=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdminEvent.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdminEvent.java Sun Oct 18 07:24:02 2009
@@ -1,4 +1,4 @@
-package org.apache.tuscany.sca.osgi.service.remoteadmin;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin;
 
 import org.osgi.framework.Bundle;
 

Copied: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdminListener.java (from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdminListener.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdminListener.java?p2=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdminListener.java&p1=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdminListener.java&r1=825940&r2=826369&rev=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/RemoteServiceAdminListener.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/RemoteServiceAdminListener.java Sun Oct 18 07:24:02 2009
@@ -1,4 +1,4 @@
-package org.apache.tuscany.sca.osgi.service.remoteadmin;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin;
 
 /**
  * A Remote Service Admin Listener is notified asynchronously of any export or

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/EndpointHelper.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/EndpointHelper.java?rev=826369&r1=825940&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/EndpointHelper.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/EndpointHelper.java Sun Oct 18 07:24:02 2009
@@ -17,9 +17,8 @@
  * under the License.    
  */
 
-package org.apache.tuscany.sca.osgi.service.remoteadmin.impl;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin.impl;
 
-import java.net.URL;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -29,8 +28,8 @@
 import org.apache.tuscany.sca.assembly.Endpoint;
 import org.apache.tuscany.sca.interfacedef.Interface;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteConstants;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteConstants;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 
@@ -38,8 +37,7 @@
  * Implementation of {@link EndpointDescription}
  */
 public class EndpointHelper {
-    private static final String FRAMEWORK_UUID = UUID.randomUUID().toString();
-    
+    private final static String FRAMEWORK_UUID = "org.osgi.framework.uuid";
     private EndpointHelper() {
     }
 
@@ -68,14 +66,12 @@
         return props;
     }
 
-    public static String getFrameworkUUID(BundleContext bundleContext) {
-        String uuid = null;
-        if (bundleContext != null) {
-            URL url = bundleContext.getBundle(0).getEntry("/"); // bundleentry://0.fwk24942249/
-            uuid = url.getHost();
-        } else {
-            uuid = FRAMEWORK_UUID;
+    public synchronized static String getFrameworkUUID(BundleContext bundleContext) {
+        String uuid = System.getProperty(FRAMEWORK_UUID);
+        if (uuid == null) {
+            uuid = UUID.randomUUID().toString();
         }
+        System.setProperty(FRAMEWORK_UUID, uuid);
         return uuid;
     }
 

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/EndpointIntrospector.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/EndpointIntrospector.java?rev=826369&r1=825940&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/EndpointIntrospector.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/EndpointIntrospector.java Sun Oct 18 07:24:02 2009
@@ -17,7 +17,7 @@
  * under the License.    
  */
 
-package org.apache.tuscany.sca.osgi.service.remoteadmin.impl;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin.impl;
 
 import static org.apache.tuscany.sca.assembly.Base.SCA11_TUSCANY_NS;
 import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SCA_BINDINGS;
@@ -33,11 +33,14 @@
 import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.UUID;
 
 import javax.xml.namespace.QName;
@@ -78,11 +81,12 @@
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
 import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
 import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.PolicyFactory;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -168,17 +172,50 @@
         return intentList;
     }
 
-    private Map<String, Object> getProperties(ServiceReference reference) {
+    /**
+     * Any property in the map overrides the service reference properties, regardless of
+     * case. That is, if the map contains a key then it will override any case variant
+     * of this key in the Service Reference.<p>
+     * If the map contains the objectClass or service. id property key in any case
+     * variant, then these properties must not override the Service Reference’s value. This 
+     * implies that the map can provide the service.exported. interfaces, property allowing 
+     * the Topology Manager to export any registered service, also services not specifically 
+     * marked to be exported.
+     * @param reference
+     * @param props
+     * @return
+     */
+    private Map<String, Object> getProperties(ServiceReference reference, Map<String, Object> props) {
         String[] names = reference.getPropertyKeys();
+        Map<String, Object> properties = new HashMap<String, Object>();
         if (names != null) {
-            Map<String, Object> properties = new HashMap<String, Object>();
             for (String name : names) {
                 properties.put(name, reference.getProperty(name));
             }
-            return properties;
-        } else {
-            return Collections.emptyMap();
         }
+        if (props != null) {
+            // Create a map of names (key = lowcase name, value = name)
+            Map<String, String> nameMap = new HashMap<String, String>();
+            if (names != null) {
+                for (String name : names) {
+                    nameMap.put(name.toLowerCase(), name);
+                }
+            }
+            for (Map.Entry<String, Object> p : props.entrySet()) {
+                if (Constants.OBJECTCLASS.equalsIgnoreCase(p.getKey())) {
+                    throw new IllegalArgumentException(Constants.OBJECTCLASS + " property cannot be overridden.");
+                } else if (Constants.SERVICE_ID.equalsIgnoreCase(p.getKey())) {
+                    throw new IllegalArgumentException(Constants.SERVICE_ID + " property cannot be overridden.");
+                }
+                String key = nameMap.get(p.getKey().toLowerCase());
+                if (key != null) {
+                    properties.put(key, p.getValue());
+                } else {
+                    properties.put(p.getKey(), p.getValue());
+                }
+            }
+        }
+        return properties;
     }
 
     /**
@@ -204,11 +241,12 @@
      * Introspect a local OSGi Service represented by the ServiceReference to create 
      * an SCA service with the required intents and bindings 
      * @param reference The service reference for a local OSGi service 
+     * @param props Addiontal properties
      * @return An SCA contribution with a deployable composite for the SCA service
      * @throws Exception
      */
-    public Contribution introspect(ServiceReference reference) throws Exception {
-        Map<String, Object> properties = getProperties(reference);
+    public Contribution introspect(ServiceReference reference, Map<String, Object> props) throws Exception {
+        Map<String, Object> properties = getProperties(reference, props);
 
         OSGiProperty serviceID = implementationFactory.createOSGiProperty();
         serviceID.setName(SERVICE_ID);
@@ -237,6 +275,12 @@
             remoteInterfaces = getStrings(reference.getProperty(OBJECTCLASS));
         } else {
             remoteInterfaces = parse(remoteInterfaces);
+            String[] objectClasses = getStrings(reference.getProperty(OBJECTCLASS));
+            Set<String> objectClassSet = new HashSet<String>(Arrays.asList(objectClasses));
+            if (!objectClassSet.containsAll(Arrays.asList(remoteInterfaces))) {
+                throw new IllegalArgumentException("The exported interfaces are not a subset of the types" 
+                                                   + " listed in the objectClass service property from the Service Reference");
+            }
         }
         for (String intf : remoteInterfaces) {
             Service service = assemblyFactory.createService();

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/ExportRegistrationImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/ExportRegistrationImpl.java?rev=826369&r1=825940&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/ExportRegistrationImpl.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/ExportRegistrationImpl.java Sun Oct 18 07:24:02 2009
@@ -17,11 +17,11 @@
  * under the License.    
  */
 
-package org.apache.tuscany.sca.osgi.service.remoteadmin.impl;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin.impl;
 
 import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.ExportRegistration;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.ExportRegistration;
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -58,7 +58,7 @@
     }
 
     /**
-     * @see org.apache.tuscany.sca.osgi.service.remoteadmin.ExportRegistration#close()
+     * @see org.apache.tuscany.sca.osgi.remoteserviceadmin.ExportRegistration#close()
      */
     public void close() {
         if (node != null) {

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/ImportRegistrationImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/ImportRegistrationImpl.java?rev=826369&r1=825940&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/ImportRegistrationImpl.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/ImportRegistrationImpl.java Sun Oct 18 07:24:02 2009
@@ -17,11 +17,11 @@
  * under the License.    
  */
 
-package org.apache.tuscany.sca.osgi.service.remoteadmin.impl;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin.impl;
 
 import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.ImportRegistration;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.ImportRegistration;
 import org.osgi.framework.ServiceReference;
 
 /**
@@ -61,7 +61,7 @@
     }
 
     /**
-     * @see org.apache.tuscany.sca.osgi.service.remoteadmin.ImportRegistration#close()
+     * @see org.apache.tuscany.sca.osgi.remoteserviceadmin.ImportRegistration#close()
      */
     public void close() {
         if (node != null) {

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiHelper.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiHelper.java?rev=826369&r1=825940&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiHelper.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiHelper.java Sun Oct 18 07:24:02 2009
@@ -17,7 +17,7 @@
  * under the License.    
  */
 
-package org.apache.tuscany.sca.osgi.service.remoteadmin.impl;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin.impl;
 
 import java.util.Arrays;
 import java.util.Collection;

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiServiceExporter.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiServiceExporter.java?rev=826369&r1=825940&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiServiceExporter.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiServiceExporter.java Sun Oct 18 07:24:02 2009
@@ -17,13 +17,14 @@
  * under the License.    
  */
 
-package org.apache.tuscany.sca.osgi.service.remoteadmin.impl;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin.impl;
 
-import static org.apache.tuscany.sca.osgi.service.remoteadmin.impl.EndpointHelper.createEndpointDescription;
+import static org.apache.tuscany.sca.osgi.remoteserviceadmin.impl.EndpointHelper.createEndpointDescription;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.tuscany.sca.assembly.Component;
 import org.apache.tuscany.sca.assembly.ComponentService;
@@ -35,8 +36,8 @@
 import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
 import org.apache.tuscany.sca.node.impl.NodeFactoryImpl;
 import org.apache.tuscany.sca.node.impl.NodeImpl;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.ExportRegistration;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.ExportRegistration;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
@@ -77,12 +78,13 @@
     }
 
     public Object addingService(ServiceReference reference) {
-        return exportService(reference);
+        return exportService(reference, null);
     }
 
-    public List<ExportRegistration> exportService(ServiceReference reference) {
+    public List<ExportRegistration> exportService(ServiceReference reference, Map<String, Object> properties) {
+        // FIXME: [rfeng] We need to check if a corresponding endpoint has been exported
         try {
-            Contribution contribution = introspector.introspect(reference);
+            Contribution contribution = introspector.introspect(reference, properties);
             if (contribution != null) {
 
                 NodeConfiguration configuration = nodeFactory.createNodeConfiguration();
@@ -112,7 +114,7 @@
 
     public void modifiedService(ServiceReference reference, Object service) {
         removedService(reference, service);
-        exportService(reference);
+        exportService(reference, null);
     }
 
     public void removedService(ServiceReference reference, Object service) {

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiServiceImporter.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiServiceImporter.java?rev=826369&r1=825940&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiServiceImporter.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/OSGiServiceImporter.java Sun Oct 18 07:24:02 2009
@@ -17,7 +17,7 @@
  * under the License.    
  */
 
-package org.apache.tuscany.sca.osgi.service.remoteadmin.impl;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin.impl;
 
 import java.util.Collections;
 
@@ -31,8 +31,8 @@
 import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
 import org.apache.tuscany.sca.node.impl.NodeFactoryImpl;
 import org.apache.tuscany.sca.node.impl.NodeImpl;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.ImportRegistration;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.ImportRegistration;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java?rev=826369&r1=825940&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java Sun Oct 18 07:24:02 2009
@@ -17,22 +17,27 @@
  * under the License.    
  */
 
-package org.apache.tuscany.sca.osgi.service.remoteadmin.impl;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin.impl;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.ExportRegistration;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.ImportRegistration;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteServiceAdmin;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteServiceAdminListener;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.ExportRegistration;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.ImportRegistration;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteServiceAdmin;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteServiceAdminEvent;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteServiceAdminListener;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventAdmin;
 import org.osgi.util.tracker.ServiceTracker;
 
 /**
@@ -91,52 +96,157 @@
     }
 
     /**
-     * @see org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteServiceAdmin#exportService(org.osgi.framework.ServiceReference)
+     * @see org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteServiceAdmin#exportService(org.osgi.framework.ServiceReference,
+     *      java.util.Map)
      */
-    public List<ExportRegistration> exportService(ServiceReference ref) {
-        List<ExportRegistration> exportRegistrations = exporter.exportService(ref);
+    public List<ExportRegistration> exportService(ServiceReference ref, Map properties) {
+        List<ExportRegistration> exportRegistrations = exporter.exportService(ref, properties);
         if (exportRegistrations != null) {
             exportedServices.addAll(exportRegistrations);
+            fireExportEvents(ref.getBundle(), exportRegistrations);
         }
         return exportRegistrations;
     }
 
-    /**
-     * @see org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteServiceAdmin#exportService(org.osgi.framework.ServiceReference,
-     *      java.util.Map)
-     */
-    public List<ExportRegistration> exportService(ServiceReference ref, Map properties) {
-        List<ExportRegistration> exportRegistrations = exporter.exportService(ref);
-        if (exportRegistrations != null) {
-            exportedServices.addAll(exportRegistrations);
+    private void fireExportEvents(Bundle source, List<ExportRegistration> exportRegistrations) {
+        for (ExportRegistration registration : exportRegistrations) {
+            RemoteServiceAdminEvent rsaEvent =
+                new RemoteServiceAdminEvent(RemoteServiceAdminEvent.EXPORT_REGISTRATION, source, registration,
+                                            registration.getException());
+            EventAdmin eventAdmin = getEventAdmin();
+            if (eventAdmin != null) {
+                eventAdmin.postEvent(wrap(rsaEvent));
+            }
+            for (Object listener : listeners.getServices()) {
+                RemoteServiceAdminListener rsaListener = (RemoteServiceAdminListener)listener;
+                rsaListener.remoteAdminEvent(rsaEvent);
+            }
+        }
+    }
+
+    private EventAdmin getEventAdmin() {
+        ServiceReference reference = context.getServiceReference(EventAdmin.class.getName());
+        if (reference == null) {
+            return null;
+        } else {
+            return (EventAdmin)context.getService(reference);
+        }
+    }
+
+    private Event wrap(RemoteServiceAdminEvent rsaEvent) {
+        int type = rsaEvent.getType();
+        String eventType = null;
+        switch (type) {
+            case RemoteServiceAdminEvent.EXPORT_ERROR:
+                eventType = "EXPORT_ERROR";
+                break;
+            case RemoteServiceAdminEvent.EXPORT_REGISTRATION:
+                eventType = "EXPORT_REGISTRATION";
+                break;
+            case RemoteServiceAdminEvent.EXPORT_UNREGISTRATION:
+                eventType = "EXPORT_UNREGISTRATION";
+                break;
+            case RemoteServiceAdminEvent.EXPORT_WARNING:
+                eventType = "EXPORT_WARNING";
+                break;
+            case RemoteServiceAdminEvent.IMPORT_ERROR:
+                eventType = "IMPORT_ERROR";
+                break;
+            case RemoteServiceAdminEvent.IMPORT_REGISTRATION:
+                eventType = "IMPORT_REGISTRATION";
+                break;
+            case RemoteServiceAdminEvent.IMPORT_UNREGISTRATION:
+                eventType = "EXPORT_ERROR";
+                break;
+            case RemoteServiceAdminEvent.IMPORT_WARNING:
+                eventType = "IMPORT_UNREGISTRATION";
+                break;
+        }
+        String topic = "org/osgi/service/remoteserviceadmin/" + eventType;
+        Map<String, Object> props = new HashMap<String, Object>();
+        /*
+         * <ul>
+        <li>bundle – (Bundle) The Remote Service Admin bundle
+        <li>bundle-id – (Long) The id of the Blueprint bundle.
+        <li>bundle-symbolicname – (String) The Bundle Symbolic Name of the
+        Remote Service Admin bundle.
+        <li>bundle-version - (Version) The version of the Blueprint bundle.
+        <li>cause – The exception, if present.
+        <li>import.registration – An imported endpoint, if present
+        <li>export.registration – An exported endpoint, if present
+        <li>service.remote.id – Remote service UUID, if present
+        <li>service.remote.uuid – Remote service UUID, if present
+        <li>service.remote.uri – (String) The URI of the endpoint, if present
+        <li>objectClass – (String[]) The interface names, if present
+        <li>service.imported.configs – (String+) The configuration types of the
+        imported services, if present
+        <li>timestamp – (Long) The time when the event occurred
+        <li>event – (RemoteServiceAdminEvent) The RemoteServiceAdminEvent
+        object that caused this event.
+        </ul>
+        */
+        Bundle rsaBundle = context.getBundle();
+        props.put("bundle", rsaBundle);
+        props.put("bundle-id", rsaBundle.getBundleId());
+        props.put("bundle-symbolicname", rsaBundle.getSymbolicName());
+        props.put("bundle-version", rsaBundle.getHeaders().get(Constants.BUNDLE_VERSION));
+        props.put("cause", rsaEvent.getException());
+        props.put("import.registration", rsaEvent.getImportRegistration());
+        props.put("export.registration", rsaEvent.getExportRegistration());
+        EndpointDescription ep = null;
+        if (rsaEvent.getImportRegistration() != null) {
+            ep = rsaEvent.getImportRegistration().getImportedEndpointDescription();
+        } else {
+            ep = rsaEvent.getExportRegistration().getEndpointDescription();
+        }
+        props.put("service.remote.id", ep.getRemoteServiceID());
+        props.put("service.remote.uuid", ep.getRemoteFrameworkUUID());
+        props.put("service.remote.uri", ep.getRemoteURI());
+        props.put("objectClass", ep.getInterfaces());
+        props.put("service.imported.configs", ep.getConfigurationTypes());
+        props.put("timestamp", new Long(System.currentTimeMillis()));
+        props.put("event", rsaEvent);
+        return new Event(topic, props);
+    }
+
+    private void fireImportEvents(Bundle source, ImportRegistration registration) {
+        RemoteServiceAdminEvent rsaEvent =
+            new RemoteServiceAdminEvent(RemoteServiceAdminEvent.IMPORT_REGISTRATION, source, registration, registration
+                .getException());
+        EventAdmin eventAdmin = getEventAdmin();
+        if (eventAdmin != null) {
+            eventAdmin.postEvent(wrap(rsaEvent));
+        }
+        for (Object listener : listeners.getServices()) {
+            RemoteServiceAdminListener rsaListener = (RemoteServiceAdminListener)listener;
+            rsaListener.remoteAdminEvent(rsaEvent);
         }
-        return exportRegistrations;
     }
 
     /**
-     * @see org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteServiceAdmin#getExportedServices()
+     * @see org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteServiceAdmin#getExportedServices()
      */
     public Collection<ExportRegistration> getExportedServices() {
         return exportedServices;
     }
 
     /**
-     * @see org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteServiceAdmin#getImportedEndpoints()
+     * @see org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteServiceAdmin#getImportedEndpoints()
      */
     public Collection<ImportRegistration> getImportedEndpoints() {
         return importedEndpoints;
     }
 
     /**
-     * @see org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteServiceAdmin#importService(org.apache.tuscany.sca.dosgi.discovery.EndpointDescription)
+     * @see org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteServiceAdmin#importService(org.apache.tuscany.sca.dosgi.discovery.EndpointDescription)
      */
     public ImportRegistration importService(EndpointDescription endpoint) {
-        Bundle bundle = (Bundle) endpoint.getProperties().get(Bundle.class.getName());
+        Bundle bundle = (Bundle)endpoint.getProperties().get(Bundle.class.getName());
         ImportRegistration importReg = importer.importService(bundle, endpoint);
         if (importReg != null) {
+            fireImportEvents(bundle, importReg);
             importedEndpoints.add(importReg);
         }
         return importReg;
     }
-
 }

Copied: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/TopologyManagerImpl.java (from r825940, tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/impl/RemoteControllerImpl.java)
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/TopologyManagerImpl.java?p2=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/TopologyManagerImpl.java&p1=tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/impl/RemoteControllerImpl.java&r1=825940&r2=826369&rev=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/remoteadmin/impl/RemoteControllerImpl.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/TopologyManagerImpl.java Sun Oct 18 07:24:02 2009
@@ -17,11 +17,11 @@
  * under the License.    
  */
 
-package org.apache.tuscany.sca.osgi.service.remoteadmin.impl;
+package org.apache.tuscany.sca.osgi.remoteserviceadmin.impl;
 
 import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_INTERFACES;
-import static org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteConstants.SERVICE_EXPORTED_CONFIGS;
-import static org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteConstants.SERVICE_IMPORTED;
+import static org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteConstants.SERVICE_EXPORTED_CONFIGS;
+import static org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteConstants.SERVICE_IMPORTED;
 
 import java.util.Collection;
 import java.util.Dictionary;
@@ -37,13 +37,13 @@
 
 import org.apache.tuscany.sca.common.java.collection.CollectionMap;
 import org.apache.tuscany.sca.core.LifeCycleListener;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointListener;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.ExportRegistration;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.ImportRegistration;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteServiceAdmin;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteServiceAdminEvent;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteServiceAdminListener;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointListener;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.ExportRegistration;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.ImportRegistration;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteServiceAdmin;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteServiceAdminEvent;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteServiceAdminListener;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -58,9 +58,9 @@
 /**
  * Implementation of Remote Controller
  */
-public class RemoteControllerImpl implements ListenerHook, RemoteServiceAdminListener, EndpointListener,
+public class TopologyManagerImpl implements ListenerHook, RemoteServiceAdminListener, EndpointListener,
     ServiceTrackerCustomizer, LifeCycleListener /*, EventHook */{
-    private final static Logger logger = Logger.getLogger(RemoteControllerImpl.class.getName());
+    private final static Logger logger = Logger.getLogger(TopologyManagerImpl.class.getName());
     public final static String ENDPOINT_LOCAL = "service.local";
 
     private BundleContext context;
@@ -81,7 +81,7 @@
 
     private Filter remotableServiceFilter;
 
-    public RemoteControllerImpl(BundleContext context) {
+    public TopologyManagerImpl(BundleContext context) {
         this.context = context;
     }
 
@@ -312,7 +312,7 @@
     }
 
     /**
-     * @see org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointListener#addEndpoint(org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription,
+     * @see org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointListener#addEndpoint(org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription,
      *      java.lang.String)
      */
     public void endpointAdded(EndpointDescription endpoint, String matchedFilter) {
@@ -320,7 +320,7 @@
     }
 
     /**
-     * @see org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointListener#removeEndpoint(org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription)
+     * @see org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointListener#removeEndpoint(org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription)
      */
     public void endpointRemoved(EndpointDescription endpoint, String matchedFilter) {
         unimportService(endpoint);

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/AbstractDiscoveryService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/AbstractDiscoveryService.java?rev=826369&r1=826368&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/AbstractDiscoveryService.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/AbstractDiscoveryService.java Sun Oct 18 07:24:02 2009
@@ -19,7 +19,7 @@
 
 package org.apache.tuscany.sca.osgi.service.discovery.impl;
 
-import static org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointListener.ENDPOINT_LISTENER_SCOPE;
+import static org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointListener.ENDPOINT_LISTENER_SCOPE;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -37,10 +37,10 @@
 import org.apache.tuscany.sca.core.LifeCycleListener;
 import org.apache.tuscany.sca.node.NodeFactory;
 import org.apache.tuscany.sca.node.impl.NodeFactoryImpl;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointListener;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteConstants;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.impl.OSGiHelper;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointListener;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteConstants;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.impl.OSGiHelper;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java?rev=826369&r1=826368&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/DomainDiscoveryService.java Sun Oct 18 07:24:02 2009
@@ -19,13 +19,13 @@
 
 package org.apache.tuscany.sca.osgi.service.discovery.impl;
 
-import static org.apache.tuscany.sca.osgi.service.remoteadmin.impl.EndpointHelper.createEndpointDescription;
+import static org.apache.tuscany.sca.osgi.remoteserviceadmin.impl.EndpointHelper.createEndpointDescription;
 
 import org.apache.tuscany.sca.assembly.Endpoint;
 import org.apache.tuscany.sca.assembly.Implementation;
 import org.apache.tuscany.sca.core.UtilityExtensionPoint;
 import org.apache.tuscany.sca.implementation.osgi.OSGiImplementation;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
 import org.apache.tuscany.sca.runtime.DomainRegistryFactory;
 import org.apache.tuscany.sca.runtime.EndpointListener;
 import org.osgi.framework.BundleContext;

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/LocalDiscoveryService.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/LocalDiscoveryService.java?rev=826369&r1=826368&r2=826369&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/LocalDiscoveryService.java (original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/service/discovery/impl/LocalDiscoveryService.java Sun Oct 18 07:24:02 2009
@@ -50,9 +50,9 @@
 import org.apache.tuscany.sca.implementation.osgi.ServiceDescriptions;
 import org.apache.tuscany.sca.monitor.Monitor;
 import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.EndpointDescription;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.RemoteConstants;
-import org.apache.tuscany.sca.osgi.service.remoteadmin.impl.EndpointHelper;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.EndpointDescription;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.RemoteConstants;
+import org.apache.tuscany.sca.osgi.remoteserviceadmin.impl.EndpointHelper;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleEvent;



Mime
View raw message