javaee / ejb-spec

See javax.ejb project for API. Contains legacy issues only.
https://github.com/javaee/javax.ejb
6 stars 1 forks source link

Clarify rules on Timer.cancel #71

Closed glassfishrobot closed 11 years ago

glassfishrobot commented 11 years ago

EJB spec currently is not clear about which component can call Timer.cancel:

13.2Bean Provider's View of the Timer Service

A timer may be cancelled by a bean before its expiration. [...] A timer is cancelled by calling its cancel method.

13.2.4The TimerService Interface

The timer creation methods return a Timer object that allows the bean to cancel the timer or to obtain information about the timer prior to its cancellation and/or expiration.

13.2.6The Timer and TimerHandle Interfaces

The javax.ejb.Timer interface allows the Bean Provider to cancel a timer and to obtain information about the timer.

EJB 3.2 added getAllTimers() method with the following requirement:

Timers returned by this method can be cancelled only by the owning bean, which is the bean that is associated with the corresponding timer.

The spec doesn't say that a Timer object cannot be given to another component or accessed from the TimerHandle in another component. Which means that the rule for getAllTimers() method contradicts lack of restrictions in other parts of the spec.

Affected Versions

[3.2]

glassfishrobot commented 11 years ago

Reported by mvatkina

glassfishrobot commented 11 years ago

mvatkina said: Changes:

p. 329 "A timer may be cancelled by a bean before its expiration"

p. 338 "The timer creation methods return a Timer object that allows the bean timer to cancel the timer be cancelled or to obtain information about the timer prior to its cancellation and/or expiration."

"Timers returned by this method can be cancelled only by the owning bean, which is the bean that is associated with the corresponding timer"

glassfishrobot commented 11 years ago

mvatkina said: Fixed in rev 23

glassfishrobot commented 11 years ago

Was assigned to mvatkina

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA EJB_SPEC-71

glassfishrobot commented 11 years ago

Marked as fixed on Friday, December 14th 2012, 4:37:32 pm