Create an application scoped component marked @Startup the either executes and @Asynchronous method or spawns a thread directly.
Thanks, I'll give that a go! So if I have an application-scoped component that executes an @Asynchronous method of a ScopeType.STATELESS component (ComponentA), how can ComponentA make available something in a context to another component (ComponentB) that it calls.
For example, if ComponentB needs certain objects available in context variables, how can a STATELESS ComponentA, which calls ComponentB, set up the context variables correctly? I'm under the impression that if ComponentA STATELESS it can't outject something to any of the stateful contexts.
Are @Asynchronous methods run asynchronously but not in parallel? If I've got a method scheduled to run every 30 seconds, and I set a breakpoint in my debugger, the next execution of the asynchronous method doesn't start until after the first execution of my method is over.
Shouldn't new threads be created every 30 seconds running the same method, meaning that if the method takes longer than 30 seconds to execute, multiple threads should be running the same method at one time?