Package javax.ejb

Examples of javax.ejb.TimerConfig


        public void justToCheckZeroTimersInListAtStartup() {
            // no-op
        }

        public void newTimer() {
            final TimerConfig tc = new TimerConfig("my-timer", true);
            final ScheduleExpression se = new ScheduleExpression();
            final Calendar calendar = Calendar.getInstance();
            calendar.add(Calendar.SECOND, 2);
            se.second(calendar.get(Calendar.SECOND) + "/3");
            se.minute("*");
 
View Full Code Here


        public void justToCheckZeroTimersInListAtStartup() {
            // no-op
        }

        public void newTimer() {
            final TimerConfig tc = new TimerConfig("my-timer", true);
            final ScheduleExpression se = new ScheduleExpression();
            final Calendar calendar = Calendar.getInstance();
            calendar.add(Calendar.SECOND, 2);
            se.second(calendar.get(Calendar.SECOND) + "/3");
            se.minute("*");
 
View Full Code Here

        }

        public Timer setTimerNow() {
            final ScheduleExpression schedule = new ScheduleExpression().second("*/3").minute("*").hour("*");

            final TimerConfig timerConfig = new TimerConfig();
            timerConfig.setPersistent(false);

            return timerService.createCalendarTimer(schedule, timerConfig);
        }
View Full Code Here

  @PostConstruct
  public void createProgrammaticalTimer() {
    log.log(Level.INFO, "ProgrammaticalTimerEJB initialized");
    ScheduleExpression everyTenSeconds = new ScheduleExpression()
        .second("*/10").minute("*").hour("*");
    timerService.createCalendarTimer(everyTenSeconds, new TimerConfig(
        "passed message " + new Date(), true));
  }
View Full Code Here

        @Resource
        private TimerService ts;

        @PostConstruct
        public void run() {
            ts.createSingleActionTimer(new Date(System.currentTimeMillis() + 100000L), new TimerConfig(getClass().getSimpleName(), false));
        }
View Full Code Here

    @Inject
    private ApplicationScopedObserver appObserver;

    public void start(SynchronousQueue<Boolean> queue) {
        TimerConfig config = new TimerConfig(queue, false);
        timerService.createSingleActionTimer(100, config);
    }
View Full Code Here

    public void startTimer(String id, int interval) {
        // need to make sure all timers are down (e.g. after redeploy)
        destroyTimer(id);

        // Creating a non-persistent timer, so that it won't survive a restart
        TimerConfig timerConfig = new TimerConfig();
        timerConfig.setPersistent(false);
        timerConfig.setInfo(id);
        timerService.createIntervalTimer(interval, interval, timerConfig);

        LOG.info("Timer for " + id + " started.");

    }
View Full Code Here

                     java.lang.IllegalArgumentException, java.lang.IllegalStateException,
                     javax.ejb.EJBException {
        checkCreateTimerCallPermission();
        checkScheduleExpression(schedule);

        TimerConfig tc = new TimerConfig();
        tc.setInfo(null);

        return createTimerInternal(schedule, tc);
    }
View Full Code Here

    private Timer createTimerInternal(long initialDuration, long intervalDuration,
                             Serializable info)
        throws IllegalArgumentException, IllegalStateException, EJBException {

        TimerConfig tc = new TimerConfig();
        tc.setInfo(info);

        return createTimerInternal(initialDuration, intervalDuration, tc);
    }
View Full Code Here

    private Timer createTimerInternal(Date initialExpiration, long intervalDuration,
                             Serializable info)
        throws IllegalArgumentException, IllegalStateException, EJBException {

        TimerConfig tc = new TimerConfig();
        tc.setInfo(info);

        return createTimerInternal(initialExpiration, intervalDuration, tc);
    }
View Full Code Here

TOP

Related Classes of javax.ejb.TimerConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.