Liberty (and WebSphere traditional) both have ,
then when your application calls it, the method will run asynchronously. If you really want to schedule an
EJB method to run, then you would use an EJB timer via
EJB ; optionally returning a future.
Any management of that thread would need to be performed by the application, either in the asynchronous
method, or by the caller through the returned Future.
If you are looking for something similar to ComonJ Timer, then a lot of this depends on what sort of
timeout you want. If you want the work to run after a certain amount of time, EJB Timers or
ManagedScheduledExecutorService would be appropriate for that. However, if you want to submit the work
to have it run right way if possible and otherwise have the work time out such that it gets canceled
if it is too slow in starting, then the approach of using a ManagedExecutorService with a
ManagedTaskListener that checks against the submit time and does a cancel would work but you could
also consider leveraging the startTimeout of the concurrencyPolicy
https://openliberty.io/docs/20.0.0.8/reference/config/managedExecutorService.html
In Liberty, EJB asynchronous methods and EJB timers are built on top of the ManagedScheduledExecutorService.
So, if you are happy with EJB APIs for these, then use EJB, but if you need more flexibility and
management options, then use ManagedScheduledExecutorService directly.
The following link has several examples covered:
https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_migrate_to_eeconcurrency.html
Additional resource:
https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_config_ejbasynch.html
#Support#SupportMigration#WebSphereLiberty