cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r702927 [1/2] - in /cxf/sandbox/dosgi: discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ dsw/cxf-dsw/ dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/ dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ dsw/cxf...
Date Wed, 08 Oct 2008 16:52:53 GMT
Author: sergeyb
Date: Wed Oct  8 09:52:52 2008
New Revision: 702927

URL: http://svn.apache.org/viewvc?rev=702927&view=rev
Log:
DOSGI : updating to the latest Discovery and ServiceEndpointDescription interfaces

Added:
    cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceEndpointDescriptionImpl.java
      - copied, changed from r702392, cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceDescriptionImpl.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ServiceEndpointDescriptionImpl.java
      - copied, changed from r702392, cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ServiceDescriptionImpl.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java   (with props)
    cxf/sandbox/dosgi/felix/framework/src/main/java/org/osgi/service/discovery/ServiceEndpointDescription.java
      - copied, changed from r702392, cxf/sandbox/dosgi/felix/framework/src/main/java/org/osgi/service/discovery/ServiceDescription.java
Removed:
    cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceDescriptionImpl.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ServiceDescriptionImpl.java
    cxf/sandbox/dosgi/felix/framework/src/main/java/org/osgi/service/discovery/ServiceDescription.java
Modified:
    cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/pom.xml
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactory.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigurationTypeHandler.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractHook.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHook.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/EndpointInfo.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtils.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactoryTest.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandlerTest.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java
    cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtilsTest.java
    cxf/sandbox/dosgi/felix/framework/src/main/java/org/osgi/service/discovery/Discovery.java
    cxf/sandbox/dosgi/felix/framework/src/main/java/org/osgi/service/discovery/FindServiceCallback.java
    cxf/sandbox/dosgi/felix/framework/src/main/java/org/osgi/service/discovery/ServiceListener.java
    cxf/sandbox/dosgi/systests/pom.xml

Modified: cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java (original)
+++ cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java Wed Oct  8 09:52:52 2008
@@ -47,7 +47,7 @@
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.discovery.Discovery;
 import org.osgi.service.discovery.FindServiceCallback;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 import org.osgi.service.discovery.ServiceListener;
 
 public class LocalDiscoveryService implements Discovery {
@@ -76,8 +76,8 @@
     
     // this is effectively a set which allows for multiple service descriptions with the
     // same interface name but different properties and takes care of itself with respect to concurrency 
-    private ConcurrentHashMap<ServiceDescription, ServiceDescription> servicesInfo = 
-        new ConcurrentHashMap<ServiceDescription, ServiceDescription>();
+    private ConcurrentHashMap<ServiceEndpointDescription, ServiceEndpointDescription> servicesInfo = 
+        new ConcurrentHashMap<ServiceEndpointDescription, ServiceEndpointDescription>();
     private ConcurrentHashMap<ServiceListener, Filter> listeners = 
         new ConcurrentHashMap<ServiceListener, Filter>();
     private BundleContext bc;
@@ -103,10 +103,6 @@
     public void updateProperties(Dictionary props) {
     }
     
-    public void addServiceListener(ServiceListener sl, ServiceDescription sd) {
-        addServiceListener(sl, createFilterExpression(sd));
-    }
-
     public void addServiceListener(ServiceListener sl, String filter) {
         listeners.put(sl, createFilter(filter));
     }
@@ -119,53 +115,42 @@
         listeners.remove(sl);
     }
     
