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);
    }
}

Reply via email to