views:

34

answers:

1

As i clearly mentioned above, I would be glad to hear your ideas about that.

btw, some other ones say; "call Component.getInstance(Facade,true) from your inner class." However, I dont understand it actually..

Thanks

+1  A: 

Once the injection has happened, it's just a reference like any other, so there's no reason why it should not work.

Michael Borgwardt
"an inner class doesn't have access to non-final locals" i heard
Bariscan
@Bariscan: That refers to anonymous classes using local variables of the method they're defined in. It doesn't have anything to do with your question.
Michael Borgwardt
Sorry, I think I am confused a bit; can we say a stateless session bean is a final local? Otherwise, what is the mean of "final local" in the sentence I wrote in the previous comment?I would be glad if you can help me to clarify these.Thanks in advance.
Bariscan
In my case, I use Swing Timer and it must be a class which extends TimerTask. I have to call this class's run method from a method of an outer class. And in my outer class there are session beans injected. And when the run method is executed of Timer class(which is the inner class of the class contains injected sessionBeans) I update an entity using injected EJB's methods. As a result, in order to be able to use injected ejbs is it correct and enough to place Timer class as an inner class?I hope I could explain clearly.Thanks again and again.
Bariscan
@Bariscan: as I said, the previous comment does not seem to have anything to do with your question. "final local" is a local variable i.e. defined within a method using the final keyword.
Michael Borgwardt
@Bariscan: as for your explanation of your situation, if the inner class is not static, it can access instance variables of the outer class, so what you want to do should work. Why don't you just try it?
Michael Borgwardt
You are exactly right. I see now my questions're like a joke, how careless I am.. Thanks for your patience. Cheers.
Bariscan