Skip to main content

[jsr339-experts] Re: A proposal to make the JAX-RS API "lambda ready".

  • From: Marek Potociar <marek.potociar@...>
  • To: jsr339-experts@...
  • Subject: [jsr339-experts] Re: A proposal to make the JAX-RS API "lambda ready".
  • Date: Tue, 30 Oct 2012 14:35:50 +0100

Hello experts,

after some more discussion and receiving some feedback, I've posted an updated proposal to github. Please review.

The main change is that client API invocation callback has been reverted to the old style. With more experimenting it became obvious that use of lambda does not seem suitable for this API. Main reason is that most often you want to process failure and success separately, but the change in the API to facilitate that is not justifiable without a hard JDK 8 dependency. Also the API is flexible enough to be made lamda-friendly later in case we're proven wrong.

The changes in container callbacks remain as proposed earlier. I expect your feedback by Thursday CoB. I'd like to proceed with committing the change to the master repository on Friday.

Marek

On Oct 29, 2012, at 12:06 PM, Marek Potociar <marek.potociar@...> wrote:

Hello experts,

A month ago at JavaOne, making APIs ready for closure support that is coming in Java SE 8, was one of the hot topics. The main idea behind making an API ready for "lambdas" (or closures), is to expose single-method interfaces whenever one expects a future use of lambdas. In JAX-RS 2.0, such places include definition of async response callbacks as well as client-side invocation callback.

With that I took a stab on it and tried to come up with a proposal that would make our new APIs more lambda-ready. Please review the proposal here:

In summary, I have updated the client.InvocationCallback to have only a single method and since I anticipate that many users would still prefer the old 2-method style, I'm adding an AbstractInvocationCallback convenience class. On the side of async response container callbacks, I've similarly updated the CompletionCallback and ResumeCallback APIs to adopt a single-method pattern. In my last commit I've also decided (based on numerous Sergey's requests) to propose removal of ResumeCallback (for now).

I'm looking forward to your review comments.

Marek



[jsr339-experts] A proposal to make the JAX-RS API "lambda ready".

Marek Potociar 10/29/2012

[jsr339-experts] Re: A proposal to make the JAX-RS API "lambda ready".

Markus KARG 10/29/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: A proposal to make the JAX-RS API "lambda ready".

Marek Potociar 10/29/2012

[jsr339-experts] Re: A proposal to make the JAX-RS API "lambda ready".

Sergey Beryozkin 10/30/2012

[jsr339-experts] Re: A proposal to make the JAX-RS API "lambda ready".

Marek Potociar 10/30/2012

[jsr339-experts] Re: A proposal to make the JAX-RS API "lambda ready".

Sergey Beryozkin 10/30/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: A proposal to make the JAX-RS API "lambda ready".

Marek Potociar 10/31/2012

[jsr339-experts] Re: A proposal to make the JAX-RS API "lambda ready".

Marek Potociar 10/30/2012

[jsr339-experts] Re: A proposal to make the JAX-RS API "lambda ready".

Sergey Beryozkin 10/30/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: A proposal to make the JAX-RS API "lambda ready".

Marek Potociar 10/31/2012
 
 
Close
loading
Please Confirm
Close