I need to create a task executor where it will call a method from time to time, I saw an example and it became my implementation:
public class Agendador {
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
final Runnable beeper = new Runnable() {
@Override
public void run() {
EncomendaController controller = new EncomendaController();
controller.pesquisar();
}
};
final ScheduledFuture<?> beeperHandle = scheduler.scheduleAtFixedRate(beeper, 0, 1, TimeUnit.MINUTES);
}
How can I make wildfly
read this class to start performing this task?