You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by da...@apache.org on 2010/01/05 12:12:24 UTC

svn commit: r895989 - in /cxf/dosgi/trunk/discovery/local: ./ src/main/java/org/apache/cxf/dosgi/discovery/local/ src/test/java/org/apache/cxf/dosgi/discovery/local/

Author: davidb
Date: Tue Jan  5 11:12:23 2010
New Revision: 895989

URL: http://svn.apache.org/viewvc?rev=895989&view=rev
Log: (empty)

Removed:
    cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java
    cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceEndpointDescriptionImpl.java
    cxf/dosgi/trunk/discovery/local/src/test/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryServiceTest.java
Modified:
    cxf/dosgi/trunk/discovery/local/pom.xml
    cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtils.java
    cxf/dosgi/trunk/discovery/local/src/test/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtilsTest.java

Modified: cxf/dosgi/trunk/discovery/local/pom.xml
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/local/pom.xml?rev=895989&r1=895988&r2=895989&view=diff
==============================================================================
--- cxf/dosgi/trunk/discovery/local/pom.xml (original)
+++ cxf/dosgi/trunk/discovery/local/pom.xml Tue Jan  5 11:12:23 2010
@@ -89,17 +89,10 @@
                         <Private-Package>org.apache.cxf.dosgi.discovery.local</Private-Package>
                         <Export-Package>
                             org.osgi.service.remoteserviceadmin;version="${remote.service.admin.interfaces.version}",
-                            org.osgi.service.discovery;version="1.0";-split-package:=merge-first
                         </Export-Package> 
                     </instructions>
                 </configuration>
             </plugin> 
         </plugins>
     </build>    
-    <!-- <bundle.import.package>*</bundle.import.package>
-        <bundle.export.package>
-          org.apache.cxf.dosgi.discovery.local.*;version="${pom.version}",
-          org.osgi.service.discovery;version="1.0";-split-package:=merge-first
-        </bundle.export.package> -->
-
 </project>

Modified: cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtils.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtils.java?rev=895989&r1=895988&r2=895989&view=diff
==============================================================================
--- cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtils.java (original)
+++ cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtils.java Tue Jan  5 11:12:23 2010
@@ -31,7 +31,6 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -43,8 +42,6 @@
 import org.jdom.output.XMLOutputter;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceEndpointDescription;
-import org.osgi.service.discovery.ServicePublication;
 import org.osgi.service.remoteserviceadmin.EndpointDescription;
 
 
@@ -77,33 +74,9 @@
     
     static boolean addEndpointID = true; // for testing
     
-    private LocalDiscoveryUtils() {
-    }
+    private LocalDiscoveryUtils() {}
     
     @SuppressWarnings("unchecked")
-    public static List<ServiceEndpointDescription> getAllRemoteReferences(Bundle b) {
-        List<Element> references = getAllDescriptionElements(b);
-        
-        List<ServiceEndpointDescription> srefs = new ArrayList<ServiceEndpointDescription>();
-        Namespace ns = Namespace.getNamespace(REMOTE_SERVICES_NS);
-        for (Element ref : references) {
-            List<String> iNames = getProvidedInterfaces(ref.getChildren(PROVIDE_INTERFACE_ELEMENT, ns));
-            Map<String, Object> remoteProps = getProperties(ref.getChildren(PROPERTY_ELEMENT, ns));
-            
-            // this property is used by discovery for matching
-            remoteProps.put(ServicePublication.SERVICE_INTERFACE_NAME, iNames); 
-            
-            if (addEndpointID) {
-                remoteProps.put(ServicePublication.ENDPOINT_ID, UUID.randomUUID().toString());
-            }
-            srefs.add(new ServiceEndpointDescriptionImpl(iNames, remoteProps));
-        }
-        return srefs;
-        
-    }
-    
-
-    @SuppressWarnings("unchecked")
     public static List<EndpointDescription> getAllEndpointDescriptions(Bundle b) {
         List<Element> elements = getAllDescriptionElements(b);
         
@@ -118,11 +91,11 @@
                 Map<String, Object> remoteProps = getProperties(el.getChildren(PROPERTY_ELEMENT, ns));
                 
                 // this property is used by discovery for matching
-                remoteProps.put(ServicePublication.SERVICE_INTERFACE_NAME, iNames); 
-                
-                if (addEndpointID) {
-                    remoteProps.put(ServicePublication.ENDPOINT_ID, UUID.randomUUID().toString());
-                }
+//                remoteProps.put(ServicePublication.SERVICE_INTERFACE_NAME, iNames); 
+//                
+//                if (addEndpointID) {
+//                    remoteProps.put(ServicePublication.ENDPOINT_ID, UUID.randomUUID().toString());
+//                }
                 // @@@@ TODO
                 // srefs.add(new ServiceEndpointDescriptionImpl(iNames, remoteProps));                
             }

Modified: cxf/dosgi/trunk/discovery/local/src/test/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/local/src/test/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtilsTest.java?rev=895989&r1=895988&r2=895989&view=diff
==============================================================================
--- cxf/dosgi/trunk/discovery/local/src/test/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtilsTest.java (original)
+++ cxf/dosgi/trunk/discovery/local/src/test/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryUtilsTest.java Tue Jan  5 11:12:23 2010
@@ -22,10 +22,8 @@
 import java.io.IOException;
 import java.net.URL;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Dictionary;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.List;
@@ -42,8 +40,6 @@
 import org.jdom.output.Format;
 import org.jdom.output.XMLOutputter;
 import org.osgi.framework.Bundle;
-import org.osgi.service.discovery.ServiceEndpointDescription;
-import org.osgi.service.discovery.ServicePublication;
 import org.osgi.service.remoteserviceadmin.EndpointDescription;
 
 public class LocalDiscoveryUtilsTest extends TestCase {
@@ -113,7 +109,7 @@
         assertEquals("SomeOtherService", rsElements.get(1).getChild("provide", ns).getAttributeValue("interface"));
     }
     
-    public void testAllRemoteReferences() {
+    /* public void testAllRemoteReferences() {
         URL rs1URL = getClass().getResource("/rs1.xml");
         
         Bundle b = EasyMock.createNiceMock(Bundle.class);
@@ -143,7 +139,7 @@
             new ServiceEndpointDescriptionImpl(interfaces2, sed2Props);
         assertTrue(seds.contains(sed1));
         assertTrue(seds.contains(sed2));
-    }
+    } 
 
     @SuppressWarnings("unchecked")
     private Map<Collection<String>, String> getEndpointIDs(
@@ -155,7 +151,7 @@
         }
         
         return map;
-    }
+    } */
     
     public void testEndpointDescriptionXMLFiles() {
         URL ed1URL = getClass().getResource("/ed1.xml");