It’s been a while since I used it, so I may have the details wrong, but..
DataContext fires an event whenever it merges snapshot changes coming from its
parent. The original cause of the event may be a peer context commit in the
same VM or in a different VM. It works the same.. So you might do this:
context.getEventManager().addListener(
myListener,
“someMethod”,
GraphEvent.class,
DataChannel.GRAPH_CHANGED_SUBJECT,
context);
“someMethod” of your listener must take GraphEvent argument. E.g.:
public void someMethod(GraphEvent e) { /* update UI */ }
Andrus
On Aug 18, 2014, at 8:11 PM, [email protected] wrote:
> Thanks Andrus
>
> Say now I want to update my GUI when a change occurs, how do I know that an
> object has been updated ?
>
> regards
> Jurgen
>
>
> -----Original Message----- From: Andrus Adamchik
> Sent: Monday, August 18, 2014 1:52 PM
> To: [email protected]
> Subject: Re: Remote Change Notifications
>
> When you enable remote notifications, Cayenne send and listens to events
> itself. The are object commit events to be sure, containing change deltas.
> When an event is received, it is processed by the DataDomain, with the result
> being that all its contexts update their copies of objects from the event
> data.
>
> Andrus
>
>
> On Aug 18, 2014, at 10:50 AM, [email protected] wrote:
>> Hi All
>>
>> If you have “Remote Change Notifications” enabled (using JavaGroups, JMS,
>> etc.), how does Cayenne let you know when a change has been received ?
>> Or how does one listen for these changes / notifications ?
>>
>> Thanks, regards
>> Jurgen
>
>