Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Alexander Kuppe2010-10-29 11:33:06 -0400
committerMarkus Alexander Kuppe2010-10-29 11:33:06 -0400
commit5353951a4b3ddb1d619f4a9c22ba90ba2279ac77 (patch)
treeda1b9edc52d839b82dc56a02dae88203a562da1c
parent229f46f1dae33a78c63a52f9a80a12567643bd2e (diff)
downloadorg.eclipse.ecf-5353951a4b3ddb1d619f4a9c22ba90ba2279ac77.tar.gz
org.eclipse.ecf-5353951a4b3ddb1d619f4a9c22ba90ba2279ac77.tar.xz
org.eclipse.ecf-5353951a4b3ddb1d619f4a9c22ba90ba2279ac77.zip
RESOLVED - bug 329054: [Discovery][Composite] org.eclipse.ecf.provider.discovery.CompositeDiscoveryContainer.connect(ID, IConnectContext) should handle ContainerConnectExceptions in nested discovery providers
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329054
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java
index c9602c78c..1c3cc6639 100644
--- a/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.discovery/src/org/eclipse/ecf/provider/discovery/CompositeDiscoveryContainer.java
@@ -142,6 +142,7 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
targetID = (aTargetID == null) ? getConfig().getID() : aTargetID;
fireContainerEvent(new ContainerConnectingEvent(this.getID(), targetID, connectContext));
synchronized (containers) {
+ final Collection containersFailedToConnect = new HashSet();
for (final Iterator itr = containers.iterator(); itr.hasNext();) {
final IContainer container = (IContainer) itr.next();
if (container.getConnectedID() == null) {
@@ -150,6 +151,7 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
} catch (ContainerConnectException cce) {
Trace.catching(Activator.PLUGIN_ID, METHODS_TRACING, this.getClass(), "connect", //$NON-NLS-1$
cce);
+ containersFailedToConnect.add(container);
continue;
}
}
@@ -157,6 +159,8 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
idca.addServiceListener(ccsl);
idca.addServiceTypeListener(ccstl);
}
+ // remove all containers that failed to connect and thus are unusable subsequently
+ containers.removeAll(containersFailedToConnect);
}
fireContainerEvent(new ContainerConnectedEvent(this.getID(), targetID));
}
@@ -384,6 +388,7 @@ public class CompositeDiscoveryContainer extends AbstractDiscoveryContainerAdapt
} catch (ContainerConnectException e) {
// we eat the exception here
Trace.catching(Activator.PLUGIN_ID, METHODS_CATCHING, this.getClass(), "addContainer(Object)", e); //$NON-NLS-1$
+ return false;
}
}
final IDiscoveryLocator idca = (IDiscoveryLocator) object;

Back to the top