java - concurrent threads for a method of EJB -
java - concurrent threads for a method of EJB -
i have stateless ejb method process data. method works 5..20 seconds
i need have 10 threads, executes method concurrently. made annotation method @schedule(second = "*", min = "*", hr = "*") container (glassfish 4) launches 1 thread method.
i tried utilize annotation @asynchronous, create no effect
what should do?
write sec class using @schedule(second = "*", min = "*", hr = "*") phone call @asynchronous ejb method - then, if duration said, should start new thread every second.
public class caller { @ejb asyncejb asyncejb; @schedule(second = "*", min = "*", hr = "*") public void call() { this.asyncejb.call(); } } asyncejb.java @stateless public class asyncejb { @asynchronous public void call() { // long running stuff. } } java concurrency ejb
Comments
Post a Comment