The name is somewhat misleading. Currently, the bean is not scoped to the current thread but to the java.lang.Runnable.run() invocation. See also org.jboss.weld.environment.se.contexts.ThreadScoped and org.jboss.weld.environment.se.threading.RunnableDecorator.
It would be also meaningful to provide a more easier way to start/stop the context. E.g. a bean with method which would accept a Runnable lambda and start/stop the context automatically.
|