Given:
You are creating an Alarm management system. When you create a new alarm, you want it to create an alert that is triggered once at the specified time.
Which method should you call on Line 9 to create the timer?
Given:
You are creating an Alarm management system. When you create a new alarm, you want it to create an alert that is triggered once at the specified time.
Which method should you call on Line 9 to create the timer?
To create a timer that triggers once at a specified time, you should use the method that allows for a single-action timer. The correct method to use is TimerService.createSingleActionTimer(Date expiration, TimerConfig config). This method schedules a timer to expire at the given date and does not repeat. Hence, the appropriate method to call on Line 9 is "timerService.createSingleActionTimer(alarmDate, config);"
B https://docs.oracle.com/javaee/7/api/javax/ejb/TimerService.html#method.detail
Answser B. TimerService.createTimer(Date initialExpiration, long intervalDuration, Serializable info) IllegalArgumentException - If initialExpiration is null, if initialExpiration.getTime() is negative, or if intervalDuration is negative.