ejb3/src/main/java/org/jboss/as/ejb3/timerservice/TimerServiceImpl.java
private TimerImpl createCalendarTimer(ScheduleExpression schedule,
                                          Serializable info, boolean persistent, Method timeoutMethod) {
        if (this.isLifecycleCallbackInvocation() && !this.isSingletonBeanInvocation()) {
            throw EJB3_TIMER_LOGGER.failToCreateTimerDoLifecycle();
        }
        if (schedule == null) {
            throw EJB3_TIMER_LOGGER.scheduleIsNull();
        }
        // generate an id for the timer
        UUID uuid = UUID.randomUUID();
        // create the timer
        TimerImpl timer = CalendarTimer.builder()
                .setAutoTimer(timeoutMethod != null)
                .setScheduleExprSecond(schedule.getSecond())
                .setScheduleExprMinute(schedule.getMinute())
                .setScheduleExprHour(schedule.getHour())
                .setScheduleExprDayOfWeek(schedule.getDayOfWeek())
                .setScheduleExprDayOfMonth(schedule.getDayOfMonth())
                .setScheduleExprMonth(schedule.getMonth())
                .setScheduleExprYear(schedule.getYear())
                .setScheduleExprStartDate(schedule.getStart())
                .setScheduleExprEndDate(schedule.getEnd())
                .setScheduleExprTimezone(schedule.getTimezone())
                .setTimeoutMethod(timeoutMethod)
                .setTimerState(TimerState.CREATED)
                .setId(uuid.toString())
                .setPersistent(persistent)
                .setPrimaryKey(currentPrimaryKey())
                .setTimedObjectId(getInvoker().getTimedObjectId())
                .setInfo(info)
                .setNewTimer(true)
                .build(this);

        this.persistTimer(timer, true);
        // now "start" the timer. This involves, moving the timer to an ACTIVE state
        // and scheduling the timer task
        this.startTimer(timer);
        // return the timer
        return timer;
    }
private TimerImpl createCalendarTimer(ScheduleExpression schedule,
                                          Serializable info, boolean persistent, Method timeoutMethod) {
        if (this.isLifecycleCallbackInvocation() && !this.isSingletonBeanInvocation()) {
            throw EJB3_TIMER_LOGGER.failToCreateTimerDoLifecycle();
        }
        if (schedule == null) {
            throw EJB3_TIMER_LOGGER.scheduleIsNull();
        }
        // generate an id for the timer
        UUID uuid = UUID.randomUUID();
        // create the timer
        TimerImpl timer = CalendarTimer.builder()
                .setAutoTimer(timeoutMethod != null)
                .setScheduleExprSecond(schedule.getSecond())
                .setScheduleExprMinute(schedule.getMinute())
                .setScheduleExprHour(schedule.getHour())
                .setScheduleExprDayOfWeek(schedule.getDayOfWeek())
                .setScheduleExprDayOfMonth(schedule.getDayOfMonth())
                .setScheduleExprMonth(schedule.getMonth())
                .setScheduleExprYear(schedule.getYear())
                .setScheduleExprStartDate(schedule.getStart())
                .setScheduleExprEndDate(schedule.getEnd())
                .setScheduleExprTimezone(schedule.getTimezone())
                .setTimeoutMethod(timeoutMethod)
                .setTimerState(TimerState.CREATED)
                .setId(uuid.toString())
                .setPersistent(persistent)
                .setPrimaryKey(currentPrimaryKey())
                .setTimedObjectId(getInvoker().getTimedObjectId())
                .setInfo(info)
                .setNewTimer(true)
                .build(this);

        this.persistTimer(timer, true);
        // now "start" the timer. This involves, moving the timer to an ACTIVE state
        // and scheduling the timer task
        this.startTimer(timer);
        // return the timer
        return timer;
    }
private TimerImpl createCalendarTimer ( ScheduleExpression schedule , Serializable info , boolean persistent , Method timeoutMethod ) { if ( this . isLifecycleCallbackInvocation ( ) && ! this . isSingletonBeanInvocation ( ) ) { throw EJB3_TIMER_LOGGER . failToCreateTimerDoLifecycle ( ) ; } if ( schedule == null ) { throw EJB3_TIMER_LOGGER . scheduleIsNull ( ) ; } // generate an id for the timer UUID uuid = UUID . randomUUID ( ) ; // create the timer TimerImpl timer = CalendarTimer . builder ( ) . setAutoTimer ( timeoutMethod != null ) . setScheduleExprSecond ( schedule . getSecond ( ) ) . setScheduleExprMinute ( schedule . getMinute ( ) ) . setScheduleExprHour ( schedule . getHour ( ) ) . setScheduleExprDayOfWeek ( schedule . getDayOfWeek ( ) ) . setScheduleExprDayOfMonth ( schedule . getDayOfMonth ( ) ) . setScheduleExprMonth ( schedule . getMonth ( ) ) . setScheduleExprYear ( schedule . getYear ( ) ) . setScheduleExprStartDate ( schedule . getStart ( ) ) . setScheduleExprEndDate ( schedule . getEnd ( ) ) . setScheduleExprTimezone ( schedule . getTimezone ( ) ) . setTimeoutMethod ( timeoutMethod ) . setTimerState ( TimerState . CREATED ) . setId ( uuid . toString ( ) ) . setPersistent ( persistent ) . setPrimaryKey ( currentPrimaryKey ( ) ) . setTimedObjectId ( getInvoker ( ) . getTimedObjectId ( ) ) . setInfo ( info ) . setNewTimer ( true ) . build ( this ) ; this . persistTimer ( timer , true ) ; // now "start" the timer. This involves, moving the timer to an ACTIVE state // and scheduling the timer task this . startTimer ( timer ) ; // return the timer return timer ; }
Creates a calendar based {@link javax.ejb.Timer}

@param schedule   The {@link javax.ejb.ScheduleExpression} which will be used for creating scheduled timer tasks
for a calendar based timer
@param info       {@link java.io.Serializable} info that will be made available through the newly created timer's {@link javax.ejb.Timer#getInfo()} method
@param persistent True if the newly created timer has to be persistent
@return Returns the newly created timer
@throws IllegalArgumentException If the passed <code>schedule</code> is null
@throws IllegalStateException    If this method was invoked during a lifecycle callback on the EJB
Creates a calendar based { @link javax . ejb . Timer }