1

I am working on spring framework based application.

I have a requirement in which when user logs in to the system, then after certain time gap say 2 minutes or 5 minutes(which should be configurable), another task will start its execution. After that execution completed, result will be published on UI.

So, can anyone tell me the way to implement this in Spring framework.

Sapna Maid
  • 89
  • 11
  • spring AOP+timertasks can possibly provide and solution – Mateen Feb 03 '15 at 09:38
  • Can you please elaborate which API can help me? – Sapna Maid Feb 03 '15 at 09:48
  • You can try creating a scheduled timertask after user login, can refer here - http://docs.oracle.com/javase/6/docs/api/java/util/Timer.html setting some time x mins after current time etc etc. – Nayan Wadekar Feb 03 '15 at 09:50
  • there are many options refer the links and suit yourself http://docs.spring.io/spring/docs/2.0.x/reference/scheduling.html ;; http://examples.javacodegeeks.com/enterprise-java/spring/beans-spring/spring-3-scheduler-example-jdk-timer-and-quartz-showcase/ ;; http://www.javabeat.net/spring-job-scheduling-support-with-jdk-timer-and-quartz/ ;; perform some poc first then i believe you can easily get your job done – Mateen Feb 03 '15 at 10:46

1 Answers1

0

I do not know if there is a specific way to do it in Spring. I usually exploit the JAVA SE 7 interface ScheduledExecutorService There are a lot of samples on the web. One of them is here.

Giovanni
  • 203
  • 1
  • 8