|
|
|
|
Re: [CDO] Listen to passive updates. [message #431042 is a reply to message #431033] |
Thu, 25 June 2009 07:04 |
|
This is a multi-part message in MIME format.
--------------070700050902090805040103
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit
Kai,
Please use:
view.options().setInvalidationNotificationEnabled(*true*);
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Kai Schlamp schrieb:
> Hy Simon,
>
> comment below.
>
> Simon Mc Duff wrote:
>> Kai Schlamp wrote:
>>
>>> Hello.
>> Hello! :-)
>>
>>> Is it somehow possible for a view/transaction to listen and get the
>>> object
>> that is updated (activ or
>>> passiv)?
>>
>>> I could add a IListener that indeed is called, but it doesn't tell
>>> me what
>> object.
>>> A CDOTransactionHandler can only monitor what the transaction does
>>> itself.
>>> But how do I get those objects that are passive updated?
>>
>>> I don't want to add an Adapter to every object in my view.
>> For the passive you can do the following
>>
>> http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#How_can_I_reac t_to_remote_changes_to_my_objects.3F
>>
>>
>> +
>>
>> CDOViewInvalidationEvent
>> - getDirtyObjects and getDetchedObject
>>
>> private IListener viewListener = new IListener()
>> {
>> public void notifyEvent(IEvent event)
>> {
>> if (event instanceof CDOViewInvalidationEvent)
>> {
>> CDOViewInvalidationEvent e = (CDOViewInvalidationEvent)event;
>> // Remove detached object from selection, could incur into
>> unwanted exceptions
>> e.getDirtyObjects();
>> }
>> }
>> }
>> Quick note:
>>
>> CDOViewInvalidationEvent will only include dirtyObjects that you have
>> in your views. CDOSessionInvalidationEvent will gives you ALL dirty
>> CDOID that happens passively.
>>
>> Is it helping you ?
>
> Yes, looks good. The problem is that I don't have the method
> CDOView.setInvalidationNotificationEnabled(boolean enabled);
> available. When I browse the source by hitting F3 on the class, I see
> it's there. But when I try to access it in the editor, it tells my
> that it is undefined ... strange.
> Most probably a setup problem. I will reinstall everything (I only
> updated for several Milestones and RCs now) and report back then. It's
> even a good time for reinstallation ... the new Galileo release ;-)
>
> Regards,
> Kai
--------------070700050902090805040103
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Kai,<br>
<br>
Please use:<br>
<br>
<pre>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Re: [CDO] Listen to passive updates. [message #431046 is a reply to message #431045] |
Thu, 25 June 2009 07:46 |
|
Kai Schlamp schrieb:
> Hello, Eike ...
>
>> Please use:
>>
>> view.options().setInvalidationNotificationEnabled(*true*);
>
> Thanks for the hint. I now receive CDOViewInvalidationEvent events.
> But how would I get those other events/notifications mentioned in the
> FAQ (CDOSessionInvalidationEvent,
session.addListener(new IListener() {...});
> CDOInvalidationNotification and CDOChangeSubscriptionPolicy)?
object.eAdapters().add(new AdapterImpl() {...});
> For e.g. it is mentioned in the Javadoc comment of
> CDOInvalidationNotification that
> setInvalidationNotificationEnabled(boolean) should lead to a
> CDOInvalidationNotification.
> But I never receive such events (at least when I check with instanceof).
These two methods achieve similar things:
- Add listeners to CDOSession or CDOView to receive IEvents
- Attach adapters to EObject to receive Notifications (either with or
without delta information)
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Re: [CDO] Listen to passive updates. [message #431071 is a reply to message #431070] |
Thu, 25 June 2009 16:24 |
|
Kai,
The following method only returns null for changes from remote:
org.eclipse.emf.cdo.session.CDOSessionInvalidationEvent.getV iew()
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Kai Schlamp schrieb:
> Thanks Eike for carifying this. One last question about those listeners.
> Is it possible to only listen to passive updates that come from
> another session?
> I am not interested in commits of the transactions of the "local"
> session. Just in those commits that other
> clients do by using their session.
>
> Regards,
> Kai
>
> Eike Stepper wrote:
>> Kai Schlamp schrieb:
>>> Hello, Eike ...
>>>
>>>> Please use:
>>>>
>>>> view.options().setInvalidationNotificationEnabled(*true*);
>>> Thanks for the hint. I now receive CDOViewInvalidationEvent events.
>>> But how would I get those other events/notifications mentioned in the
>>> FAQ (CDOSessionInvalidationEvent,
>> session.addListener(new IListener() {...});
>>
>>> CDOInvalidationNotification and CDOChangeSubscriptionPolicy)?
>> object.eAdapters().add(new AdapterImpl() {...});
>>
>>> For e.g. it is mentioned in the Javadoc comment of
>>> CDOInvalidationNotification that
>>> setInvalidationNotificationEnabled(boolean) should lead to a
>>> CDOInvalidationNotification.
>>> But I never receive such events (at least when I check with
>>> instanceof).
>> These two methods achieve similar things:
>>
>> - Add listeners to CDOSession or CDOView to receive IEvents
>> - Attach adapters to EObject to receive Notifications (either with or
>> without delta information)
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04581 seconds