Examples of CalendarTimer


Examples of org.jboss.as.ejb3.timerservice.CalendarTimer

        super(calendarTimer);
    }

    @Override
    protected void callTimeout() throws Exception {
        CalendarTimer calendarTimer = this.getTimer();

        // if we have any more schedules remaining, then schedule a new task
        if (calendarTimer.getNextExpiration() != null && !calendarTimer.isInRetry()) {
            calendarTimer.scheduleTimeout(false);
        }

        // finally invoke the timeout method through the invoker
        if (calendarTimer.isAutoTimer()) {
            TimedObjectInvoker invoker = this.timerService.getInvoker();
            // call the timeout method
            invoker.callTimeout(calendarTimer, calendarTimer.getTimeoutMethod());
        } else {
            this.timerService.getInvoker().callTimeout(calendarTimer);
        }
    }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.CalendarTimer

        }
    }

    @Override
    protected void postTimeoutProcessing() {
        final CalendarTimer calendarTimer = this.getTimer();
        final TimerState timerState = calendarTimer.getState();
        if (timerState != TimerState.CANCELED
                && timerState != TimerState.EXPIRED) {
            if (calendarTimer.getNextExpiration() == null) {
                calendarTimer.expireTimer();
            } else {
                calendarTimer.setTimerState(TimerState.ACTIVE);
                // persist changes
                timerService.persistTimer(calendarTimer, false);
            }
        }
    }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.CalendarTimer

        super(calendarTimer);
    }

    @Override
    protected void callTimeout() throws Exception {
        CalendarTimer calendarTimer = this.getTimer();

        // if we have any more schedules remaining, then schedule a new task
        if (calendarTimer.getNextExpiration() != null && !calendarTimer.isInRetry()) {
            calendarTimer.scheduleTimeout();
        }

        // finally invoke the timeout method through the invoker
        if (calendarTimer.isAutoTimer()) {
            TimedObjectInvoker invoker = this.timerService.getInvoker();
            if (!(invoker instanceof MultiTimeoutMethodTimedObjectInvoker)) {
                final String msg = "Cannot invoke timeout method because timer: " + calendarTimer
                        + " is an auto timer, but invoker is not of type" + MultiTimeoutMethodTimedObjectInvoker.class;
                ROOT_LOGGER.failToInvokeTimeout(calendarTimer, MultiTimeoutMethodTimedObjectInvoker.class);
                throw MESSAGES.failToInvokeTimeout(calendarTimer, MultiTimeoutMethodTimedObjectInvoker.class);
            }
            // call the timeout method
            ((MultiTimeoutMethodTimedObjectInvoker) invoker).callTimeout(calendarTimer, calendarTimer.getTimeoutMethod());
        } else {
            this.timerService.getInvoker().callTimeout(calendarTimer);
        }
    }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.CalendarTimer

        return null;
    }

    @Override
    protected void postTimeoutProcessing() {
        final CalendarTimer calendarTimer = this.getTimer();
        final TimerState timerState = calendarTimer.getState();
        if (timerState == TimerState.IN_TIMEOUT || timerState == TimerState.RETRY_TIMEOUT) {
            if (calendarTimer.getNextExpiration() == null) {
                calendarTimer.expireTimer();
            } else {
                calendarTimer.setTimerState(TimerState.ACTIVE);
                // persist changes
                timerService.persistTimer(calendarTimer);
            }
        }
    }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.CalendarTimer

        statement.setString(7, serialize((Serializable) timerEntity.getPrimaryKey()));
        statement.setString(8, serialize(timerEntity.getTimerInfo()));
        statement.setString(9, timerEntity.getState().name());

        if (timerEntity instanceof CalendarTimer) {
            final CalendarTimer c = (CalendarTimer) timerEntity;
            statement.setString(10, c.getScheduleExpression().getSecond());
            statement.setString(11, c.getScheduleExpression().getMinute());
            statement.setString(12, c.getScheduleExpression().getHour());
            statement.setString(13, c.getScheduleExpression().getDayOfWeek());
            statement.setString(14, c.getScheduleExpression().getDayOfMonth());
            statement.setString(15, c.getScheduleExpression().getMonth());
            statement.setString(16, c.getScheduleExpression().getYear());
            statement.setTimestamp(17, timestamp(c.getScheduleExpression().getStart()));
            statement.setTimestamp(18, timestamp(c.getScheduleExpression().getEnd()));
            statement.setString(19, c.getScheduleExpression().getTimezone());
            statement.setBoolean(20, c.isAutoTimer());
            if (c.isAutoTimer()) {
                statement.setString(21, c.getTimeoutMethod().getDeclaringClass().getName());
                statement.setString(22, c.getTimeoutMethod().getName());
                StringBuilder params = new StringBuilder();
                final Class<?>[] parameterTypes = c.getTimeoutMethod().getParameterTypes();
                for (int i = 0; i < parameterTypes.length; ++i) {
                    params.append(parameterTypes[i].getName());
                    if (i != parameterTypes.length - 1) {
                        params.append(";");
                    }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.CalendarTimer

        super(calendarTimer);
    }

    @Override
    protected void callTimeout(TimerImpl timer) throws Exception {
        CalendarTimer calendarTimer = (CalendarTimer) timer;

        // if we have any more schedules remaining, then schedule a new task
        if (calendarTimer.getNextExpiration() != null && !calendarTimer.isInRetry()) {
            calendarTimer.scheduleTimeout(false);
        }

        // finally invoke the timeout method through the invoker
        if (calendarTimer.isAutoTimer()) {
            TimedObjectInvoker invoker = this.timerService.getInvoker();
            // call the timeout method
            invoker.callTimeout(calendarTimer, calendarTimer.getTimeoutMethod());
        } else {
            this.timerService.getInvoker().callTimeout(calendarTimer);
        }
    }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.CalendarTimer

    @Override
    protected void postTimeoutProcessing(TimerImpl timer) {
        timer.lock();
        try {
            final CalendarTimer calendarTimer = (CalendarTimer) timer;
            final TimerState timerState = calendarTimer.getState();
            if (timerState != TimerState.CANCELED
                    && timerState != TimerState.EXPIRED) {
                if (calendarTimer.getNextExpiration() == null) {
                    timerService.expireTimer(calendarTimer);
                } else {
                    calendarTimer.setTimerState(TimerState.ACTIVE);
                    // persist changes
                    timerService.persistTimer(calendarTimer, false);
                }
            }
        } finally {
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.CalendarTimer

        super(calendarTimer);
    }

    @Override
    protected void callTimeout() throws Exception {
        CalendarTimer calendarTimer = this.getTimer();

        // if we have any more schedules remaining, then schedule a new task
        if (calendarTimer.getNextExpiration() != null && !calendarTimer.isInRetry()) {
            calendarTimer.scheduleTimeout();
        }

        // finally invoke the timeout method through the invoker
        if (calendarTimer.isAutoTimer()) {
            TimedObjectInvoker invoker = this.timerService.getInvoker();
            // call the timeout method
            invoker.callTimeout(calendarTimer, calendarTimer.getTimeoutMethod());
        } else {
            this.timerService.getInvoker().callTimeout(calendarTimer);
        }
    }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.CalendarTimer

        return null;
    }

    @Override
    protected void postTimeoutProcessing() {
        final CalendarTimer calendarTimer = this.getTimer();
        final TimerState timerState = calendarTimer.getState();
        if (timerState != TimerState.CANCELED
                && timerState != TimerState.EXPIRED) {
            if (calendarTimer.getNextExpiration() == null) {
                calendarTimer.expireTimer();
            } else {
                calendarTimer.setTimerState(TimerState.ACTIVE);
                // persist changes
                timerService.persistTimer(calendarTimer);
            }
        }
    }
View Full Code Here

Examples of org.jboss.ejb3.timerservice.mk2.CalendarTimer

   }

   @Override
   protected void callTimeout() throws Exception
   {
      CalendarTimer calendarTimer = this.getTimer();

      // if we have any more schedules remaining, then schedule a new task
      if (calendarTimer.getNextExpiration() != null && calendarTimer.isInRetry() == false)
      {
         calendarTimer.scheduleTimeout();
      }

      // finally invoke the timeout method through the invoker
      if (calendarTimer.isAutoTimer())
      {
         TimedObjectInvoker invoker = this.timerService.getInvoker();
         if (invoker instanceof MultiTimeoutMethodTimedObjectInvoker == false)
         {
            String msg = "Cannot invoke timeout method because timer: " + calendarTimer
                  + " is an auto timer, but invoker is not of type" + MultiTimeoutMethodTimedObjectInvoker.class;
            logger.error(msg);
            throw new RuntimeException(msg);
         }
         // call the timeout method
         ((MultiTimeoutMethodTimedObjectInvoker) invoker).callTimeout(calendarTimer, calendarTimer.getTimeoutMethod());
      }
      else
      {
         this.timerService.getInvoker().callTimeout(calendarTimer);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.