-
1. Re: Send mail asynchronous
danielc.roth Sep 23, 2008 11:50 PM (in response to bashan)Look in the mail example that comes with Seam. There is an async example.
-
2. Re: Send mail asynchronous
tony.herstell1 Sep 24, 2008 12:45 AM (in response to bashan)Asynch Main and Mail in general has had a few niggles.
Ensure you use the latest code from the main branch as this is supposed to have fixed a number of things. -
3. Re: Send mail asynchronous
bashan Sep 26, 2008 5:55 PM (in response to bashan)Hi,
I just want to know if I should be concerned if mail is sent in async mode to the scopes. For example that EVENT scope won't be available while mail is being sent... -
4. Re: Send mail asynchronous
accless Sep 27, 2008 6:38 AM (in response to bashan)In general, the only scopes that are available in any asynchronous call are:
1) buisness process
2) Application-scopeso u have to give all the data u need as a parameter of the async-Method or store the datas and retrieve them later in your async-Method
greetings
-
5. Re: Send mail asynchronous
bashan Sep 27, 2008 12:21 PM (in response to bashan)Hi Rene,
I am trying to understand if this code taken from Seam examples will work, because I will have something pretty similar (this code puts data in the event context, I am trying to understand if the event context will keep existing even request ended):
@Name("asynchronousMailProcessor") @AutoCreate public class AsynchronousMailProcessor { @Asynchronous public void scheduleSend(@Duration long delay, Person person) { try { Contexts.getEventContext().set("person", person); Renderer.instance().render("/simple.xhtml"); } catch (Exception e) { e.printStackTrace(); } } }
Thanks,
Guy. -
6. Re: Send mail asynchronous
danielc.roth Sep 28, 2008 11:11 PM (in response to bashan)It's not the same Event context. The call to scheduleSend will occur in one event context, which end when the response has been sent to the browser.
The actual execution of scheduleSend, which may occur long time into the future, will have another Event context.