Skip to main content

[jax-rs-spec users] [jsr339-experts] Re: Re: Re: InvocationCallback changing?

  • From: Bill Burke <bburke@...>
  • To: jsr339-experts@...
  • Subject: [jax-rs-spec users] [jsr339-experts] Re: Re: Re: InvocationCallback changing?
  • Date: Thu, 28 Jun 2012 16:19:23 -0400
  • List-id: <jsr339-experts.jax-rs-spec.java.net>



On 6/28/12 11:49 AM, Marek Potociar wrote:


As I tried to explain, this issue is not about specifying response type in 
the user application code. It is about getting the InvocationCallback generic 
type information in JAX-RS implementations (Jersey, CXF, RestEasy...). It is 
also about making sure the users avoid pitfalls with reification failures 
discussed above by failing early and in a documented way.


The only time a JAX-RS container would not be able to get the type information is this case:

class MyGenericCallback<T> implements InvocationCallback<T> {}
// application code
MyGenericCallback<String> callback;

Even this case I've got 3 fairly simple workarounds.  In summary -
* explict inheritance
   class StringCallback extends MyGenericCallback<String>{}

* inner class inheritance
   MyGenericCallback<String> callback = new MyGenericCallback<String>(){};

* Force the user to use javax.ws.rs.core.Response and readEntity().


And, in summary again, the regular client API has the same generic type issues and requires special knowledge of how GenericType works with java generics. So why is it such a stretch for them to do the same with InvocationCallback?

I guess I've exhausted my arguments.  I hope somebody else chimes in here.

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




[jax-rs-spec users] [jsr339-experts] InvocationCallback changing?

Bill Burke 06/26/2012

[jax-rs-spec users] [jsr339-experts] Re: InvocationCallback changing?

Marek Potociar 06/27/2012

[jax-rs-spec users] [jsr339-experts] Re: InvocationCallback changing?

Bill Burke 06/27/2012

[jax-rs-spec users] [jsr339-experts] Re: InvocationCallback changing?

Bill Burke 06/27/2012

[jax-rs-spec users] [jsr339-experts] Re: Re: InvocationCallback changing?

Marek Potociar 06/28/2012

[jax-rs-spec users] [jsr339-experts] Re: Re: InvocationCallback changing?

Bill Burke 06/28/2012

[jax-rs-spec users] [jsr339-experts] Re: Re: Re: InvocationCallback changing?

Marek Potociar 06/28/2012

[jax-rs-spec users] [jsr339-experts] Re: Re: Re: InvocationCallback changing?

Bill Burke 06/28/2012

[jax-rs-spec users] [jsr339-experts] Re: Re: Re: InvocationCallback changing?

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