Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Debug configurations and passing System properties to JET2
Debug configurations and passing System properties to JET2 [message #54127] Tue, 16 December 2008 10:04 Go to next message
Paul Hammond is currently offline Paul HammondFriend
Messages: 17
Registered: July 2009
Junior Member
Hi,

I notice that although one can create a JET2 transformation in 'Run
configurations', there is no such item in 'Debug configurations. Any plans
for one or reasons there isn't one?

Secondly, is there anyway that one can set Java System properties for any
JET2 transformation?

I guess one can manually set them in ones TagFactory (although this can be
too late in some cases) but it would be nice to be able to define them in
say a Run configuration or set them as part of the JET2 preferences.

Paul
Re: Debug configurations and passing System properties to JET2 [message #54256 is a reply to message #54127] Tue, 16 December 2008 14:19 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Paul:

There isn't a JET debugger, and there is no plan for this release (Galileo,
June 2009).

As for setting system properties, again, there is nothing in plan. Perhaps a
tag executed early in the main template would do the trick? Personally, I'm
reluctant to play with system properties (that is, widely known ones) in
Eclipse - I'm never sure of what the impact of such a change would have on
plug-ins I don't know about or understand.

I have considered letting users predefine JET variables in the launch
configuration. Would this meet your needs?

Paul

"Paul Hammond" <paul_hammond@hotmail.com> wrote in message
news:561b8fc3999ec94b78b30187956e0ae6$1@www.eclipse.org...
> Hi,
>
> I notice that although one can create a JET2 transformation in 'Run
> configurations', there is no such item in 'Debug configurations. Any plans
> for one or reasons there isn't one?
>
> Secondly, is there anyway that one can set Java System properties for any
> JET2 transformation?
>
> I guess one can manually set them in ones TagFactory (although this can be
> too late in some cases) but it would be nice to be able to define them in
> say a Run configuration or set them as part of the JET2 preferences.
>
> Paul
>
>
>
>
Re: Debug configurations and passing System properties to JET2 [message #54361 is a reply to message #54256] Tue, 16 December 2008 19:05 Go to previous messageGo to next message
Paul Hammond is currently offline Paul HammondFriend
Messages: 17
Registered: July 2009
Junior Member
Hi Paul,

Re System properties, where I'm coming from is say an example like Java
logging. Supposing you want to control the configuration of the LogManager
via the system property java.util.logging.config.file, a reasonable thing
to want to do, right now you can't do this in JET.

Even if I explicitly set this configuration myself, how do I know that
either JET2 or some other third party lib has not already called
Logger.getLogger() and set up their Loggers with a configuration I don't
want to use.

At best I can call reset() on the LogManager somewhere, set the System
property and then use the readConfiguration to read in my own config , but
then I'm doing extra work and going around the standard way of doing
things, that sort of thing. Also any Loggers that have been statically
created before I do this won't change as their Handlers will be inside
them already created. It will only affect future Loggers I create etc.

One may have many third party libraries in ones tags etc that have to run
in the JET plugin, and may absolutely require System properties to be set.

Applications like Tomcat for instance allow this when deploying ones
webapps. JET2 in a way, is kind of like a container, but for custom tags
rather than webapps.

In terms of your reluctance, I understand where you're coming from, but
there's a side where you can take the assumption that people know what
they're doing if they set these properties. If they don't, then they will
pay the ultimate penalty when their program doesn't work.

Setting System properties is a key standard part of Java and not I think a
bad thing in and of itself, so I think there's a reasonable case to
support it in something like JET where you have users interfacing in their
own code and needing to configure standard libraries in a standard way.

Have I persuaded you at all?

Paul
Re: Debug configurations and passing System properties to JET2 [message #54548 is a reply to message #54361] Wed, 17 December 2008 17:47 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Paul:

I'm going to have to think about this a bit. In my mind, its not JET that is
the equivalent of the servlet environment, it is Eclipse/OSGi. I'm not sure
how that uses system properties. I remain highly suspious of any mechanism
involving setting/reading what is essentially a global variable - especially
when in a multi-threaded environment.

I'll make this my holiday project :-)

Paul
Re: Debug configurations and passing System properties to JET2 [message #54574 is a reply to message #54548] Wed, 17 December 2008 17:57 Go to previous message
Paul Hammond is currently offline Paul HammondFriend
Messages: 17
Registered: July 2009
Junior Member
Hi Paul,

For most things I guess, users will run up a Java application via a run
configuration, where they can pass in -D no problem.

It's only in the case of something like JET, where one can't run things
via a normal Java command line that this is an issue.

So I guess in general the question boils down to, where should System
properties be set when you run something in Eclipse where you can't use a
normal Java command line, and you need to add custom code to an existing
plugin?

Enjoy your holiday!

Paul
Previous Topic:Using your own context or writer
Next Topic:[Announce] M2T XPAND 0.7.0M4 is available
Goto Forum:
  


Current Time: Wed Nov 26 20:40:45 GMT 2014

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

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