Package javax.ejb

Examples of javax.ejb.TimerConfig


        private Timer timer;
        private int ok = 0;

        @PostConstruct
        public void start() {
            timer = ts.createIntervalTimer(3000, 1000, new TimerConfig(System.currentTimeMillis(), false));
        }
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 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

            }
        }

        private void createTimer() {
            try {
                this.timer = this.timerService.createSingleActionTimer(100, new TimerConfig(TIMER_NAME, false));
            } catch (final Exception e) {
                throw new RuntimeException("SingleActionTimer: Failed to create timer", e);
            }
        }
View Full Code Here

    public void initialize(String info) {
        ScheduleExpression sexpr = new ScheduleExpression();
        // set schedule to every 10 seconds for demonstration
        sexpr.hour("*").minute("*").second("0/10");
        // persistent must be false because the timer is started by the HASingleton service
        timerService.createCalendarTimer(sexpr, new TimerConfig(info, false));
    }
View Full Code Here

    @Resource
    TimerService timerService;

    public void startTimer()
    {
        TimerConfig timerConfig = new TimerConfig();
        ScheduleExpression scheduleExpression = new ScheduleExpression();

//        Timer timer = timerService.createCalendarTimer();
    }
View Full Code Here

      org.jboss.ejb3.timerservice.extension.TimerService ejb31TimerService = (org.jboss.ejb3.timerservice.extension.TimerService) timerService;
      // process each auto timer
      for (TimerMetaData autoTimerMetaData : autoTimersMetaData)
      {
         // create a timer config
         TimerConfig timerConfig = new TimerConfig();
         timerConfig.setPersistent(autoTimerMetaData.isPersistent());
         String info = autoTimerMetaData.getInfo();
         if (info != null && !info.isEmpty())
         {
            timerConfig.setInfo(autoTimerMetaData.getInfo());
         }
         NamedMethodMetaData timeoutMethodMetaData = autoTimerMetaData.getTimeoutMethod();
         // get hold of the timeout method for this auto-timer
         Method timeoutMethod = this.getTimeoutMethod(timeoutMethodMetaData, container.getBeanClass());
         if (timeoutMethod == null)
View Full Code Here

    @Resource
    private BeanManager beanManager;

    public void scheduleEvent(ScheduleExpression schedule, Object event, Annotation... qualifiers) {

        timerService.createCalendarTimer(schedule, new TimerConfig(new EventConfig(event, qualifiers), false));
    }
View Full Code Here

    @Resource
    private TimerService timerService;

    @PostConstruct
    private void construct() {
        final TimerConfig plantTheCorn = new TimerConfig("plantTheCorn", false);
        timerService.createCalendarTimer(new ScheduleExpression().month(5).dayOfMonth("20-Last").minute(0).hour(8), plantTheCorn);
        timerService.createCalendarTimer(new ScheduleExpression().month(6).dayOfMonth("1-10").minute(0).hour(8), plantTheCorn);

        final TimerConfig harvestTheCorn = new TimerConfig("harvestTheCorn", false);
        timerService.createCalendarTimer(new ScheduleExpression().month(9).dayOfMonth("20-Last").minute(0).hour(8), harvestTheCorn);
        timerService.createCalendarTimer(new ScheduleExpression().month(10).dayOfMonth("1-10").minute(0).hour(8), harvestTheCorn);

        final TimerConfig checkOnTheDaughters = new TimerConfig("checkOnTheDaughters", false);
        timerService.createCalendarTimer(new ScheduleExpression().second("*").minute("*").hour("*"), checkOnTheDaughters);
    }
View Full Code Here

                    expr.dayOfWeek(scheduleInfo.dayOfWeek);
                    expr.dayOfMonth(scheduleInfo.dayOfMonth);
                    expr.month(scheduleInfo.month);
                    expr.year(scheduleInfo.year);

                    TimerConfig config = new TimerConfig();
                    config.setInfo(scheduleInfo.info);
                    config.setPersistent(scheduleInfo.persistent);

                    data.add(new ScheduleData(config, expr));
                }

                schedules.add(new MethodSchedule(method, data));
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.