Periodically call a function in Java

we need to run one function periodically in a Java web application. How to periodically call a function of a class? Is there a way that calls the function when some event occurred as a high load on the server and so on. What is crontab? Is this periodic work?

+5
source share
8 answers

To call something periodically, see TimerTask

+10
source

If you need something more reliable, you can use Quartz

As for crontab, this is a planning tool on Unix machines.

+5
source

, , . , . (, Tivoli OpenView), "", , () JMS, .

, , , . beahviour , .

+4

-, -. . cron , Unix- . Windows .

+2

- Java

(1) , (web.xml), .

?

(2) Timer .

- ..

(3) , , Java, - ( ..) .

crontab , Java JVM, : JVM.

+2

Spring, , Spring - @Scheduled @Async , , :

http://blog.springsource.com/2010/01/05/task-scheduling-simplifications-in-spring-3-0/

, , cron Spring, , Java EE - ( , , ).

+2

?

: Timer, Java cron, cron4j, Quartz EJB Timer API. : , , ..

, , - , , ..

, JMX . , .

+1

All Articles