We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EJB provides a subsection for scheduler and timers.
To create a timer you can inject a TimerService like
@Inject TimerService timerService;
The TimerService provides methods to create single-action timer amonst other ways either by TimerService#createTimer(Date, Serializable) or TimerService#createSingleActionTimer(Date, TimerConfig but none where you can with a java.time parameter like LocalDateTime.
TimerService
java.time
LocalDateTime
Currently, it is required to convert LocalDateTime or other members of java.time to Date by using converters like
Date
public Date convertToDateViaSqlTimestamp(LocalDateTime dateToConvert) { return java.sql.Timestamp.valueOf(dateToConvert); }
or through java.time.Instant
java.time.Instant
Date convertToDateViaInstant(LocalDateTime dateToConvert) { return java.util.Date .from(dateToConvert.atZone(ZoneId.systemDefault()) .toInstant()); }
It was telegraphed that the alignment from JakartaEE/JavaEE to Java 8+ was an important step and adding support for java.time is part of this.
I suggest adding methods
public Timer createSingleActionTimer(LocalDateTime, TimerConfig timerConfig) throws IllegalArgumentException, IllegalStateException, EJBException
and sibling methods to add java.time support to ejb timers.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
EJB provides a subsection for scheduler and timers.
To create a timer you can inject a TimerService like
The
TimerService
provides methods to create single-action timer amonst other ways either by TimerService#createTimer(Date, Serializable) or TimerService#createSingleActionTimer(Date, TimerConfig but none where you can with ajava.time
parameter likeLocalDateTime
.Currently, it is required to convert
LocalDateTime
or other members ofjava.time
toDate
by using converters likeor through
java.time.Instant
It was telegraphed that the alignment from JakartaEE/JavaEE to Java 8+ was an important step and adding support for
java.time
is part of this.I suggest adding methods
and sibling methods to add
java.time
support to ejb timers.The text was updated successfully, but these errors were encountered: