This content has been marked as final.
Show 2 replies
-
1. Re: Running a background task within a SEAM application
toby.tobias.hill.gmail.com Dec 8, 2008 8:25 AM (in response to marios)You cannot schedule from the same component as your do-some-work-method is in ... you know ... you need to get through the layers of interceptors to allow seam do its work. When doing a direct invocation you are not calling the method through all its interceptors.
I have applied a inner class pattern for all my background needs.
As a draft:
@name("foo") public class Foo { @Asynchronous public doWork(@IntervalDuration ... ) {...} @Startup @Scope(APPLICATION) @Name("fooKicket") public static class FooKicker { @Create public void init() { doWork( ... ) } } }
Good luck.
-
2. Re: Running a background task within a SEAM application
marios Dec 9, 2008 9:51 AM (in response to marios)Great! It works perfectly with the
static kicker class
pattern! Thanks Tobias, +1 for me!Just as side note: it this behavior documented anywhere?