Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] High level change notifications between clients
[CDO] High level change notifications between clients [message #1752045] Wed, 18 January 2017 09:26 Go to next message
Marcus Rosell is currently offline Marcus RosellFriend
Messages: 3
Registered: January 2017
Location: Gothenburg, Sweden
Junior Member
Hi.
We're in the process of moving our RCP application to CDO from a XMI-based resource.
For the RCP-application we use long running CDO transactions and a lot of commands can have been executed before a commit.

Today we process the complete change notification set, and dig out, what parts of the GUI and which Caches we need to update. This has proven quite cumbersome and, in some cases, impossible to do reliably.

Because of this, we have identified that we need to communicate some kind of "high level" change events to the other clients. Is there a way to send such messages through CDO?

Best regards
Marcus
Re: [CDO] High level change notifications between clients [message #1752087 is a reply to message #1752045] Wed, 18 January 2017 16:54 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6579
Registered: July 2009
Senior Member
Yes, you can use CDORemoteSessionManager.sendMessage() to broadcast messages to all subscribed remote sessions or CDORemoteSession.sendMessage() to send a a message to a single remote session. The API is explained in http://download.eclipse.org/modeling/emf/cdo/drops/R20160607-1209/help/org.eclipse.emf.cdo.doc/javadoc/org/eclipse/emf/cdo/session/remote/package-summary.html

If you need even more (full) control you can register your own Net4j protocol and multiplex it through a channel of the connection that's used by CDO. A file upload expample is explained in https://thegordian.blogspot.de/2008/12/remoting-with-iprogressmonitor.html


Re: [CDO] High level change notifications between clients [message #1752132 is a reply to message #1752087] Thu, 19 January 2017 07:19 Go to previous messageGo to next message
Marcus Rosell is currently offline Marcus RosellFriend
Messages: 3
Registered: January 2017
Location: Gothenburg, Sweden
Junior Member
Thanks.
Timing wise, lets say that I commit a transaction and afterward I do a sendMessage(), will the other clients receive, first, the change notifications and later the messages?
Will the events be fired in the "correct" order?



Re: [CDO] High level change notifications between clients [message #1752136 is a reply to message #1752132] Thu, 19 January 2017 07:53 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6579
Registered: July 2009
Senior Member
No, there's no guarantee about the order in which these different types of signals arrive at other clients. Only the correct order of commit notifications is guaranteed.

But you can achieve the correct ordering yourself with not much effort. Capture the commit timestamp with transaction.commit().getTimeStamp() or CDOTransaction.getLastCommitTime() and encode it into the CDORemoteMessage that you'll send to the other clients. The receiving clients decode the timestamp from the message and call transaction.waitForUpdate(timestamp) before they act upon the rest of the message.


Re: [CDO] High level change notifications between clients [message #1752154 is a reply to message #1752136] Thu, 19 January 2017 09:49 Go to previous message
Marcus Rosell is currently offline Marcus RosellFriend
Messages: 3
Registered: January 2017
Location: Gothenburg, Sweden
Junior Member
Sounds great, I will try this approach.
Thanks.
Previous Topic:Implemementing an external interface in XCore
Next Topic:[CDO] Enforce model consistency between client and server
Goto Forum:
  


Current Time: Mon Jun 21 17:33:02 GMT 2021

Powered by FUDForum. Page generated in 0.02203 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top