| Standalone from Java [message #1080100] |
Mon, 05 August 2013 09:19  |
Eclipse User |
|
|
|
Hello
I'm currently trying to integrate Epsilon scripts into a more general Java application.
I'v downloaded the sources and taken a look at the examples (in particular org.eclipse.epsilon.examples.standalone).
I have written a few classes inspired by this example that are supposed to do the exact same thing as the builtin "Launch configuration" in eclipse. However, I have some subtle differences when I run my module from Java:
- The application never stops
After investigating, it happens only when I use collections in my script. It appears that a cache is created (org.eclipse.epsilon.eol.util.Cache). This one creates a disposal thread that is never stopped, it seems that the "dispose" method of the cache is never called. Since the thread is not daemon, the application hangs...
What am I doing wrong? I'm already calling
module.getContext().getModelRepository().dispose();
So is there anything more to dispose?
- The cross-references use absolute path
When I use the eclipse launch configuration, cross-references are serialized as a relative path. From java, it's an absolute path, which may be valid but is undesirable as Exeed and EMF editors don't understand it.
I can't find a way to force using relative URI...
I attached to this post a minimal example of my code in case it helps. The example is quite complex already, sorry but that was necessary to expose the problems.
Best regards
[Updated on: Mon, 05 August 2013 09:20] by Moderator
|
|
|
| Re: Standalone from Java [message #1080280 is a reply to message #1080100] |
Mon, 05 August 2013 14:33   |
Eclipse User |
|
|
|
Hi Gaetan,
I'm sorry to hear that you're having problems. Let's see:
1. The thread created by the Cache class is a daemon thread since SVN r2103 (December 2012), AFAIK. It is created from the createCleanUpThread method, which is only called from this code:
cleanUpThread = createCleanUpThread();
cleanUpThread.setDaemon(true);
cleanUpThread.start();
SVN r2103 is only available as an interim version, though. Are you using Epsilon 1.0 stable (November 2012), or an interim version? I think you should be able to fix this issue by simply upgrading to the latest interim.
The Cache is disposed from ExtendedProperties#clear(), and has nothing to do with the model repository. You can access the ExtendedProperties using module.getContext().getExtendedProperties(), but I think we should do this from the dispose() method of the EolContext anyway. Could you file a bug for this and add a link to this thread?
2. I'm not sure about this one, actually. There must be something going on in the launch configuration that is being set up differently to your standalone configuration. Could you add your run configuration to your example? Please remember that you need to use the "Common" tab in your launch configuration and use the "Save as > Shared file" option to save it into your project.
Kind regards,
Antonio
|
|
|
| Re: Standalone from Java [message #1080655 is a reply to message #1080280] |
Tue, 06 August 2013 04:08   |
Eclipse User |
|
|
|
Hi Antonio,
Thanks for your quick answer, here comes the launch configuration attached.
I am using the Epsilon 1.0 stable (November 2012) indeed.
Regarding question 1, what I don't understand is that the cache seems to be disposed properly when running from the launch configuration. So that must be something wrong on my behalf, not only a "daemon thread" problem. Not sure I should file a bug for that?
I also have another more general question regarding the example I sent:
In the ETL module, I use an operation that takes as argument an Enum literal. If I try to declare the type of the argument (OUT!ECommodityQuality), it fails with a "Type OUT!ECommodityQuality not found". Current workaround is to declare an untyped argument but I'd like to understand...
In particular, at line 19, I use this type without any problem => So what's wrong?
[Updated on: Tue, 06 August 2013 04:12] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05399 seconds