Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2m-atl-dev] Resource cleanup

This is just a comment on the cleanup code in ASMEMFModel, dispose method.

Again, this is obviously aimed at environments where ATL is in control and
is not conducive to environments where ATL is used as one tool amongst
many. Our scenario - we load a model into a GMF diagram from an external
source file, transforming it via ATL on the way. We have already modified
the ASMEMFModel wrapper code and AtlLauncher so that EMF resources can be
passed and returned rather than dealing with real file resources - in this
case we pass an input file URL and get the resource returned. The "unload"
flag has been exposed so that the interim calling mechanism can ensure the
retrieved resource in not unloaded.

However, without further modification, the dispose method WILL unload
metamodel resources that it loads, and unregister EMF packages that GMF
subsequently requires to do its work. There is no built in mechanism (such
as the unload flag), to prevent this - it causes a mess in GMF if it is
allowed to happen.

Our solution is to make the unload flag affect ALL EMF resource cleanup
behaviour, not just the unload of the model resource. So NOW our interim
code marks all metamodels us "unload=false", and only file-based model
resources - ones that we definately load/create and do not return to the
user - are marked as unload=true. All other code (the self cleanup) in
dispose is still active.

This has certainly fixed our GMF corruptions while allowing us to make sure
that stuff we really dont want hanging around is properly cleaned up.

Martin

CSC Financial Services SAS
Registered Office: 14 Place de la Coupole, Axe Liberté, 94220 Charenton Le
Pont, France
Registered in France: RCS Créteil B 323 127 332

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind CSC to
any order or other contract unless pursuant to explicit written agreement
or government initiative expressly permitting the use of e-mail for such
purpose.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




Back to the top