sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefane...@apache.org
Subject svn commit: r1582233 - in /sling/trunk/bundles/extensions/discovery/impl/src: main/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryImpl.java test/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryTest.java
Date Thu, 27 Mar 2014 09:40:16 GMT
Author: stefanegli
Date: Thu Mar 27 09:40:15 2014
New Revision: 1582233

URL: http://svn.apache.org/r1582233
Log:
SLING-3446 : DiscoveryServiceImpl re-registers the connector urls on activate - so ConnectorRegistryImpl
should accept this, instead of throwing an IllegalStateException that registering twice is
not allowed

Modified:
    sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryImpl.java
    sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryTest.java

Modified: sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryImpl.java?rev=1582233&r1=1582232&r2=1582233&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryImpl.java
(original)
+++ sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryImpl.java
Thu Mar 27 09:40:15 2014
@@ -86,8 +86,8 @@ public class ConnectorRegistryImpl imple
                     .entrySet().iterator(); it.hasNext();) {
                 Entry<String, TopologyConnectorClient> entry = it.next();
                 if (entry.getValue().getConnectorUrl().equals(connectorUrl)) {
-                    throw new IllegalStateException(
-                            "cannot register same url twice: " + connectorUrl);
+                    it.remove();
+                    logger.info("registerOutgoingConnection: re-registering connector: "+connectorUrl);
                 }
             }
             String serverInfo;

Modified: sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryTest.java?rev=1582233&r1=1582232&r2=1582233&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryTest.java
(original)
+++ sling/trunk/bundles/extensions/discovery/impl/src/test/java/org/apache/sling/discovery/impl/topology/connector/ConnectorRegistryTest.java
Thu Mar 27 09:40:15 2014
@@ -69,9 +69,9 @@ public class ConnectorRegistryTest {
         try {
             // should not be able to register same url twice
             client = c.registerOutgoingConnector(cvs, url);
-            fail("should have complained");
+            // ok - no longer complains - SLING-3446
         } catch (IllegalStateException e) {
-            // ok
+            fail("should no longer be thrown"); // SLING-3446
         }
 
         try {



Mime
View raw message