Re: Continue Eclipse Freemarker DLTK?
Daniel Dekany <[email protected]> Wed, 31 Jul 2013 18:31:04 +0200
| Newsgroups | gmane.comp.web.freemarker.devel |
|---|---|
| Message-ID | <[email protected]> |
Wednesday, July 31, 2013, 3:09:22 PM, Angelo zerr wrote: > In my case I use the Java Project Classloader to execute the Template with debug mode. > > I'm not sure that it's an answer of your question. I does. So then you should run the template in its own thread, and set its own DebuggerService with TLS as described earlier. Then we can get rid of Configuration.debuggerService. (Why I prefer that over Configuration-level approach is that if we provide DebuggerServiceSingleton.getInstance(), it should *always* return the correct instance. If the DebuggerService sometimes can be overridden on Configuration level, nobody can trust in DebuggerServiceSingleton.getInstance() anymore, and you may feel compelled to pass around a Configuration object.) > I suggest you to wait that I integrate your work about the > gae-tools, and after I could explain you how to debug ftl (for the > moment in the local mode) and explain you the code. > > So after you will able to test your improvment like stepping, are you OK with that? Sure, but it's not needed for me to proceed. Stepping unit tests will have to run without an IDE anyway. > Regards Angelo > > > 2013/7/31 Daniel Dekany <[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 > _______________________________________________ > FreeMarker-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/freemarker-devel > -- 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