From 81f9d19e07f8cfe46c5496000151d9bec4125d87 Mon Sep 17 00:00:00 2001 From: Eike Stepper Date: Thu, 11 Oct 2007 09:21:47 +0000 Subject: [205668] Provide buddies example https://bugs.eclipse.org/bugs/show_bug.cgi?id=205668 --- .../internal/server/protocol/InstallFacilityIndication.java | 2 +- .../internal/server/protocol/ServerMessageIndication.java | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'plugins/org.eclipse.net4j.buddies.server/src') diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InstallFacilityIndication.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InstallFacilityIndication.java index afa35664b8..2067374c90 100644 --- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InstallFacilityIndication.java +++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InstallFacilityIndication.java @@ -52,7 +52,7 @@ public class InstallFacilityIndication extends IndicationWithResponse { String description = String.valueOf(collaborationID); IFacility facility = (IFacility)IPluginContainer.INSTANCE.getElement(FACILITY_GROUP, facilityType, description); - Collaboration collaboration = (Collaboration)BuddyAdmin.INSTANCE.getCollaborations().get(collaborationID); + Collaboration collaboration = (Collaboration)BuddyAdmin.INSTANCE.getCollaboration(collaborationID); facility.setCollaboration(collaboration); collaboration.addFacility(facility); success = true; diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerMessageIndication.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerMessageIndication.java index dba28b147e..d5332b003e 100644 --- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerMessageIndication.java +++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerMessageIndication.java @@ -6,8 +6,6 @@ import org.eclipse.net4j.buddies.protocol.ICollaboration; import org.eclipse.net4j.buddies.protocol.IMessage; import org.eclipse.net4j.buddies.server.IBuddyAdmin; -import java.util.Map; - /** * @author Eike Stepper */ @@ -20,14 +18,10 @@ public class ServerMessageIndication extends MessageIndication @Override protected void messageReceived(IMessage message) { - synchronized (IBuddyAdmin.INSTANCE) + ICollaboration collaboration = IBuddyAdmin.INSTANCE.getCollaboration(message.getCollaborationID()); + if (collaboration != null) { - Map collaborations = IBuddyAdmin.INSTANCE.getCollaborations(); - Collaboration collaboration = (Collaboration)collaborations.get(message.getCollaborationID()); - if (collaboration != null) - { - collaboration.notifyMessage(message); - } + ((Collaboration)collaboration).notifyMessage(message); } } } \ No newline at end of file -- cgit v1.2.3