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.

minimal example caller.java 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

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -