From b93672abea0376275b7d328f6c8bef33af7883f0 Mon Sep 17 00:00:00 2001 From: Alberto Fanjul Date: Mon, 6 Nov 2023 14:06:54 +0100 Subject: [PATCH] Add externalid --- .../main/java/jakarta/ejb/TimerConfig.java | 19 +++++++++++++++++++ .../main/java/jakarta/ejb/TimerService.java | 13 +++++++++++++ 2 files changed, 32 insertions(+) diff --git a/api/src/main/java/jakarta/ejb/TimerConfig.java b/api/src/main/java/jakarta/ejb/TimerConfig.java index 9bb7f882..60e7d210 100755 --- a/api/src/main/java/jakarta/ejb/TimerConfig.java +++ b/api/src/main/java/jakarta/ejb/TimerConfig.java @@ -63,6 +63,24 @@ public void setInfo(Serializable i) { info_ = i; } + /** + * Set externalid. + * + * @param externalId external id. + */ + public void setExternalId(String externalId) { + this.externalId = externalId; + } + + /** + * Return the externalId. + * + * @return externalId + */ + public Serializable getExternalId() { + return externalId; + } + /** * Return the info object made available to timer callbacks. * @@ -100,4 +118,5 @@ public String toString() { private boolean persistent_ = true; + private String externalId; } diff --git a/api/src/main/java/jakarta/ejb/TimerService.java b/api/src/main/java/jakarta/ejb/TimerService.java index 55cf3d99..526fc8b9 100644 --- a/api/src/main/java/jakarta/ejb/TimerService.java +++ b/api/src/main/java/jakarta/ejb/TimerService.java @@ -215,6 +215,19 @@ public Timer createCalendarTimer(ScheduleExpression schedule, TimerConfig timerC public Collection getTimers() throws java.lang.IllegalStateException, jakarta.ejb.EJBException; + /** + * Returns all active timers associated with this bean matching externalId. These include both the programmatically-created timers and the + * automatically-created timers. + * + * @param externalId external id to look for. + * @return a collection of jakarta.ejb.Timer objects. + * @exception java.lang.IllegalStateException If this method is invoked while the instance is in a state that does not + * allow access to this method. + * @throws jakarta.ejb.EJBException If this method could not complete due to a system-level failure. + */ + public Collection getTimersbyExternalId(String externalId) throws java.lang.IllegalStateException, + jakarta.ejb.EJBException; + /** * Returns all active timers associated with the beans in the same module in which the caller bean is packaged. These * include both the programmatically-created timers and the automatically-created timers.