Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » How to manually register blackbox units?
How to manually register blackbox units? [message #904464] Tue, 28 August 2012 13:19 Go to next message
Eclipse UserFriend
Hello,

I want to use java blackbox units. However, I'm using QVTo not within
Eclipse, but withing an EJB Java Application. So I can't use the
org.eclipse.m2m.qvt.oml.javaBlackboxUnits extension point.

I found the BlackboxRegistry class, but I saw this very discouraging
piece of code:

private BlackboxRegistry() {
try {
if(EMFPlugin.IS_ECLIPSE_RUNNING) {
fProviders = Eclipse.readProviders();
} else {
fProviders = Collections.emptyList();
}
} catch (RuntimeException e) {
fProviders = Collections.emptyList();
QvtPlugin.error(e);
}
}

Usages of BlackboxRegistry.INSTANCE also seem not to allow me to
intercept this in any way.

Hopefully I have missed something important, any hints greatly appreciated!

Marius
Re: How to manually register blackbox units? [message #904611 is a reply to message #904464] Tue, 28 August 2012 20:19 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4184
Registered: July 2009
Senior Member
Hi

The code seems to be unhelpful. Although most of BlackboxRegistry is
public, the private constructor seems to prevent
you enhancing it.

The EMF extension points use extensions as just one way of populating a
registry. Unfortunately the BlackboxRegistry does
not follow this idiom. If you care to submit a patch emulating EMF
registries, it should solve your problems and be available
for others.

Please submit a Bugzilla anyway.

Regards

Ed Willink



On 28/08/2012 14:19, Marius Gröger wrote:
> Hello,
>
> I want to use java blackbox units. However, I'm using QVTo not within
> Eclipse, but withing an EJB Java Application. So I can't use the
> org.eclipse.m2m.qvt.oml.javaBlackboxUnits extension point.
>
> I found the BlackboxRegistry class, but I saw this very discouraging
> piece of code:
>
> private BlackboxRegistry() {
> try {
> if(EMFPlugin.IS_ECLIPSE_RUNNING) {
> fProviders = Eclipse.readProviders();
> } else {
> fProviders = Collections.emptyList();
> }
> } catch (RuntimeException e) {
> fProviders = Collections.emptyList();
> QvtPlugin.error(e);
> }
> }
>
> Usages of BlackboxRegistry.INSTANCE also seem not to allow me to
> intercept this in any way.
>
> Hopefully I have missed something important, any hints greatly appreciated!
>
> Marius
Re: How to manually register blackbox units? [message #904816 is a reply to message #904611] Wed, 29 August 2012 07:49 Go to previous messageGo to next message
Eclipse UserFriend
On 28.08.2012 22:19, Ed Willink wrote:
> The EMF extension points use extensions as just one way of populating
> a registry. Unfortunately the BlackboxRegistry does not follow this
> idiom. If you care to submit a patch emulating EMF registries, it
> should solve your problems and be available for others.

I needed Blackboxes just to tell QVT how to create a few custom types. I
was able to get rid of those types so I now only use plain Ecore types,
and my need for Blackboxes has gone. Should I need them again in the
future, I will attempt to fix this. Glancing over the EP processing code
I noticed that a great many internal data types are used there. To
properly allow manual registering of a (Java)BlackboxProvider, some
refactoring will be required I guess.

> Please submit a Bugzilla anyway.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=388293

Regards
Marius
Re: How to manually register blackbox units? [message #922973 is a reply to message #904816] Tue, 25 September 2012 13:55 Go to previous messageGo to next message
thomas legrand is currently offline thomas legrandFriend
Messages: 10
Registered: September 2010
Junior Member
Hi,

I developed that patch by modifying the JavaBlackboxRegistry and JavaBlackboxProvider classes in org.eclipse.m2m.qvt.oml. The blackbox libraries are now searched in the whole classpath.

This patch works and it's actually deployed on our online modeler at www.genmymodel.com .

Would you be interested by this patch ? Where should I submit it ?

Tom
Re: How to manually register blackbox units? [message #923105 is a reply to message #922973] Tue, 25 September 2012 15:51 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4184
Registered: July 2009
Senior Member
Hi

Any patch should be submitted as a patch attached to a Bugzilla. For a
couple of hundred lines it may be sufficient to state that you are the
sole author and consent to the code being made available under EPL.

For larger contributions, the above process will need to be followed up
to ensure written consent from your employer.

The QVTo team has very limited resources, so to facilitate adoption
please provide one or more JUnit tests that fail until the new code is
included.

Regards

Ed Willink


On 25/09/2012 14:55, thomas legrand wrote:
> Hi,
>
> I developed that patch by modifying the JavaBlackboxRegistry and
> JavaBlackboxProvider classes in org.eclipse.m2m.qvt.oml. The blackbox
> libraries are now searched in the whole classpath.
>
> This patch works and it's actually deployed on our online modeler at
> www.genmymodel.com .
>
> Would you be interested by this patch ? Where should I submit it ?
>
> Tom
Re: How to manually register blackbox units? [message #945689 is a reply to message #922973] Mon, 15 October 2012 14:36 Go to previous message
Eclipse UserFriend
On 25.09.2012 15:55, thomas legrand wrote:
> Hi,
>
> I developed that patch by modifying the JavaBlackboxRegistry and
> JavaBlackboxProvider classes in org.eclipse.m2m.qvt.oml. The blackbox
> libraries are now searched in the whole classpath.
>
> This patch works and it's actually deployed on our online modeler at
> www.genmymodel.com .
>
> Would you be interested by this patch ? Where should I submit it ?
>
> Tom

Hello Thomas,

sorry for the late response - I would indeed be interested in this
patch. Can you append it to this ticked as a partial solution:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=388293

Thanks
Marius
Previous Topic:Possibility to generate Circular Referenced target model
Next Topic:[QVTo] trace model and proxies
Goto Forum:
  


Current Time: Thu Dec 18 02:28:04 GMT 2014

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

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