|
|
|
Re: TransactionalEditingDomain Lifecycle [message #517908 is a reply to message #517846] |
Tue, 02 March 2010 13:56 |
|
Hi, Sven,
The Lifecycle is an adapter interface that is optionally implemented by
a TransactionalEditingDomain (an API evolution strategy). The stock
domain implementation does provide a Lifecycle adapter.
The way to access it is like
TransactionalEditingDomain domain = ... ;
TransactionalEditingDomainListener listener = ... ;
TransactionalEditingDomain.Lifecycle lifecycle =
TransactionUtil.getAdapter(domain,
TransactionalEditingDomain.Lifecycle.class);
if (lifecycle != null) {
lifecycle.addTransactionalEditingDomainListener(listener);
}
Your listener, then, will be notified of the domain-disposing event.
HTH,
Christian
On 02/03/10 05:28 AM, Sven Krause wrote:
> Thanks Robert,
>
> got it. I'm just asking myself, if the Lifecyle is not proposed to be
> used outside, since the getLifecyle() is protected and final at the
> TransactionalEditingDomainImpl. Its not the issue, since I'm already
> using a customized domain factory. But how about not being able to do so
> - e.g. using an external (closed source) domain factory?
>
> Sven
|
|
|
|
Re: TransactionalEditingDomain Lifecycle [message #517981 is a reply to message #517957] |
Tue, 02 March 2010 16:04 |
|
Ah! Sorry, Sven,
You must have a domain implementation that was created prior to the EMF
Transaction 1.3 release and (a) implemented the
TransactionalEditingDomain interface without extending the stock impl
class, and (b) wasn't updated to provide the new-in-1.3 adapter interface.
I'm afraid that the domain implementation, itself, must provide the
adapter. I'm afraid it would be hard for an external object to
intercept these life-cycle events ... unless, of course, the
implementation provides API that makes it feasible.
Cheers,
Christian
On 02/03/10 10:27 AM, Sven Krause wrote:
> Hi Christian,
>
> thats exact the point. Asking the editing domain for adapting the
> Lifecyle type does not return an instance. Who needs to register this
> adapter? Is it done internally or is it in the domain factories response?
>
> Sven
|
|
|
Powered by
FUDForum. Page generated in 0.02186 seconds