Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [TEXO] Touch ModelPackage
[TEXO] Touch ModelPackage [message #837357] Thu, 05 April 2012 15:21 Go to next message
Gary Godfrey is currently offline Gary GodfreyFriend
Messages: 31
Registered: February 2012
Member
Hi,

Is it possible to dynamically determine which ModelPackage should be initialized? My application will support multiple models and depending on a configuration parameter I want to 'touch' the correct model.

I know I can touch the model directly. e.g.
LibraryModelPackage.initialize();

How though do I use the NS_URI to wake up the relevant model for the current run. I have tried:
ModelPackage mpack = ModelResolver.getInstance().getModelPackage("http:slashslashwww.foo.com/bar");

The namespace being used matches the value in the TEXO generated ModelPackage class.

Regards,
Gary
Re: [TEXO] Touch ModelPackage [message #837370 is a reply to message #837357] Thu, 05 April 2012 15:33 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Gary,
Unfortunately, a model package is not initialized before it really gets touched, and it is not known in any registry if
it is not initialized.
It is not really possible in java to dynamically detect all available subclasses in all jar files. At least not without
doing jar-scanning, I know solutions like Weld from Jboss does these things. But I don't know if java standard this
(afaik it doesn't).

So instead of the nsuri in the configuration, I think a solution can be to use the full class name of the model package.

gr. Martin


On 04/05/2012 05:21 PM, Gary Godfrey wrote:
> Hi,
>
> Is it possible to dynamically determine which ModelPackage should be initialized? My application will support multiple
> models and depending on a configuration parameter I want to 'touch' the correct model.
>
> I know I can touch the model directly. e.g. LibraryModelPackage.initialize();
> How though do I use the NS_URI to wake up the relevant model for the current run. I have tried:
> ModelPackage mpack = ModelResolver.getInstance().getModelPackage("http:slashslashwww.foo.com/bar");
> The namespace being used matches the value in the TEXO generated ModelPackage class.
>
> Regards,
> Gary


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:Can I implement my own TexoResourceManger
Next Topic:Re: [Texo] error while generating JPA Annotated model
Goto Forum:
  


Current Time: Thu Apr 25 01:58:46 GMT 2024

Powered by FUDForum. Page generated in 0.03036 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top