Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-11 09:21:47 +0000
committerEike Stepper2007-10-11 09:21:47 +0000
commit81f9d19e07f8cfe46c5496000151d9bec4125d87 (patch)
tree363339cb73e4d4a407c6e957439c02384d6000d8 /plugins/org.eclipse.net4j.buddies.server/src
parent9b73af8c87ca14b6662b0a0a3864706e9c99e318 (diff)
downloadcdo-81f9d19e07f8cfe46c5496000151d9bec4125d87.tar.gz
cdo-81f9d19e07f8cfe46c5496000151d9bec4125d87.tar.xz
cdo-81f9d19e07f8cfe46c5496000151d9bec4125d87.zip
[205668] Provide buddies example
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205668
Diffstat (limited to 'plugins/org.eclipse.net4j.buddies.server/src')
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/InstallFacilityIndication.java2
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/protocol/ServerMessageIndication.java12
2 files changed, 4 insertions, 10 deletions
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<Long, ICollaboration> 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

Back to the top