Hi Matthew, DeltaSpike has this feature but it is not built-in in the spec: https://deltaspike.apache.org/documentation/core.html#AsynchronousOperations
Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://blog-rmannibucau.rhcloud.com> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2017-08-30 9:39 GMT+02:00 Matthew Broadhead <[email protected]> : > Hi, > I have converted most of my old EJB stuff to CDI but the one thing that is > still using EJB are these @Asynchronous @Singleton things. Please could > anyone provide a "CDI way" example to accomplish the same result? > > import javax.ejb.AccessTimeout; > import javax.ejb.Asynchronous; > import javax.ejb.Lock; > import javax.ejb.LockType; > import javax.ejb.Singleton; > > @Singleton > public class SomethingAsync { > > @Asynchronous > @Lock(LockType.READ) > @AccessTimeout(-1) > public void addJob(String value) { > // this job takes a while > doSomething(value); > } > > public void doSomething(String value) { > System.out.println(value); > } > } > >
