Re: using injected services in a child thread

2010-05-28 Thread Douglas Ferguson
Going back to my original example.. With the Application.set() trick I am able to keep it from blow up, but why would "MyService" call Application.get() (and thus blow up). When the DAOs don't. They are both @Inject and they are both setup in my guice module as "singleton" D/ On May 28, 2010,

Re: using injected services in a child thread

2010-05-28 Thread Alex Objelean
(); } }; Alex -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/using-injected-services-in-a-child-thread-tp2233924p2235261.html Sent from the Wicket - User mailing list archive at Nabble.com. - To

Re: using injected services in a child thread

2010-05-28 Thread Douglas Ferguson
t/clear the > Application's ThreadLocal variable so that it's available during the > execution of the task. " > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/using-injected-services-in-a-child-thread-tp2233924p2235201.html &

Re: using injected services in a child thread

2010-05-28 Thread Alex Objelean
this message in context: http://apache-wicket.1842946.n4.nabble.com/using-injected-services-in-a-child-thread-tp2233924p2235201.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-uns

Re: using injected services in a child thread

2010-05-28 Thread Douglas Ferguson
iew this message in context: > http://apache-wicket.1842946.n4.nabble.com/using-injected-services-in-a-child-thread-tp2233924p2235168.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > - &

Re: using injected services in a child thread

2010-05-28 Thread Douglas Ferguson
What are you agreeing with? I can't see the thread... On May 28, 2010, at 3:30 PM, Alex Objelean wrote: > > Yes, I agree. I do prefer this solution too. > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/using-injected-services-in-a-child-thre

Re: using injected services in a child thread

2010-05-28 Thread Alex Objelean
No, it is about Sven Maier's solution: http://pastebin.com/NN58fiZx -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/using-injected-services-in-a-child-thread-tp2233924p2235168.html Sent from the Wicket - User mailing list archive at Nabbl

Re: using injected services in a child thread

2010-05-28 Thread Alex Objelean
Yes, I agree. I do prefer this solution too. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/using-injected-services-in-a-child-thread-tp2233924p2235166.html Sent from the Wicket - User mailing list archive at Nabble.com

Re: using injected services in a child thread

2010-05-28 Thread James Carman
On Fri, May 28, 2010 at 4:25 PM, Alex Objelean wrote: > > 2) Let the client code to create the Future. Though it is a good approach, I > don't like the fact that the client is responsible for implementing such > details each time it overrides the execute() method. It would be cleaner to > move thi

Re: using injected services in a child thread

2010-05-28 Thread James Carman
That's what the other one did, but it used the callback methods to do the set/unset. This way, you don't have to clutter up each task's code. On Fri, May 28, 2010 at 4:23 PM, Douglas Ferguson wrote: > This worked for me.. > > >                                                                    

Re: using injected services in a child thread

2010-05-28 Thread Alex Objelean
e the fact that the client is responsible for implementing such details each time it overrides the execute() method. It would be cleaner to move this logic inside the component.. Alex -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/using-injected-services-in

Re: using injected services in a child thread

2010-05-28 Thread Douglas Ferguson
This worked for me.. @Override public void run() {

Re: using injected services in a child thread

2010-05-28 Thread Douglas Ferguson
s message in context: > http://apache-wicket.1842946.n4.nabble.com/using-injected-services-in-a-child-thread-tp2233924p2235118.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > - &

Re: using injected services in a child thread

2010-05-28 Thread Alex Objelean
in context: http://apache-wicket.1842946.n4.nabble.com/using-injected-services-in-a-child-thread-tp2233924p2235118.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user

Re: using injected services in a child thread

2010-05-28 Thread Douglas Ferguson
Even if I got that to work, it doesn't explain why some things using @Inject blow up and others don't. There has to be a reason for this. Under what circumstances to an injected object need a reference to the Application? D/ On May 28, 2010, at 11:34 AM, James Carman wrote: > Perhaps you woul

Re: using injected services in a child thread

2010-05-28 Thread Douglas Ferguson
I found this: http://pastebin.com/NN58fiZx But I don't see anything that would tied the Application to the child thread. It is just a button that would exec a thread for you. D/ On May 28, 2010, at 1:06 PM, Douglas Ferguson wrote: > I've been following the thread to some degree, but I missed

Re: using injected services in a child thread

2010-05-28 Thread Douglas Ferguson
I've been following the thread to some degree, but I missed that. Is there a code example somewhere? D/ On May 28, 2010, at 11:34 AM, James Carman wrote: > Perhaps you would be interested in the other threads that have been > going on where we discuss InheritableThreadLocal. In there Jeremy >

Re: using injected services in a child thread

2010-05-28 Thread James Carman
Perhaps you would be interested in the other threads that have been going on where we discuss InheritableThreadLocal. In there Jeremy gave a good solution that would fix what you're seeing. Basically, you use the beforeExecute()/afterExecute() methods to set/clear the Application's ThreadLocal va

Re: using injected services in a child thread

2010-05-28 Thread Douglas Ferguson
I'm still spinning my wheels on this one. Let me try to explain better.. On the page I have @Inject DAOFactory @Inject MyService On the DAOFactory I have @Inject DAO1 @Inject DAO2 etc... On MyService I have @Inject DAO1 In my module I have bind(MyService.class).toInstance(new MyService());

using injected services in a child thread

2010-05-27 Thread Douglas Ferguson
I'm using 1.4.8 (not the ITL version). I have pass a runnable to an executer, how can I make use of classes that use @Inject? When I try to do so, it blows up saying "There is no application attached to current thread pool-13-thread-1" The confusing thing is that I inject 2 DAOs and 1 service.