Skip to main content

[jax-rs-spec users] [jsr339-experts] Issues with ExecutionContext

  • From: Bill Burke <bburke@...>
  • To: "jsr339-experts@..." <jsr339-experts@...>
  • Subject: [jax-rs-spec users] [jsr339-experts] Issues with ExecutionContext
  • Date: Fri, 22 Jun 2012 12:49:32 -0400
  • List-id: <jsr339-experts.jax-rs-spec.java.net>

I'll make a separate JIRA's for these.

* Field injection *WILL NOT WORK* for ExecutionContext within singletons because references will be proxied and you won't be able to pass those proxied thread-specific references to other threads.

You *could* have a method on ExecutionContext like:

ExecutionContext getDelegate()

But this is extremely ugly IMO.  Instead, I suggest:

- ExecutionContext cannot be injected via @Context
- Turn @Suspend into a parameter annotation only
- Inject ExecutionContext via a @Suspend:

@GET
public void get(@Suspend ExecutionContext ctx);

- since you can't have ExecutionContext without a @Suspend, remove suspend() methods from ExecutionContext.


* JAX-RS 2.0 implementations should be able to run on top of the Servlet API. This means these ExecutionContext methods needs to be removed:

cancel()
isCancelled()

As there is no corresponding functionality in Servlet 3.0, you need to either remove these methods.

* You cannot add the async callbacks you want to add (like when a socket is closed), again, because Servlet 3.0 does not have corresponding functionality here. JAX-RS 1.0 was a standalone specification that could run in existing servlet containers (2.5, etc.). We don't want to move away from this, IMO.

* I don't know if you can make methods optional or not and throw some sort of NotSupported exception. Is this a legal spec thing?



--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com



[jax-rs-spec users] [jsr339-experts] Issues with ExecutionContext

Bill Burke 06/22/2012

[jax-rs-spec users] [jsr339-experts] Re: Issues with ExecutionContext

Marek Potociar 06/27/2012

[jax-rs-spec users] [jsr339-experts] Re: Issues with ExecutionContext

Bill Burke 06/27/2012
 
 
Close
loading
Please Confirm
Close