use of org.eclipse.ecf.pubsub.impl.SubscribeMessage in project ecf by eclipse.
the class LocalAgent method subscribe.
public void subscribe(ID containerID, ID requestorID) {
synchronized (subscriptionMutex) {
if (subscriptions == null)
subscriptions = new HashSet();
ISharedObjectContext ctx = config.getContext();
try {
if (subscriptions.add(containerID)) {
ctx.sendCreate(containerID, createRemoteAgentDescription(requestorID));
} else {
SubscribeMessage msg = new SubscribeMessage(requestorID);
ctx.sendMessage(containerID, SerializationUtil.serialize(msg));
}
} catch (IOException e) {
// TODO Log me!
e.printStackTrace();
}
}
}
Aggregations