summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-11 05:21:47 (EDT)
committerEike Stepper2007-10-11 05:21:47 (EDT)
commit81f9d19e07f8cfe46c5496000151d9bec4125d87 (patch)
tree363339cb73e4d4a407c6e957439c02384d6000d8
parent9b73af8c87ca14b6662b0a0a3864706e9c99e318 (diff)
downloadcdo-81f9d19e07f8cfe46c5496000151d9bec4125d87.zip
cdo-81f9d19e07f8cfe46c5496000151d9bec4125d87.tar.gz
cdo-81f9d19e07f8cfe46c5496000151d9bec4125d87.tar.bz2
[205668] Provide buddies example
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205668
-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 afa3566..2067374 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 dba28b1..d5332b0 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