-
1. Re: Asynchronous JavaBean method not getting called
gbc1 Aug 25, 2007 8:35 AM (in response to damianharvey)check following
components.xml
- async:timer... declared
- async namespace declared
interface of bean with contains asynch method
- fully annotated with @Asynchronous
- Method parameters fully anotated as needed (see docu)
class of bean with contains asynch method
- fully annoted, also method params
- may return a handler to pasue, resume and cancel the job
calling bean
- bean with asynch method must be injected by Interfsce via @In
- call -> works
Greetz GHad -
2. Re: Asynchronous JavaBean method not getting called
damianharvey Aug 27, 2007 9:24 AM (in response to damianharvey)Thanks for replying.
- Components.xml has async:timer and namespace
- I'm not using an EJB bean, I'm using a JavaBean (see the mail example). So I don't have an interface.
- My method is annotated with @Asynchronous
Thanks,
Damian. -
3. Re: Asynchronous JavaBean method not getting called
pmuir Aug 27, 2007 12:50 PM (in response to damianharvey)In Seam 1.3 its core:timer.
-
4. Re: Asynchronous JavaBean method not getting called
damianharvey Aug 27, 2007 12:53 PM (in response to damianharvey)Oops. Thanks Pete.
-
5. Re: Asynchronous JavaBean method not getting called
gbc1 Aug 27, 2007 12:54 PM (in response to damianharvey)Hello damianharvey,
as far as i know, an asynchronous call will only work if called by interface:
I had a Stateless SessionBean with an annotated asynchronous Method being calld via... new StatelessSessionBean().asynchMethod(); ...
and i didn't work, so I changed to:... @In(create=true) StatelessSessionBeanLocal statelessSessionBean; public void someMethod() { statelessSessionBean.asynchMethod(); }
and it works.
So...
- Make class a Seam Component with @Name
- Try adding an Interface (even if not needed anywhere else) with annotated method
- Use @In at calling side to let seam inject the class
- You may add @Scope(ScopeType.SESSION) to the class
Good luck, just sharing my expiriences...
Greetz, GHad