|
Re: [CDO] feature value synchronization [message #430204 is a reply to message #430203] |
Wed, 13 May 2009 11:59 |
|
Martynas,
I think the best way is to register an adapter on the objects to be
synchronized (even if it's only one) and to do the synchronization in
the notifyChaged() method of the adapter implementation. This is the
normal EMF way ;-)
Cheers
/Eike
----
http://thegordian.blogspot.com
Martynas schrieb:
> Hi,
>
> I have an EMF feature. The feature value must be "synchronized" with
> another non-EMF feature (e.g. simple java class field). The initial
> idea was to override eGet, sSet methods to synchronize the values.
> Unfortunately these methods are not called when committing/loading the
> cdo object.
>
> There are methods cdoInternalPreCommit and cdoInternalPostLoad, but in
> another thread I've found that "its calling semantics are not
> officially specified and they could change without notice."
>
> Are there any suggestions how such synchronization can be achieved?
>
> In generally what I need is a call to my method when the EMF feature
> value is set/get.
>
> Thanks
>
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: [CDO] feature value synchronization [message #430205 is a reply to message #430204] |
Wed, 13 May 2009 12:02 |
|
Eike Stepper schrieb:
> Martynas,
>
> I think the best way is to register an adapter on the objects to be
> synchronized (even if it's only one) and to do the synchronization in
> the notifyChaged() method of the adapter implementation. This is the
> normal EMF way ;-)
>
I forgot to mention that you might want to add a CDO change subscription
policy if you need the exact deltas inside of your adpater implementations.
This FAQ entry could be helpful:
http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#How_can_I_reac t_to_remote_changes_to_my_objects.3F
And this N&N entry as well:
http://wiki.eclipse.org/New_And_Noteworthy_for_CDO_2.0#Chang e_subscription
Cheers
/Eike
----
http://thegordian.blogspot.com
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>
> Martynas schrieb:
>
>> Hi,
>>
>> I have an EMF feature. The feature value must be "synchronized" with
>> another non-EMF feature (e.g. simple java class field). The initial
>> idea was to override eGet, sSet methods to synchronize the values.
>> Unfortunately these methods are not called when committing/loading the
>> cdo object.
>>
>> There are methods cdoInternalPreCommit and cdoInternalPostLoad, but in
>> another thread I've found that "its calling semantics are not
>> officially specified and they could change without notice."
>>
>> Are there any suggestions how such synchronization can be achieved?
>>
>> In generally what I need is a call to my method when the EMF feature
>> value is set/get.
>>
>> Thanks
>>
>>
>>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Re: [CDO] feature value synchronization [message #430257 is a reply to message #430254] |
Thu, 14 May 2009 10:50 |
|
Martynas,
I fear we have no load notification available so far (Simon, do I miss
something?).
It could make a valid enhancement request. I could imagine something
more general:
CDOStateChangeEvents fired by a CDOView for all associated objects,
triggered by the CDOStateMachine.
Cheers
/Eike
----
http://thegordian.blogspot.com
Martynas schrieb:
> Hi,
>
> Adapter just partly solves the problem.
>
> Suppose I have an attribute ID, which must be registered somewhere
> when the object is loaded.
> As loading does not set any feature, the adapter is not notified.
> Is there any listener I can register to know the object is loaded.
> Overriding InternalCDOLoadable.cdoInternalPostLoad() does not seem to
> be a proper way.
>
> Thanks,
> Martynas
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03695 seconds