You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2012/12/31 10:35:44 UTC

jaxrs & deployment

Hi guys,

i plan next year (hope to get it done for mid january) to change the
default rest deployment

the idea is to deploy a jaxrs Application instead of deploying each
endpoint (== give the Application to cxf)

the main reason is to simply reuse the rest routing instead of relying
on the servlet one

example:

given the following endpoints
-> /users
-> /user/1
-> /foo

we need 2 classes because we will bind /users/*, /user/* and /foo/*.
It is not so rezst compliant.


a side effect is to no more need @Path on class level :)


my plan is the following: by default if an application is provided use
it or if not create an internal one (like in wink IIRC). Then bind a
servlet for the application. The binding will be /* is nothing is
specified or the application path is provided (as always ;).

i already talked about it but never had a case where it was blocking.

here i have an app where i have to write too much classes because of
it (or add a routing filter which is stupid).

think to a user management class: /login, /logout, /users....already 3
classes :s

i plan to switch to this deployment by default because this is the
only way to get something working the

wdyt?

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau

Re: jaxrs & deployment

Posted by Romain Manni-Bucau <rm...@gmail.com>.
done a first version of it

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2013/1/2 Romain Manni-Bucau <rm...@gmail.com>:
> An app always exist, the default one is "jaxrs-application".
>
> The test can work. Important update to do is to read the boolean in app
> properties too and not only system ones
>
> Le 2 janv. 2013 20:00, "David Blevins" <da...@gmail.com> a écrit :
>
>> Sounds like we have a clear path for compatibility.  If someone is
>> configuring endpoints, we do it the old way.  If someone is configuring
>> Applications, we do it that way.
>>
>> Question though on the "new" way.  How does one configure an endpoint if
>> no application exists and they just have endpoints (EJBs)?
>>
>>
>> -David
>>
>> On Jan 2, 2013, at 10:46 AM, Romain Manni-Bucau <rm...@gmail.com>
>> wrote:
>>
>> > basically you now configure the app i
>> > n openejb-jar instead of each class (endpoint) but the syntax is the
>> > same
>> >
>> > i really think thats usable now. before it was weird
>> >
>> > open to discuss more about it if necessary
>> >
>> > --
>> > *Romain Manni-Bucau*
>> > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
>> > *Blog:
>> > **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
>> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
>> > *Github: https://github.com/rmannibucau*
>>
>

Re: jaxrs & deployment

Posted by Romain Manni-Bucau <rm...@gmail.com>.
An app always exist, the default one is "jaxrs-application".

The test can work. Important update to do is to read the boolean in app
properties too and not only system ones
Le 2 janv. 2013 20:00, "David Blevins" <da...@gmail.com> a écrit :

> Sounds like we have a clear path for compatibility.  If someone is
> configuring endpoints, we do it the old way.  If someone is configuring
> Applications, we do it that way.
>
> Question though on the "new" way.  How does one configure an endpoint if
> no application exists and they just have endpoints (EJBs)?
>
>
> -David
>
> On Jan 2, 2013, at 10:46 AM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > basically you now configure the app i
> > n openejb-jar instead of each class (endpoint) but the syntax is the same
> >
> > i really think thats usable now. before it was weird
> >
> > open to discuss more about it if necessary
> >
> > --
> > *Romain Manni-Bucau*
> > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > *Github: https://github.com/rmannibucau*
>
>

Re: jaxrs & deployment

Posted by David Blevins <da...@gmail.com>.
Sounds like we have a clear path for compatibility.  If someone is configuring endpoints, we do it the old way.  If someone is configuring Applications, we do it that way.

Question though on the "new" way.  How does one configure an endpoint if no application exists and they just have endpoints (EJBs)?


-David

On Jan 2, 2013, at 10:46 AM, Romain Manni-Bucau <rm...@gmail.com> wrote:

> basically you now configure the app i
> n openejb-jar instead of each class (endpoint) but the syntax is the same
> 
> i really think thats usable now. before it was weird
> 
> open to discuss more about it if necessary
> 
> -- 
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*


Re: jaxrs & deployment

Posted by Romain Manni-Bucau <rm...@gmail.com>.
basically you now configure the app i
n openejb-jar instead of each class (endpoint) but the syntax is the same

i really think thats usable now. before it was weird

open to discuss more about it if necessary

-- 
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*

Re: jaxrs & deployment

Posted by David Blevins <da...@gmail.com>.
You mentioned it breaks the config.  Can you write up some before and after examples of that?

Note, we've never ever broken config without still supporting the previous version.  We supported the OpenEJB 2.x config for years.

Part of the reason I was on the conservative side when we were thinking about creating a new all-in-one descriptor.


-David

On Dec 31, 2012, at 1:35 AM, Romain Manni-Bucau <rm...@gmail.com> wrote:

> Hi guys,
> 
> i plan next year (hope to get it done for mid january) to change the
> default rest deployment
> 
> the idea is to deploy a jaxrs Application instead of deploying each
> endpoint (== give the Application to cxf)
> 
> the main reason is to simply reuse the rest routing instead of relying
> on the servlet one
> 
> example:
> 
> given the following endpoints
> -> /users
> -> /user/1
> -> /foo
> 
> we need 2 classes because we will bind /users/*, /user/* and /foo/*.
> It is not so rezst compliant.
> 
> 
> a side effect is to no more need @Path on class level :)
> 
> 
> my plan is the following: by default if an application is provided use
> it or if not create an internal one (like in wink IIRC). Then bind a
> servlet for the application. The binding will be /* is nothing is
> specified or the application path is provided (as always ;).
> 
> i already talked about it but never had a case where it was blocking.
> 
> here i have an app where i have to write too much classes because of
> it (or add a routing filter which is stupid).
> 
> think to a user management class: /login, /logout, /users....already 3
> classes :s
> 
> i plan to switch to this deployment by default because this is the
> only way to get something working the
> 
> wdyt?
> 
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau


Re: jaxrs & deployment

Posted by Romain Manni-Bucau <rm...@gmail.com>.
just pushed the first part

still need some more work but basically solve the routing issue

will continue on thursday i think

any feedback before will be helpful

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2012/12/31 Romain Manni-Bucau <rm...@gmail.com>:
> it will affect you only if you used openejb-jar.xml to configure providers etc
>
> if not (putting providers in Application classes for instance) no change.
>
> that's said with the property you can switch back to the old deployment
>
> i still not started to work on it (and it will wait some days) so i'm
> not sure if some technical issues can block anything but i hope not
>
> does it answer to the question?
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2012/12/31 Alex The Rocker <al...@gmail.com>:
>> Romain:
>>
>> Would you proposal mean that existing JAX-RS applications working with
>> TomEE 1.5.1 need to be changed to run after your change is done?
>> If there is an impact, then would there be a way to write apps in such way
>> to have both 1.5.1 and "tomEE version with your change" compatibility?
>>
>>
>>
>> On Mon, Dec 31, 2012 at 10:35 AM, Romain Manni-Bucau
>> <rm...@gmail.com>wrote:
>>
>>> wdyt

Re: jaxrs & deployment

Posted by Romain Manni-Bucau <rm...@gmail.com>.
it will affect you only if you used openejb-jar.xml to configure providers etc

if not (putting providers in Application classes for instance) no change.

that's said with the property you can switch back to the old deployment

i still not started to work on it (and it will wait some days) so i'm
not sure if some technical issues can block anything but i hope not

does it answer to the question?

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2012/12/31 Alex The Rocker <al...@gmail.com>:
> Romain:
>
> Would you proposal mean that existing JAX-RS applications working with
> TomEE 1.5.1 need to be changed to run after your change is done?
> If there is an impact, then would there be a way to write apps in such way
> to have both 1.5.1 and "tomEE version with your change" compatibility?
>
>
>
> On Mon, Dec 31, 2012 at 10:35 AM, Romain Manni-Bucau
> <rm...@gmail.com>wrote:
>
>> wdyt

Re: jaxrs & deployment

Posted by Alex The Rocker <al...@gmail.com>.
Romain:

Would you proposal mean that existing JAX-RS applications working with
TomEE 1.5.1 need to be changed to run after your change is done?
If there is an impact, then would there be a way to write apps in such way
to have both 1.5.1 and "tomEE version with your change" compatibility?



On Mon, Dec 31, 2012 at 10:35 AM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> wdyt