Search in sources :

Example 36 with TimerConfig

use of javax.ejb.TimerConfig in project muikku by otavanopisto.

the class SchoolDataSearchReindexListener method startTimer.

private void startTimer(int duration) {
    if (this.timer != null) {
        try {
            this.timer.cancel();
        } catch (Exception e) {
        }
        this.timer = null;
    }
    TimerConfig timerConfig = new TimerConfig();
    timerConfig.setPersistent(false);
    this.timer = timerService.createSingleActionTimer(duration, timerConfig);
}
Also used : TimerConfig(javax.ejb.TimerConfig)

Example 37 with TimerConfig

use of javax.ejb.TimerConfig in project muikku by otavanopisto.

the class AbstractTimedNotificationStrategy method startTimer.

private void startTimer(long duration) {
    if (this.timer != null) {
        this.timer.cancel();
        this.timer = null;
    }
    TimerConfig timerConfig = new TimerConfig();
    timerConfig.setPersistent(false);
    this.timer = timerService.createSingleActionTimer(duration, timerConfig);
}
Also used : TimerConfig(javax.ejb.TimerConfig)

Aggregations

TimerConfig (javax.ejb.TimerConfig)37 ScheduleExpression (javax.ejb.ScheduleExpression)13 Date (java.util.Date)8 PostConstruct (javax.annotation.PostConstruct)7 Test (org.junit.Test)7 Timer (javax.ejb.Timer)6 InitialContext (javax.naming.InitialContext)6 ModelNode (org.jboss.dmr.ModelNode)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 InSequence (org.jboss.arquillian.junit.InSequence)2 MethodDescriptor (com.sun.enterprise.deployment.MethodDescriptor)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 ObjectOutputStream (java.io.ObjectOutputStream)1 Serializable (java.io.Serializable)1 Method (java.lang.reflect.Method)1 Calendar (java.util.Calendar)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1