-    public boolean isCached(ServiceDescription sd) {
-        return servicesInfo.containsKey(sd);
-    }
-    
-    public Collection getCachedServiceDescriptions() {
-        return Collections.unmodifiableCollection(servicesInfo.values());
-    } 
-    
-    public Collection<ServiceDescription> findService(ServiceDescription sDesc) {
-        return findService(createFilterExpression(sDesc));
+    public ServiceEndpointDescription[] findService(String interfaceName, String filter) {
+        Collection<ServiceEndpointDescription> sds =
+            findServiceWithFilter(interfaceName, createFilter(filter));
+        return sds.toArray(new ServiceEndpointDescription[]{});
+        
     }
     
-    @SuppressWarnings("unchecked")
-    public Collection<ServiceDescription> findService(String filter) {
-        return findServiceWithFilter(createFilter(filter));
+    public void findService(String interfaceName, String filter, FindServiceCallback listener) {
+        Filter f = createFilter(filter); 
+        if (f != null) {
+            doFindService(interfaceName, f, listener);
+        }
     }
     
     @SuppressWarnings("unchecked")
-    public Collection<ServiceDescription> findServiceWithFilter(Filter f) {
+    private Collection<ServiceEndpointDescription> findServiceWithFilter(
+        String interfaceName, Filter f) {
         if (f == null) {
             return Collections.emptyList();    
         }
         
-        List<ServiceDescription> sds = new ArrayList<ServiceDescription>();
+        List<ServiceEndpointDescription> sds = new ArrayList<ServiceEndpointDescription>();
         
-        for (ServiceDescription sd : servicesInfo.values()) {
-            if (f.match(getServiceProperties(sd))) {
+        for (ServiceEndpointDescription sd : servicesInfo.values()) {
+            if (f.match(getServiceProperties(interfaceName, sd))) {
                 sds.add(sd);
             }
         }
         return sds;
     }
     
-    public void findService(String filter, FindServiceCallback listener) {
-        Filter f = createFilter(filter); 
-        if (f != null) {
-            doFindService(f, listener);
-        }
-    }
-    
-    public void findService(ServiceDescription sdesc, FindServiceCallback listener) {
-        findService(createFilterExpression(sdesc), listener);        
-    }
     
-    private void doFindService(final Filter f, final FindServiceCallback listener) {
+    private void doFindService(final String interfaceName, final Filter f, 
+                               final FindServiceCallback listener) {
         if (attachedToBundle) {
-            checkServices(f, listener);
+            checkServices(interfaceName, f, listener);
             return;
         }
         
@@ -181,42 +166,43 @@
         asyncChecks.add(new Callable<Boolean>() {
 
             public Boolean call() throws Exception {
-                return checkServices(f, listener); 
+                return checkServices(interfaceName, f, listener); 
             }
             
         });
     }
     
-    private boolean checkServices(Filter f, FindServiceCallback listener) {
-        Collection<ServiceDescription> sds = findServiceWithFilter(f);
+    private boolean checkServices(String interfaceName, Filter f, FindServiceCallback listener) {
+        Collection<ServiceEndpointDescription> sds = 
+            findServiceWithFilter(interfaceName, f);
         if (sds.isEmpty()) {
             return false;
         } else {
-            listener.servicesFound(sds);
+            listener.servicesFound(sds.toArray(new ServiceEndpointDescription[]{}));
             return true;
         }
     }
     
-    public boolean publishService(ServiceDescription sd) {
+    public boolean publishService(ServiceEndpointDescription sd) {
         return publishService(sd, false);
     }
     
-    public boolean publishService(ServiceDescription sd, boolean autoPublish) {
+    public boolean publishService(ServiceEndpointDescription sd, boolean autoPublish) {
         servicesInfo.putIfAbsent(sd, sd);
         for (Map.Entry<ServiceListener, Filter> entry : listeners.entrySet()) {
             if (entry.getValue() == null 
-                || entry.getValue().match(getServiceProperties(sd))) {
+                || entry.getValue().match(getServiceProperties(null, sd))) {
                 entry.getKey().serviceAvailable(sd);
             }
         }
         return true;
     }
     
-    public void unpublishService(ServiceDescription sd) {
+    public void unpublishService(ServiceEndpointDescription sd) {
         servicesInfo.remove(sd);
         for (Map.Entry<ServiceListener, Filter> entry : listeners.entrySet()) {
             if (entry.getValue() == null 
-                || entry.getValue().match(getServiceProperties(sd))) {
+                || entry.getValue().match(getServiceProperties(null, sd))) {
                 entry.getKey().serviceUnavailable(sd);
             }
         }
@@ -293,7 +279,7 @@
                 continue;
             }
             
-            ServiceDescription sd = new ServiceDescriptionImpl(iNames,  
+            ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(iNames,  
                           getProperties(ref.getChildren(PROPERTY_ELEMENT, ns)));
             servicesInfo.putIfAbsent(sd, sd);
         }
@@ -400,20 +386,6 @@
         
     }
     
-    
-    private static String createFilterExpression(ServiceDescription sd) {
-        
-        StringBuilder f = new StringBuilder();
-        f.append('(').append(Constants.OBJECTCLASS).append('=').append(sd.getInterfaceName()).append(')');
-        for (Object key : sd.getPropertyKeys()) {
-            f.append("&&");
-            f.append('(').append(key.toString()).append('=')
-             .append(sd.getProperty(key.toString())).append(')');
-        }
-        return f.toString();
-        
-    }
-    
     private Filter createFilter(String filterValue) {
         
         if (filterValue == null) {
@@ -431,11 +403,27 @@
     }
 
     @SuppressWarnings("unchecked")
-    private Dictionary<String, Object> getServiceProperties(ServiceDescription sd) {
+    private Dictionary<String, Object> getServiceProperties(String interfaceName,
+                                                            ServiceEndpointDescription sd) {
         Dictionary<String, Object> d = new Hashtable<String, Object>(sd.getProperties());
-        d.put(Constants.OBJECTCLASS, new String[]{sd.getInterfaceName()});
+        d.put(Constants.OBJECTCLASS, getInterfaceNames(sd, interfaceName));
         return d;
     }
     
+    private static String[] getInterfaceNames(ServiceEndpointDescription sd, String interfaceName) {
+        
+        String[] interfaceNames = sd.getInterfaceNames();
+        if (interfaceName == null) {
+            return interfaceNames;
+        }
+        
+        for (String s : interfaceNames) {
+            if (s.equals(interfaceName)) {
+                return new String[]{s};
+            }
+        }
+        return null;
+    }
+    
 }
     

Copied: cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceEndpointDescriptionImpl.java (from r702392, cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceDescriptionImpl.java)
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceEndpointDescriptionImpl.java?p2=cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceEndpointDescriptionImpl.java&p1=cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceDescriptionImpl.java&r1=702392&r2=702927&rev=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceDescriptionImpl.java (original)
+++ cxf/sandbox/dosgi/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/ServiceEndpointDescriptionImpl.java Wed Oct  8 09:52:52 2008
@@ -18,47 +18,39 @@
   */
 package org.apache.cxf.dosgi.discovery.local;
 
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.logging.Logger;
 
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
-public class ServiceDescriptionImpl implements ServiceDescription {
+public class ServiceEndpointDescriptionImpl implements ServiceEndpointDescription {
 
-    private List<String> interfaceNames; 
+    private static final Logger LOG = 
+        Logger.getLogger(ServiceEndpointDescriptionImpl.class.getName());
+    
+    private Set<String> interfaceNames; 
     private Map<String, Object> properties;
     
     @SuppressWarnings("unchecked")
-    public ServiceDescriptionImpl(String interfaceName) {
+    public ServiceEndpointDescriptionImpl(String interfaceName) {
         this(Collections.singletonList(interfaceName), Collections.EMPTY_MAP);
     }
     
     @SuppressWarnings("unchecked")
-    public ServiceDescriptionImpl(List<String> interfaceNames) {
+    public ServiceEndpointDescriptionImpl(List<String> interfaceNames) {
         this(interfaceNames, Collections.EMPTY_MAP);
     }
     
-    public ServiceDescriptionImpl(List<String> interfaceNames,
-                                  Dictionary userProperties) {
-        this.interfaceNames = interfaceNames;
-        properties = new HashMap<String, Object>();
-        if (userProperties != null) {
-            for (Enumeration keys = userProperties.keys(); keys.hasMoreElements();) {
-                Object key = keys.nextElement();
-                properties.put(key.toString(), userProperties.get(key));
-            }
-        }
-    }
-    
-    public ServiceDescriptionImpl(List<String> interfaceNames,
+    public ServiceEndpointDescriptionImpl(List<String> interfaceNames,
                                   Map<String, Object> remoteProperties) {
-        this.interfaceNames = interfaceNames;
+        this.interfaceNames = new HashSet<String>(interfaceNames);
         properties = remoteProperties;
     }
     
@@ -77,33 +69,45 @@
     
     @Override
     public int hashCode() {
-        return interfaceNames.get(0).hashCode() + 37 * properties.hashCode();
+        return interfaceNames.hashCode() + 37 * properties.hashCode();
     }
     
     @Override
     public boolean equals(Object obj) {
-        if (!(obj instanceof ServiceDescription)) {
+        if (!(obj instanceof ServiceEndpointDescription)) {
             return false;
         }
-        ServiceDescription other = (ServiceDescription)obj;
+        ServiceEndpointDescription other = (ServiceEndpointDescription)obj;
         
-        return interfaceNames.get(0).equals(other.getInterfaceName())
+        return interfaceNames.equals(other.getInterfaceNames())
                && properties.equals(other.getProperties());
     }
 
-    public String getInterfaceName() {
-        return interfaceNames.get(0);
-    }
-
     public URL getLocation() {
+        Object value = properties.get(ServiceEndpointDescription.PROP_KEY_SERVICE_LOCATION);
+        if (value == null) {
+            return null;
+        }
+        
+        try {
+            return new URL(value.toString());
+        } catch (MalformedURLException ex) {
+            LOG.warning("Service document URL is malformed : " + value.toString());
+        }
+        
         return null;
     }
 
-    public String getProtocolSpecificInterfaceName() {
-        return null;
+    public String[] getInterfaceNames() {
+        return interfaceNames.toArray(new String[]{});
+    }
+
+    public String getProtocolSpecificInterfaceName(String interfaceName) {
+        return interfaceName;
     }
 
-    public String getVersion() {
+    public String getVersion(String interfaceName) {
+        // TODO Auto-generated method stub
         return null;
     }
 }

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/pom.xml?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/pom.xml (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/pom.xml Wed Oct  8 09:52:52 2008
@@ -88,7 +88,19 @@
                         <DynamicImport-Package>*</DynamicImport-Package>
                     </instructions>
                 </configuration>
-            </plugin> 
+          </plugin> 
+
+          <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-surefire-plugin</artifactId>
+              <configuration>
+                 <excludes>
+                    <exclude>**/TestUtils*</exclude>
+                 </excludes>
+              </configuration>
+          </plugin>
+
+
          </plugins>
     </build>    
 

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Activator.java Wed Oct  8 09:52:52 2008
@@ -47,10 +47,10 @@
 public class Activator implements BundleActivator, ServiceListener, ManagedService {
 
     private static final String CONFIG_SERVICE_PID = "cxf-dsw";
-    
+    private BundleContext bc;    
+
     private CxfPublishHook pHook;
     private CxfListenerHook lHook;
-    private volatile BundleContext bc;
     private ExecutorService execService = 
         new ThreadPoolExecutor(5, 10, 50, TimeUnit.SECONDS, 
                                new LinkedBlockingQueue<Runnable>());

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/OsgiUtils.java Wed Oct  8 09:52:52 2008
@@ -33,7 +33,7 @@
 import java.util.logging.Logger;
 
 import org.apache.cxf.dosgi.dsw.qos.IntentMap;
-import org.apache.cxf.dosgi.dsw.service.ServiceDescriptionImpl;
+import org.apache.cxf.dosgi.dsw.service.ServiceEndpointDescriptionImpl;
 import org.jdom.Document;
 import org.jdom.Element;
 import org.jdom.Namespace;
@@ -43,7 +43,7 @@
 import org.osgi.framework.Filter;
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
 
 
@@ -71,7 +71,7 @@
 
     
     // Used by PublishHook 
-    public static ServiceDescription getRemoteReference(ServiceReference sref, boolean matchAllNames) {
+    public static ServiceEndpointDescription getRemoteReference(ServiceReference sref, boolean matchAllNames) {
         
         String[] names = (String[])sref.getProperty(org.osgi.framework.Constants.OBJECTCLASS);
         if (names == null || names.length == 0) {
@@ -85,25 +85,25 @@
                 userProperties.put(key, sref.getProperty(key));
             }
         }
-        List<ServiceDescription> srefs = getRemoteReferences(sref.getBundle(), 
+        List<ServiceEndpointDescription> srefs = getRemoteReferences(sref.getBundle(), 
                                                              names, 
                                                              userProperties,
                                                              matchAllNames);
         
         if (srefs.isEmpty()) {
-            return new ServiceDescriptionImpl(Arrays.asList(names), userProperties);
+            return new ServiceEndpointDescriptionImpl(Arrays.asList(names), userProperties);
         }
         
         return srefs.get(0); 
     }
     
     @SuppressWarnings("unchecked")
-    public static List<ServiceDescription> getRemoteReferences(
+    public static List<ServiceEndpointDescription> getRemoteReferences(
         Bundle b, String[] names, Map<String, Object> userProperties, boolean matchAllNames) {
         
         List<Element> references = getAllReferenceElements(b);
         
-        List<ServiceDescription> srefs = new ArrayList<ServiceDescription>();
+        List<ServiceEndpointDescription> srefs = new ArrayList<ServiceEndpointDescription>();
         Namespace ns = Namespace.getNamespace(REMOTE_SERVICES_NS);
         for (Element ref : references) {
             List<String> iNames = getInterfaceNames(ref.getChildren(PROVIDE_INTERFACE_ELEMENT, ns));
@@ -113,7 +113,7 @@
 
             Map<String, Object> remoteProps = getProperties(ref.getChildren(PROPERTY_ELEMENT, ns));
             remoteProps.putAll(userProperties);
-            srefs.add(new ServiceDescriptionImpl(iNames, remoteProps));
+            srefs.add(new ServiceEndpointDescriptionImpl(iNames, remoteProps));
             
         }
         return srefs;
@@ -121,16 +121,16 @@
     }
     
     @SuppressWarnings("unchecked")
-    public static List<ServiceDescription> getAllRemoteReferences(Bundle b) {
+    public static List<ServiceEndpointDescription> getAllRemoteReferences(Bundle b) {
         
         List<Element> references = getAllReferenceElements(b);
         
-        List<ServiceDescription> srefs = new ArrayList<ServiceDescription>();
+        List<ServiceEndpointDescription> srefs = new ArrayList<ServiceEndpointDescription>();
         Namespace ns = Namespace.getNamespace(REMOTE_SERVICES_NS);
         for (Element ref : references) {
             List<String> iNames = getInterfaceNames(ref.getChildren(PROVIDE_INTERFACE_ELEMENT, ns));
             Map<String, Object> remoteProps = getProperties(ref.getChildren(PROPERTY_ELEMENT, ns));
-            srefs.add(new ServiceDescriptionImpl(iNames, remoteProps));
+            srefs.add(new ServiceEndpointDescriptionImpl(iNames, remoteProps));
         }
         return srefs;
         
@@ -176,31 +176,48 @@
     }
     
     // TODO : consider creating a new List rather than modifyiing the existing one
-    public static void matchServiceDescriptions(List<ServiceDescription> sds,
+    public static void matchServiceDescriptions(List<ServiceEndpointDescription> sds,
+                                                String interfaceName,
                                                 Filter filter, 
                                                 boolean matchAll) {
         
-        for (Iterator<ServiceDescription> it = sds.iterator(); it.hasNext();) {
-            ServiceDescription sd = it.next();
+        for (Iterator<ServiceEndpointDescription> it = sds.iterator(); it.hasNext();) {
+            ServiceEndpointDescription sd = it.next();
              
-            if (filter != null && !OsgiUtils.matchAgainstFilter(sd, filter, matchAll)) {
+            if (filter != null && !OsgiUtils.matchAgainstFilter(sd, interfaceName, filter, matchAll)) {
                 it.remove();
             }
         }
     }
     
     @SuppressWarnings("unchecked")
-    public static boolean matchAgainstFilter(ServiceDescription sd, Filter filter, boolean matchAll) {
+    public static boolean matchAgainstFilter(ServiceEndpointDescription sd, 
+        String interfaceName, Filter filter, boolean matchAll) {
         Dictionary props = new Hashtable();
         for (Object key : sd.getPropertyKeys()) {
             if (matchAll || key.toString().startsWith(Constants.REMOTE_PROPERTY_PREFIX)) {
                 props.put(key, sd.getProperty(key.toString()));
             }
         }
-        props.put(org.osgi.framework.Constants.OBJECTCLASS, 
-                  new String[]{sd.getInterfaceName()});
+        props.put(org.osgi.framework.Constants.OBJECTCLASS,
+                  getInterfaceNames(sd, interfaceName));
         return filter.match(props);
     }
+
+    public static String[] getInterfaceNames(ServiceEndpointDescription sd, String interfaceName) {
+        
+        String[] interfaceNames = sd.getInterfaceNames();
+        if (interfaceName == null) {
+            return interfaceNames;
+        }
+        
+        for (String s : interfaceNames) {
+            if (s.equals(interfaceName)) {
+                return new String[]{s};
+            }
+        }
+        return null;
+    }
     
     public static Filter createFilter(BundleContext bc, String filterValue) {
         
@@ -340,7 +357,7 @@
     
     // TODO : move these property helpers into PropertyUtils ?
     
-    public static boolean getBooleanProperty(ServiceDescription sd, String name) {
+    public static boolean getBooleanProperty(ServiceEndpointDescription sd, String name) {
         Object value = sd.getProperty(name);
         return toBoolean(value);
     }
@@ -350,12 +367,12 @@
             || value instanceof String && Boolean.parseBoolean((String)value);
     }
     
-    public static String getProperty(ServiceDescription sd, String name) { 
+    public static String getProperty(ServiceEndpointDescription sd, String name) { 
         return getProperty(sd, name, String.class, null); 
     }
     
     @SuppressWarnings("unchecked")
-    public static <T> T getProperty(ServiceDescription sd, String name, Class<T> type,
+    public static <T> T getProperty(ServiceEndpointDescription sd, String name, Class<T> type,
                              T defaultValue) { 
         Object o = sd.getProperty(name);
         if (o == null) {

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactory.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactory.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactory.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactory.java Wed Oct  8 09:52:52 2008
@@ -25,7 +25,7 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public class ClientServiceFactory implements ServiceFactory {
 
@@ -34,11 +34,11 @@
 
     private BundleContext dswContext;
     private Class<?> iClass;    
-    private ServiceDescription sd;
+    private ServiceEndpointDescription sd;
     private ConfigurationTypeHandler handler;
     
     public ClientServiceFactory(BundleContext dswContext, Class<?> iClass,
-                                ServiceDescription sd, ConfigurationTypeHandler handler) {
+                                ServiceEndpointDescription sd, ConfigurationTypeHandler handler) {
         this.dswContext = dswContext;
         this.iClass = iClass;
         this.sd = sd;
@@ -53,12 +53,12 @@
                                        iClass,
                                        sd);
         } catch (IntentUnsatifiedException iue) {
-            LOG.info("Did not create proxy for " + sd.getInterfaceName() + " because intent " +
+            LOG.info("Did not create proxy for " + sd.getInterfaceNames()[0] + " because intent " +
                     iue.getIntent() + " could not be satisfied");
         } catch (Exception ex) {
             LOG.log(Level.WARNING,
                     "Problem creating a remote proxy for " 
-                    + sd.getInterfaceName() + " from CXF FindHook: ", 
+                    + sd.getInterfaceNames()[0] + " from CXF FindHook: ", 
                     ex);
         }
         

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactory.java Wed Oct  8 09:52:52 2008
@@ -24,7 +24,7 @@
 import org.apache.cxf.dosgi.dsw.Constants;
 import org.apache.cxf.dosgi.dsw.OsgiUtils;
 import org.apache.cxf.dosgi.dsw.service.CxfDistributionProvider;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public final class ConfigTypeHandlerFactory {
     
@@ -39,7 +39,7 @@
         return FACTORY;
     }
     
-    public ConfigurationTypeHandler getHandler(ServiceDescription sd, 
+    public ConfigurationTypeHandler getHandler(ServiceEndpointDescription sd, 
                                                CxfDistributionProvider dp,
                                                Map<String, Object> handlerProperties) {
         String type = OsgiUtils.getProperty(sd, Constants.CONFIG_TYPE_PROPERTY);

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigurationTypeHandler.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigurationTypeHandler.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ConfigurationTypeHandler.java Wed Oct  8 09:52:52 2008
@@ -21,18 +21,18 @@
 import org.apache.cxf.endpoint.Server;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public interface ConfigurationTypeHandler {
     Server createServer(ServiceReference serviceReference,
                         BundleContext dswContext,
                         BundleContext callingContext, 
-                        ServiceDescription sd, 
+                        ServiceEndpointDescription sd, 
                         Class<?> iClass, 
                         Object serviceBean);
 
     Object createProxy(ServiceReference serviceReference,
                        BundleContext dswContext,
                        BundleContext callingContext,
-                       Class<?> iClass, ServiceDescription sd);
+                       Class<?> iClass, ServiceEndpointDescription sd);
 }

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java Wed Oct  8 09:52:52 2008
@@ -38,7 +38,7 @@
 import org.apache.cxf.frontend.ServerFactoryBean;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public class PojoConfigurationTypeHandler extends AbstractConfigurationHandler {
     private static final Logger LOG = Logger.getLogger(PojoConfigurationTypeHandler.class.getName());
@@ -63,7 +63,7 @@
     public Object createProxy(ServiceReference serviceReference,
                               BundleContext dswContext,
                               BundleContext callingContext,
-                              Class<?> iClass, ServiceDescription sd) 
+                              Class<?> iClass, ServiceEndpointDescription sd) 
                               throws IntentUnsatifiedException {
         
         
@@ -73,7 +73,7 @@
             return null;
         }
         
-        LOG.info("Creating a " + sd.getInterfaceName() + " client, endpoint address is "
+        LOG.info("Creating a " + sd.getInterfaceNames()[0] + " client, endpoint address is "
                  + address);
 
 
@@ -101,7 +101,7 @@
     public Server createServer(ServiceReference serviceReference,
                                BundleContext dswContext,
                                BundleContext callingContext, 
-                               ServiceDescription sd, 
+                               ServiceEndpointDescription sd, 
                                Class<?> iClass,
                                Object serviceBean) throws IntentUnsatifiedException {        
         String address = getPojoAddress(sd, iClass);
@@ -110,7 +110,7 @@
             return null;
         }
         
-        LOG.info("Creating a " + sd.getInterfaceName()
+        LOG.info("Creating a " + sd.getInterfaceNames()[0]
             + " endpoint from CXF PublishHook, address is " + address);
         
         ServerFactoryBean factory = createServerFactoryBean();
@@ -144,7 +144,7 @@
                            BundleContext callingContext,
                            List<AbstractFeature> features,
                            AbstractEndpointFactory factory,
-                           ServiceDescription sd) throws IntentUnsatifiedException {
+                           ServiceEndpointDescription sd) throws IntentUnsatifiedException {
         String[] requestedIntents = getRequestedIntents(sd);
         
         IntentMap intentMap = getIntentMap(callingContext);
@@ -182,7 +182,7 @@
         return OsgiUtils.getIntentMap(callingContext);
     }
 
-    private static String[] getRequestedIntents(ServiceDescription sd) {
+    private static String[] getRequestedIntents(ServiceEndpointDescription sd) {
         String property = 
             OsgiUtils.getProperty(sd, Constants.REQUIRES_INTENTS_PROPERTY);
         String[] intents = OsgiUtils.parseIntents(property);
@@ -214,7 +214,7 @@
         return intentMap;
     }
     
-    private String getPojoAddress(ServiceDescription sd, Class<?> iClass) {
+    private String getPojoAddress(ServiceEndpointDescription sd, Class<?> iClass) {
         String address = OsgiUtils.getProperty(sd, Constants.POJO_ADDRESS_PROPERTY);
         if (address == null) {
             address = getDefaultAddress(iClass);

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java Wed Oct  8 09:52:52 2008
@@ -33,7 +33,7 @@
 import org.apache.cxf.endpoint.Server;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public class WsdlConfigurationTypeHandler extends AbstractConfigurationHandler {
 
@@ -48,7 +48,7 @@
                               BundleContext dswContext,
                               BundleContext callingContext,
                               Class<?> iClass, 
-                              ServiceDescription sd) {
+                              ServiceEndpointDescription sd) {
         
         String wsdlAddressProp = getWsdlAddress(sd, iClass);
         if (wsdlAddressProp == null) {
@@ -64,7 +64,7 @@
             return null;
         }
         
-        LOG.info("Creating a " + sd.getInterfaceName() + " client, wsdl address is "
+        LOG.info("Creating a " + sd.getInterfaceNames()[0] + " client, wsdl address is "
                  + OsgiUtils.getProperty(sd, Constants.WSDL_CONFIG_PREFIX));
         
         String serviceNs = OsgiUtils.getProperty(sd, Constants.SERVICE_NAMESPACE);
@@ -88,7 +88,7 @@
     public Server createServer(ServiceReference sr,
                                BundleContext dswContext,
                                BundleContext callingContext,
-                               ServiceDescription sd, 
+                               ServiceEndpointDescription sd, 
                                Class<?> iClass, 
                                Object serviceBean) {
         
@@ -96,7 +96,7 @@
                   + " creating service endpoints");
     }
     
-    private String getWsdlAddress(ServiceDescription sd, Class<?> iClass) {
+    private String getWsdlAddress(ServiceEndpointDescription sd, Class<?> iClass) {
         String address = OsgiUtils.getProperty(sd, Constants.WSDL_CONFIG_PREFIX);
         if (address == null) {
             address = getDefaultAddress(iClass);

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractClientHook.java Wed Oct  8 09:52:52 2008
@@ -34,7 +34,7 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public class AbstractClientHook extends AbstractHook {
     
@@ -44,16 +44,16 @@
         super(bc, dp);
     }
     
-    protected List<ServiceDescription> processClientDescriptions(BundleContext requestingContext, 
-                                                            String className, 
+    protected List<ServiceEndpointDescription> processClientDescriptions(BundleContext requestingContext, 
+                                                            String interfaceName, 
                                                             String filter, 
                                                             boolean matchAll, 
                                                             boolean allServices) {
-        List<ServiceDescription> sds = 
-            getServiceDescriptions(requestingContext, className, filter, false);
-        List<ServiceDescription> actualSds = new ArrayList<ServiceDescription>(sds.size()); 
+        List<ServiceEndpointDescription> sds = 
+            getServiceDescriptions(requestingContext, interfaceName, filter, false);
+        List<ServiceEndpointDescription> actualSds = new ArrayList<ServiceEndpointDescription>(sds.size()); 
         
-        for (ServiceDescription sd  : sds) {
+        for (ServiceEndpointDescription sd  : sds) {
             
             
             if (!OsgiUtils.getBooleanProperty(sd, Constants.REMOTE_INTERFACES_PROPERTY)) {
@@ -67,13 +67,13 @@
             }
             
             try {
-                Class<?> iClass = getContext().getBundle().loadClass(className);
+                Class<?> iClass = getContext().getBundle().loadClass(interfaceName);
                 if (iClass != null) {
                     BundleContext actualContext = getContext();
                     if (!allServices) {
-                        Class<?> actualClass = requestingContext.getBundle().loadClass(className);
+                        Class<?> actualClass = requestingContext.getBundle().loadClass(interfaceName);
                         if (actualClass != iClass) {
-                            LOG.info("Class " + className + " loaded by DSW's bundle context is not "
+                            LOG.info("Class " + interfaceName + " loaded by DSW's bundle context is not "
                                      + "equal to the one loaded by the requesting bundle context, "
                                      + "DSW will use the requesting bundle context to register "
                                      + "a proxy service");
@@ -82,14 +82,14 @@
                         }
                     }
                     synchronized(this) {
-                        ServiceReference sref = actualContext.getServiceReference(sd.getInterfaceName());
+                        ServiceReference sref = actualContext.getServiceReference(interfaceName);
                         if (sref == null || sref.getProperty(Constants.DSW_CLIENT_ID) == null) {
                             
                             // at least we won't register the factory for the same interface/filter
                             // combination twice - ListenerHook.added() and 
                             // ListenerHook.serviceReferencesRequested() may get called at the same time
                             
-                            actualContext.registerService(new String[]{sd.getInterfaceName()},
+                            actualContext.registerService(new String[]{interfaceName},
                                       new ClientServiceFactory(actualContext, iClass, sd, handler),
                                       new Hashtable<String, Object>(getProperties(sd)));
                         }
@@ -98,7 +98,7 @@
                     actualSds.add(sd);
                 }
             } catch (ClassNotFoundException ex) {
-                LOG.warning("No class can be found for " + sd.getInterfaceName());
+                LOG.warning("No class can be found for " + interfaceName);
                 continue;
             }
         }
@@ -106,7 +106,7 @@
     }
     
     @SuppressWarnings("unchecked")
-    protected Map<String, Object> getProperties(ServiceDescription sd) {
+    protected Map<String, Object> getProperties(ServiceEndpointDescription sd) {
         Map<String, Object> props = new HashMap<String, Object>();        
         props.putAll(sd.getProperties());
         props.put(Constants.DSW_CLIENT_ID, getIdentificationProperty());
@@ -114,15 +114,15 @@
     }
     
     @SuppressWarnings("unchecked")
-    protected List<ServiceDescription> getServiceDescriptions(
-        BundleContext context, String className, String filterValue, 
+    protected List<ServiceEndpointDescription> getServiceDescriptions(
+        BundleContext context, String interfaceName, String filterValue, 
         boolean matchAll) {
         
         // if bundle has remote-services.xml attached then those metadata takes precedence
-        List<ServiceDescription> sds = new ArrayList<ServiceDescription>();
+        List<ServiceEndpointDescription> sds = new ArrayList<ServiceEndpointDescription>();
         if (checkBundle()) {
             sds.addAll(OsgiUtils.getRemoteReferences(context.getBundle(), 
-                                                     new String[]{className}, 
+                                                     new String[]{interfaceName}, 
                                                      Collections.EMPTY_MAP, 
                                                      false));
         }
@@ -130,12 +130,14 @@
         // found some SDs as it may find more suitable SDs ?
         if (sds.isEmpty()) {
             // try discovery service
-            sds.addAll(getFromDiscoveryService(className));
+            sds.addAll(getFromDiscoveryService(interfaceName, filterValue));
         }
         
+        // do it just in case too for the moment
+        
         Filter filter = OsgiUtils.createFilter(context, filterValue);
         if (filter != null) {
-            OsgiUtils.matchServiceDescriptions(sds, filter, true);
+            OsgiUtils.matchServiceDescriptions(sds, interfaceName, filter, true);
         }
         
         return sds;

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractHook.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractHook.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractHook.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/AbstractHook.java Wed Oct  8 09:52:52 2008
@@ -18,6 +18,7 @@
   */
 package org.apache.cxf.dosgi.dsw.hooks;
 
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Dictionary;
@@ -28,11 +29,10 @@
 import org.apache.cxf.dosgi.dsw.OsgiService;
 import org.apache.cxf.dosgi.dsw.OsgiUtils;
 import org.apache.cxf.dosgi.dsw.service.CxfDistributionProvider;
-import org.apache.cxf.dosgi.dsw.service.ServiceDescriptionImpl;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.discovery.Discovery;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public abstract class AbstractHook {
     private final CxfDistributionProvider distributionProvider;
@@ -88,7 +88,8 @@
     }
     
     @SuppressWarnings("unchecked")
-    protected Collection<ServiceDescription> getFromDiscoveryService(String className) {
+    protected Collection<ServiceEndpointDescription> getFromDiscoveryService(
+        String interfaceName, String filterValue) {
        
         // not clear what to do about allServices parameter, according to docs its purpose
         // is to indicate that the call originated from BundleContext.getAllReferences()
@@ -99,13 +100,17 @@
         OsgiService<Discovery> pair = OsgiUtils.getOsgiService(getContext(), Discovery.class);
         if (pair != null) {
             try {
-                return pair.getService().findService(new ServiceDescriptionImpl(className));
+                ServiceEndpointDescription[] sds =
+                    pair.getService().findService(interfaceName, filterValue);
+                if (sds != null) {
+                    return Arrays.asList(sds);
+                }
             } finally {
                 pair.ungetService(getContext());
             }
         }
        
-        return Collections.EMPTY_LIST;
+        return Collections.emptyList();
     }
     
     protected String getIdentificationProperty() {

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHook.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHook.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHook.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHook.java Wed Oct  8 09:52:52 2008
@@ -29,7 +29,7 @@
 import org.apache.cxf.endpoint.Server;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public class CxfPublishHook extends AbstractHook {
     
@@ -46,7 +46,7 @@
             return;
         }
         
-        ServiceDescription sd = null;
+        ServiceEndpointDescription sd = null;
         if (checkBundle()) {
             sd = OsgiUtils.getRemoteReference(sref, true);
         } 
@@ -106,7 +106,7 @@
         return Collections.unmodifiableMap(endpoints);
     }
     
-    protected ConfigurationTypeHandler getHandler(ServiceDescription sd,
+    protected ConfigurationTypeHandler getHandler(ServiceEndpointDescription sd,
                                                   Map<String, Object> props) {
         return ServiceHookUtils.getHandler(sd, getDistributionProvider(), props);
     }

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/EndpointInfo.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/EndpointInfo.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/EndpointInfo.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/EndpointInfo.java Wed Oct  8 09:52:52 2008
@@ -20,17 +20,17 @@
 
 import org.apache.cxf.endpoint.Server;
 import org.osgi.framework.BundleContext;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public class EndpointInfo {
     
     private BundleContext bc;
-    private ServiceDescription sd;
+    private ServiceEndpointDescription sd;
     private Server server;
     private boolean isPublished;
     
     public EndpointInfo(BundleContext bc,
-                        ServiceDescription sd,
+                        ServiceEndpointDescription sd,
                         Server server,
                         boolean isPublished) {
         this.bc = bc;
@@ -43,7 +43,7 @@
         return bc;
     }
     
-    public ServiceDescription getServiceDescription() {
+    public ServiceEndpointDescription getServiceDescription() {
         return sd;
     }
     

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtils.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtils.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtils.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtils.java Wed Oct  8 09:52:52 2008
@@ -33,7 +33,7 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.discovery.Discovery;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public final class ServiceHookUtils {
     
@@ -43,7 +43,7 @@
         
     }
     
-    public static boolean publish(BundleContext bc, ServiceDescription sd) {
+    public static boolean publish(BundleContext bc, ServiceEndpointDescription sd) {
         
         boolean published = false;
         OsgiService<Discovery> pair = OsgiUtils.getOsgiService(bc, Discovery.class);
@@ -51,7 +51,7 @@
             try {
                 published = pair.getService().publishService(sd);
                 if (published) {
-                    LOG.info("Remote " + sd.getInterfaceName()
+                    LOG.info("Remote " + sd.getInterfaceNames()[0]
                              + " endpoint has been published into Discovery service");
                 }
             } finally {
@@ -65,7 +65,7 @@
                                       ServiceReference serviceReference,
                                       BundleContext dswContext,
                                       BundleContext callingContext, 
-                                      ServiceDescription sd,
+                                      ServiceEndpointDescription sd,
                                       Object serviceObject) {
         
         if (handler == null) {
@@ -74,7 +74,7 @@
         
         // this is an extra sanity check, but do we really need it now ?
         Class<?> interfaceClass = ClassUtils.getInterfaceClass(serviceObject, 
-                                                               sd.getInterfaceName());
+                                                               sd.getInterfaceNames()[0]);
         if (interfaceClass != null) {
             try {
                 return handler.createServer(serviceReference,
@@ -84,10 +84,10 @@
                                             interfaceClass, 
                                             serviceObject);
             } catch (IntentUnsatifiedException iue) {
-                LOG.info("Did not remote service " + sd.getInterfaceName() + " because intent " +
+                LOG.info("Did not remote service " + sd.getInterfaceNames()[0] + " because intent " +
                 		iue.getIntent() + " could not be satisfied");
             } catch (Exception ex) {
-                LOG.warning("WARNING : Problem creating a remote endpoint for " + sd.getInterfaceName()
+                LOG.warning("WARNING : Problem creating a remote endpoint for " + sd.getInterfaceNames()[0]
                         + " from CXF PublishHook, reason is " + ex.getMessage());
             }
         }
@@ -113,7 +113,7 @@
                                                                    Discovery.class);
             if (pair != null) {
                 LOG.info("Unpublishing Service Description for "  
-                          + ei.getServiceDescription().getInterfaceName() 
+                          + ei.getServiceDescription().getInterfaceNames()[0] 
                           + " from a Discovery service "); 
                 pair.getService().unpublishService(ei.getServiceDescription());
                 pair.ungetService(ei.getContext());
@@ -121,7 +121,7 @@
         }
     }
     
-    public static ConfigurationTypeHandler getHandler(ServiceDescription sd,
+    public static ConfigurationTypeHandler getHandler(ServiceEndpointDescription sd,
                                                       CxfDistributionProvider dp,
                                                       Map<String, Object> dswProperties) {
         return ConfigTypeHandlerFactory.getInstance().getHandler(sd, dp,

Copied: cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ServiceEndpointDescriptionImpl.java (from r702392, cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ServiceDescriptionImpl.java)
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ServiceEndpointDescriptionImpl.java?p2=cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ServiceEndpointDescriptionImpl.java&p1=cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ServiceDescriptionImpl.java&r1=702392&r2=702927&rev=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ServiceDescriptionImpl.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/service/ServiceEndpointDescriptionImpl.java Wed Oct  8 09:52:52 2008
@@ -18,32 +18,39 @@
   */
 package org.apache.cxf.dosgi.dsw.service;
 
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.logging.Logger;
 
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
-public class ServiceDescriptionImpl implements ServiceDescription {
+public class ServiceEndpointDescriptionImpl implements ServiceEndpointDescription {
 
-    private List<String> interfaceNames; 
+    private static final Logger LOG = 
+        Logger.getLogger(ServiceEndpointDescriptionImpl.class.getName());
+    
+    private Set<String> interfaceNames; 
     private Map<String, Object> properties;
     
     @SuppressWarnings("unchecked")
-    public ServiceDescriptionImpl(String interfaceName) {
+    public ServiceEndpointDescriptionImpl(String interfaceName) {
         this(Collections.singletonList(interfaceName), Collections.EMPTY_MAP);
     }
     
     @SuppressWarnings("unchecked")
-    public ServiceDescriptionImpl(List<String> interfaceNames) {
+    public ServiceEndpointDescriptionImpl(List<String> interfaceNames) {
         this(interfaceNames, Collections.EMPTY_MAP);
     }
     
-    public ServiceDescriptionImpl(List<String> interfaceNames,
+    public ServiceEndpointDescriptionImpl(List<String> interfaceNames,
                                   Map<String, Object> remoteProperties) {
-        this.interfaceNames = interfaceNames;
+        this.interfaceNames = new HashSet<String>(interfaceNames);
         properties = remoteProperties;
     }
     
@@ -62,33 +69,49 @@
     
     @Override
     public int hashCode() {
-        return interfaceNames.get(0).hashCode() + 37 * properties.hashCode();
+        return interfaceNames.hashCode() + 37 * properties.hashCode();
     }
     
     @Override
     public boolean equals(Object obj) {
-        if (!(obj instanceof ServiceDescription)) {
+        if (!(obj instanceof ServiceEndpointDescription)) {
             return false;
         }
-        ServiceDescription other = (ServiceDescription)obj;
+        ServiceEndpointDescription other = (ServiceEndpointDescription)obj;
+        if (this == other) {
+            return true;
+        }
+        
         
-        return interfaceNames.get(0).equals(other.getInterfaceName())
+        return interfaceNames.equals(other.getInterfaceNames())
                && properties.equals(other.getProperties());
     }
 
-    public String getInterfaceName() {
-        return interfaceNames.get(0);
-    }
-
     public URL getLocation() {
+        Object value = properties.get(ServiceEndpointDescription.PROP_KEY_SERVICE_LOCATION);
+        if (value == null) {
+            return null;
+        }
+        
+        try {
+            return new URL(value.toString());
+        } catch (MalformedURLException ex) {
+            LOG.warning("Service document URL is malformed : " + value.toString());
+        }
+        
         return null;
     }
 
-    public String getProtocolSpecificInterfaceName() {
-        return null;
+    public String[] getInterfaceNames() {
+        return interfaceNames.toArray(new String[]{});
+    }
+
+    public String getProtocolSpecificInterfaceName(String interfaceName) {
+        return interfaceName;
     }
 
-    public String getVersion() {
+    public String getVersion(String interfaceName) {
+        // TODO Auto-generated method stub
         return null;
     }
 }

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/OsgiUtilsTest.java Wed Oct  8 09:52:52 2008
@@ -11,7 +11,7 @@
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public class OsgiUtilsTest extends TestCase {
     public void testGetRemoteReferencesFromRegistrationProperties() {
@@ -36,7 +36,7 @@
         EasyMock.replay(sr);
         
         // Actual test starts here
-        ServiceDescription sd = OsgiUtils.getRemoteReference(sr, true);
+        ServiceEndpointDescription sd = OsgiUtils.getRemoteReference(sr, true);
         assertEquals("*", sd.getProperties().get(Constants.REMOTE_INTERFACES_PROPERTY));
         
         EasyMock.verify(sr);

Added: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java?rev=702927&view=auto
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java (added)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java Wed Oct  8 09:52:52 2008
@@ -0,0 +1,39 @@
+/** 
+  * 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.cxf.dosgi.dsw;
+
+import org.easymock.classextension.EasyMock;
+import org.junit.Ignore;
+import org.osgi.service.discovery.ServiceEndpointDescription;
+
+public final class TestUtils {
+    private TestUtils() {
+        
+    }
+
+    public static ServiceEndpointDescription mockServiceDescription(String... interfaceNames) {
+        ServiceEndpointDescription sd = EasyMock.createNiceMock(ServiceEndpointDescription.class);
+        sd.getInterfaceNames();
+        EasyMock.expectLastCall().andReturn(interfaceNames);
+        return sd;
+    }
+    
+    
+}

Propchange: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/TestUtils.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactoryTest.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactoryTest.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ClientServiceFactoryTest.java Wed Oct  8 09:52:52 2008
@@ -26,7 +26,7 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public class ClientServiceFactoryTest extends TestCase {
     public void testGetService() {
@@ -34,7 +34,7 @@
         
         IMocksControl control = EasyMock.createNiceControl();
         BundleContext dswContext = control.createMock(BundleContext.class);
-        ServiceDescription sd = control.createMock(ServiceDescription.class);
+        ServiceEndpointDescription sd = control.createMock(ServiceEndpointDescription.class);
         ConfigurationTypeHandler handler = control.createMock(ConfigurationTypeHandler.class);
 
         BundleContext requestingContext = control.createMock(BundleContext.class);

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ConfigTypeHandlerFactoryTest.java Wed Oct  8 09:52:52 2008
@@ -27,15 +27,15 @@
 import org.apache.cxf.dosgi.dsw.Constants;
 import org.apache.cxf.dosgi.dsw.service.CxfDistributionProvider;
 import org.apache.cxf.dosgi.dsw.service.DistributionProviderImpl;
-import org.apache.cxf.dosgi.dsw.service.ServiceDescriptionImpl;
-import org.osgi.service.discovery.ServiceDescription;
+import org.apache.cxf.dosgi.dsw.service.ServiceEndpointDescriptionImpl;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 
 public class ConfigTypeHandlerFactoryTest extends TestCase {
     public void testGetDefaultHandler() {
         ConfigTypeHandlerFactory f = ConfigTypeHandlerFactory.getInstance();
         
-        ServiceDescription sd = new ServiceDescriptionImpl("MyInterface");
+        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("MyInterface");
         CxfDistributionProvider dp = new DistributionProviderImpl();
         ConfigurationTypeHandler handler = f.getHandler(sd, dp, new HashMap<String, Object>());
         assertTrue(handler instanceof PojoConfigurationTypeHandler);        
@@ -47,7 +47,7 @@
         
         Map<String, Object> sdProps = new HashMap<String, Object>();
         sdProps.put(Constants.CONFIG_TYPE_PROPERTY, Constants.POJO_CONFIG_TYPE);
-        ServiceDescription sd = new ServiceDescriptionImpl(
+        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
                 Collections.singletonList("MyInterface"), sdProps);
 
         CxfDistributionProvider dp = new DistributionProviderImpl();
@@ -61,7 +61,7 @@
         
         Map<String, Object> sdProps = new HashMap<String, Object>();
         sdProps.put(Constants.CONFIG_TYPE_PROPERTY, Constants.WSDL_CONFIG_TYPE);
-        ServiceDescription sd = new ServiceDescriptionImpl(
+        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(
                 Collections.singletonList("MyInterface"), sdProps);
         
         CxfDistributionProvider dp = new DistributionProviderImpl();

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandlerTest.java Wed Oct  8 09:52:52 2008
@@ -29,9 +29,10 @@
 import junit.framework.TestCase;
 
 import org.apache.cxf.dosgi.dsw.Constants;
+import org.apache.cxf.dosgi.dsw.TestUtils;
 import org.apache.cxf.dosgi.dsw.qos.IntentMap;
 import org.apache.cxf.dosgi.dsw.service.DistributionProviderImpl;
-import org.apache.cxf.dosgi.dsw.service.ServiceDescriptionImpl;
+import org.apache.cxf.dosgi.dsw.service.ServiceEndpointDescriptionImpl;
 import org.apache.cxf.endpoint.AbstractEndpointFactory;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.feature.AbstractFeature;
@@ -46,7 +47,7 @@
 import org.easymock.classextension.IMocksControl;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 
 public class PojoConfigurationTypeHandlerTest extends TestCase {
@@ -78,7 +79,7 @@
             
             @Override
             String[] applyIntents(BundleContext dswContext, BundleContext callingContext,
-                List<AbstractFeature> features, AbstractEndpointFactory factory, ServiceDescription sd) {
+                List<AbstractFeature> features, AbstractEndpointFactory factory, ServiceEndpointDescription sd) {
                 return new String[0];
             }
         };
@@ -86,7 +87,7 @@
         ServiceReference sr = EasyMock.createNiceMock(ServiceReference.class);
         BundleContext dswContext = EasyMock.createNiceMock(BundleContext.class);
         BundleContext callingContext = EasyMock.createNiceMock(BundleContext.class);
-        ServiceDescription sd = EasyMock.createNiceMock(ServiceDescription.class);
+        ServiceEndpointDescription sd = TestUtils.mockServiceDescription("Foo");
         EasyMock.replay(sr);
         EasyMock.replay(dswContext);
         EasyMock.replay(callingContext);
@@ -111,7 +112,7 @@
 
             @Override
             String[] applyIntents(BundleContext dswContext, BundleContext callingContext,
-                List<AbstractFeature> features, AbstractEndpointFactory factory, ServiceDescription sd) {
+                List<AbstractFeature> features, AbstractEndpointFactory factory, ServiceEndpointDescription sd) {
                 return new String []{"A", "B"};
             }
         };
@@ -119,7 +120,7 @@
         ServiceReference sr = EasyMock.createNiceMock(ServiceReference.class);
         BundleContext dswContext = EasyMock.createNiceMock(BundleContext.class);
         BundleContext callingContext = EasyMock.createNiceMock(BundleContext.class);
-        ServiceDescription sd = EasyMock.createNiceMock(ServiceDescription.class);
+        ServiceEndpointDescription sd = TestUtils.mockServiceDescription("Foo");
         EasyMock.replay(sr);
         EasyMock.replay(dswContext);
         EasyMock.replay(callingContext);
@@ -211,7 +212,7 @@
 
         Map<String, Object> props = new HashMap<String, Object>();
         props.put(Constants.REQUIRES_INTENTS_PROPERTY, "A");
-        ServiceDescription sd = new ServiceDescriptionImpl(Arrays.asList(String.class.getName()), props);
+        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
 
         List<String> effectiveIntents = 
             Arrays.asList(p.applyIntents(dswContext, callingContext, features, factory, sd));
@@ -242,7 +243,7 @@
 
         Map<String, Object> props = new HashMap<String, Object>();
         props.put(Constants.REQUIRES_INTENTS_PROPERTY, "transactionality confidentiality.message");
-        ServiceDescription sd = new ServiceDescriptionImpl(Arrays.asList(String.class.getName()), props);
+        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
 
         List<String> effectiveIntents = 
             Arrays.asList(p.applyIntents(dswContext, callingContext, features, factory, sd));
@@ -273,7 +274,7 @@
 
         Map<String, Object> props = new HashMap<String, Object>();
         props.put(Constants.REQUIRES_INTENTS_PROPERTY, "A B");
-        ServiceDescription sd = new ServiceDescriptionImpl(Arrays.asList(String.class.getName()), props);
+        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
 
         try {
             p.applyIntents(dswContext, callingContext, features, factory, sd);
@@ -339,7 +340,7 @@
         control.replay();
         Map<String, Object> props = new HashMap<String, Object>();
         props.put(Constants.REQUIRES_INTENTS_PROPERTY, requestedIntents);
-        ServiceDescription sd = new ServiceDescriptionImpl(Arrays.asList(String.class.getName()), props);
+        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
         
         PojoConfigurationTypeHandler p = new PojoConfigurationTypeHandler(dp, handlerProps) {
             @Override
@@ -381,7 +382,7 @@
         control.replay();
         Map<String, Object> props = new HashMap<String, Object>();
         props.put(Constants.REQUIRES_INTENTS_PROPERTY, "B A");
-        ServiceDescription sd = new ServiceDescriptionImpl(Arrays.asList(String.class.getName()), props);
+        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl(Arrays.asList(String.class.getName()), props);
         
         PojoConfigurationTypeHandler p = new PojoConfigurationTypeHandler(dp, handlerProps) {
             @Override
@@ -414,4 +415,5 @@
             return name;
         }
     }
+    
 }

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandlerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandlerTest.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandlerTest.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandlerTest.java Wed Oct  8 09:52:52 2008
@@ -28,11 +28,12 @@
 import junit.framework.TestCase;
 
 import org.apache.cxf.dosgi.dsw.Constants;
+import org.apache.cxf.dosgi.dsw.TestUtils;
 import org.apache.cxf.dosgi.dsw.service.DistributionProviderImpl;
 import org.easymock.classextension.EasyMock;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public class WsdlConfigurationTypeHandlerTest extends TestCase {
     private Map<String, Object> handlerProps;
@@ -61,7 +62,7 @@
         ServiceReference sr = EasyMock.createNiceMock(ServiceReference.class);
         BundleContext dswContext = EasyMock.createNiceMock(BundleContext.class);
         BundleContext callingContext = EasyMock.createNiceMock(BundleContext.class);
-        ServiceDescription sd = EasyMock.createNiceMock(ServiceDescription.class);
+        ServiceEndpointDescription sd = TestUtils.mockServiceDescription("Foo");
         EasyMock.replay(sr);
         EasyMock.replay(dswContext);
         EasyMock.replay(callingContext);
@@ -73,4 +74,6 @@
         assertSame(sr, dp.getRemoteServices()[0]);
         
     }
+    
+    
 }

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/CxfPublishHookTest.java Wed Oct  8 09:52:52 2008
@@ -35,7 +35,7 @@
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 public class CxfPublishHookTest extends Assert {
 
@@ -106,19 +106,19 @@
         }
         
         @Override
-        protected ConfigurationTypeHandler getHandler(ServiceDescription sd,
+        protected ConfigurationTypeHandler getHandler(ServiceEndpointDescription sd,
                                                       Map<String, Object> props) {
             return new ConfigurationTypeHandler() {
 
                 public Object createProxy(ServiceReference sr,
                                           BundleContext dswContext, BundleContext callingContext, 
-                                          Class<?> iClass, ServiceDescription sd) {
+                                          Class<?> iClass, ServiceEndpointDescription sd) {
                     throw new UnsupportedOperationException();
                 }
 
                 public Server createServer(ServiceReference sr, 
                                            BundleContext dswContext, BundleContext callingContext, 
-                                           ServiceDescription sd, Class<?> iClass, Object serviceBean) {
+                                           ServiceEndpointDescription sd, Class<?> iClass, Object serviceBean) {
                     Assert.assertSame(serviceBean, serviceObject);
                     TestPublishHook.this.setCalled();
                     return server;

Modified: cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtilsTest.java?rev=702927&r1=702926&r2=702927&view=diff
==============================================================================
--- cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtilsTest.java (original)
+++ cxf/sandbox/dosgi/dsw/cxf-dsw/src/test/java/org/apache/cxf/dosgi/dsw/hooks/ServiceHookUtilsTest.java Wed Oct  8 09:52:52 2008
@@ -20,14 +20,15 @@
 
 import junit.framework.TestCase;
 
+import org.apache.cxf.dosgi.dsw.TestUtils;
 import org.apache.cxf.dosgi.dsw.handlers.ConfigurationTypeHandler;
-import org.apache.cxf.dosgi.dsw.service.ServiceDescriptionImpl;
+import org.apache.cxf.dosgi.dsw.service.ServiceEndpointDescriptionImpl;
 import org.apache.cxf.endpoint.Server;
 import org.easymock.EasyMock;
 import org.easymock.IMocksControl;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServiceDescription;
+import org.osgi.service.discovery.ServiceEndpointDescription;
 
 
 public class ServiceHookUtilsTest extends TestCase {
@@ -38,7 +39,7 @@
         ServiceReference serviceReference = control.createMock(ServiceReference.class);
         BundleContext dswContext = control.createMock(BundleContext.class);
         BundleContext callingContext = control.createMock(BundleContext.class);
-        ServiceDescription sd = new ServiceDescriptionImpl("java.lang.String");
+        ServiceEndpointDescription sd = new ServiceEndpointDescriptionImpl("java.lang.String");
         Object service = "hi";
 
         ConfigurationTypeHandler handler = control.createMock(ConfigurationTypeHandler.class);
@@ -57,7 +58,7 @@
         ServiceReference serviceReference = control.createMock(ServiceReference.class);
         BundleContext dswContext = control.createMock(BundleContext.class);
         BundleContext callingContext = control.createMock(BundleContext.class);
-        ServiceDescription sd = control.createMock(ServiceDescription.class);
+        ServiceEndpointDescription sd = mockServiceDescription(control, "Foo");
         Object service = "hi";
 
         ConfigurationTypeHandler handler = control.createMock(ConfigurationTypeHandler.class);
@@ -67,4 +68,15 @@
         
         assertNull(ServiceHookUtils.createServer(handler, serviceReference, dswContext, callingContext, sd, service));        
     }
+    
+    private ServiceEndpointDescription mockServiceDescription(IMocksControl control, 
+                                                             String... interfaceNames) {
+        ServiceEndpointDescription sd = control.createMock(ServiceEndpointDescription.class);
+        sd.getInterfaceNames();
+        EasyMock.expectLastCall().andReturn(interfaceNames);
+        return sd;
+    }
+    
 }
+
+



Mime
View raw message