Author: antelder
Date: Tue Mar 16 08:00:39 2010
New Revision: 923617

URL: http://svn.apache.org/viewvc?rev=923617&view=rev
Log:
Remove old matches method code as its now in Endpoint class

Modified:
    
tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java

Modified: 
tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java?rev=923617&r1=923616&r2=923617&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
 Tue Mar 16 08:00:39 2010
@@ -116,78 +116,6 @@ public abstract class BaseEndpointRegist
         return listeners;
     }
 
-    /**
-     * Check if a serviceURI matches the given endpoint URI
-     * @param serviceURI
-     * @param endpointURI
-     * @return
-     */
-    protected boolean matches(String serviceURI, String endpointURI) {
-        String[] parts1 = parseServiceURI(serviceURI);
-        String[] parts2 = parseStructuralURI(endpointURI);
-        for (int i = 0; i < parts1.length; i++) {
-            if (parts1[i] == null || parts1[i].equals(parts2[i])) {
-                continue;
-            } else {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Parse the service URI into an array of names. The service URI is in one 
of the following formats:
-     * <ul>
-     * <li>componentName
-     * <li>componentName/serviceName
-     * <li>componentName/serviceName/bindingName
-     * </ul> 
-     * @param serviceURI
-     * @return
-     */
-    protected String[] parseServiceURI(String serviceURI) {
-        if (serviceURI.contains("#")) {
-            return parseStructuralURI(serviceURI);
-        }
-        String[] names = new String[3];
-        String[] segments = serviceURI.split("/");
-        for (int i = 0; i < names.length && i < segments.length; i++) {
-            names[i] = segments[i];
-        }
-        return names;
-    }
-
-    /**
-     * Parse the structural URI into an array of parts (componentURI, 
serviceName, bindingName)
-     * @param structuralURI
-     * @return [0]: componentURI [1]: serviceName [2]: bindingName
-     */
-    protected String[] parseStructuralURI(String structuralURI) {
-        String[] names = new String[3];
-        int index = structuralURI.lastIndexOf('#');
-        if (index == -1) {
-            names[0] = structuralURI;
-        } else {
-            names[0] = structuralURI.substring(0, index);
-            String str = structuralURI.substring(index + 1);
-            if (str.startsWith("service-binding(") && str.endsWith(")")) {
-                str = str.substring("service-binding(".length(), str.length() 
- 1);
-                String[] parts = str.split("/");
-                if (parts.length != 2) {
-                    throw new IllegalArgumentException("Invalid 
service-binding URI: " + structuralURI);
-                }
-                names[1] = parts[0];
-                names[2] = parts[1];
-            } else if (str.startsWith("service(") && str.endsWith(")")) {
-                str = str.substring("service(".length(), str.length() - 1);
-                names[1] = str;
-            } else {
-                throw new IllegalArgumentException("Invalid structural URI: " 
+ structuralURI);
-            }
-        }
-        return names;
-    }
-
     public abstract void removeEndpoint(Endpoint endpoint);
 
     public void removeEndpointReference(EndpointReference endpointReference) {


Reply via email to