Re: Continue Eclipse Freemarker DLTK?
Daniel Dekany <[email protected]> Wed, 31 Jul 2013 12:16:26 +0200
| Newsgroups | gmane.comp.web.freemarker.devel |
|---|---|
| Message-ID | <[email protected]> |
Tuesday, July 30, 2013, 9:27:38 PM, Angelo zerr wrote:
> The current code of Freemarker DLTK create an instance of
> DbgpDebuggerService each time you debug
> a ftl template. I have done that because if you wish to debug
> several ftl in the same time (like you can debug several Java class in same time).
>
> But perhaps it's a mistake and I could use a singleton of
> DbgpDebuggerService and so I agree with you, we can have a static instance of
> DebuggerServiceRegistry that it is filled with Java code with a setter, or with systemproperties.
When you launch a template in that dummy environment, does that run in
its own JVM, or at least does it have its own class-loader for
freemarker.jar? Because then you could just set the
DebuggerServiceSingleton.setInstance(), yet only affect that running
application. Otherwise we got a problem without setting it in the
configuration. Maybe we could use TLS. So you could have:
DebuggerService prev = DebuggerServiceSingleton.setThreadLocalInstance(myDebuggerService);
try {
...
Do whatever you want here, like even with multiple
Configuration-s.
DebuggerServiceSingleton.getInstance() will return the instance
from the TLS now.
...
} finally {
DebuggerServiceSingleton.setThreadLocalInstance(prev);
}
Would that work?
--
Thanks,
Daniel Dekany
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk