users@ejb-spec.java.net

[ejb-spec users] [jsr345-experts] Re: EJB_SPEC-71 - Clarify rules on Timer.cancel

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Fri, 14 Dec 2012 16:41:31 -0800

Thanks Jeremy.

As I didn't hear any other objections, and at least 2 EJB containers
interpreted the spec as access to Timer and TimerHandle are not allowed
for non-EJB callers, I updated the spec as described in
http://java.net/jira/browse/EJB_SPEC-71 and
http://java.net/jira/browse/EJB_SPEC-72 to avoid any further confusions.

Best,
-marina

On 12/11/12 2:52 PM, Jeremy Bauer wrote:
> I haven't found anything that disallows b2, but our interpretation was
> to do so. I think the specification should be updated no matter what
> we decide. Unless there is a strong argument otherwise, I'm in favor
> of allowing invocation of Timer methods outside of a bean.
>
> -Jeremy
>
>
>
> From: Marina Vatkina <marina.vatkina_at_oracle.com>
> To: jsr345-experts_at_ejb-spec.java.net,
> Date: 12/11/2012 04:15 PM
> Subject: [jsr345-experts] Re: EJB_SPEC-71 - Clarify rules on Timer.cancel
> ------------------------------------------------------------------------
>
>
>
> Thank you Jeremy.
>
> Do you think the spec needs to change to allow b2?
>
> thanks,
> -marina
>
> Jeremy Bauer wrote:
> > Hi Marina,
> >
> > a) No. WebSphere also allows a timer to be canceled by a non-owning
> > bean. This would be an incompatible change for our implementation. +1
> > for dropping the rule in getAllTimers().
> >
> > b) WebSphere does not allow a non-EJB caller to invoke cancel(). The
> > "Operations Allowed in the Methods of a ... Bean " tables indicate
> > when Timer methods can be called. Per spec, the container throws an
> > IllegalStateException if a method is invoked outside of the permitted
> > states. I haven't found anything that explicitly covers calls outside
> > of a bean, though. In any case, it does seem like an unnecessary
> > restriction to prevent invocation of Timer methods outside a bean.
> >
> > -Jeremy
> >
> >
> >
> > From: Marina Vatkina <marina.vatkina_at_oracle.com>
> > To: jsr345-experts_at_ejb-spec.java.net,
> > Date: 12/04/2012 01:03 AM
> > Subject: [jsr345-experts] EJB_SPEC-71 - Clarify rules on
> > Timer.cancel
> > ------------------------------------------------------------------------
> >
> >
> >
> > Experts,
> >
> > Please look at http://java.net/jira/browse/EJB_SPEC-71- which is a
> > separate issue on Timer.cancel mismatch in the spec.
> >
> > Please let me know, if you think that:
> >
> > a) A timer can be cancelled only by the bean that owns it (as in
> > getAllTimers() rule)
> >
> > Or
> >
> > b1) A timer can be cancelled by calling Timer.cancel() (i.e. the rule in
> > getAllTimers() should be removed)
> >
> > b2) Timer can be cancelled by a non-EJB caller (i.e. the spec should
> > remove references to a bean or a Bean Provider when describing the timer
> > cancellation).
> >
> > Depending on the outcome of your vote, I'll update the spec one way or
> > the other.
> >
> > As a note: GlassFish (RI) allows a non-owning bean (I didn't check a
> > servlet) to cancel a timer by calling its cancel() method.
> >
> >
> > thanks,
> > -marina
> >
> >
>
>