You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Barry Fitzgerald <ba...@gmail.com> on 2008/02/06 15:30:31 UTC

Patch for JAX-RS Spring configuration [CXF-1416]

Hi,

I've created a patch for CXF-1416. It now enables multiple root resources to
be configured.

https://issues.apache.org/jira/browse/CXF-1416

I've tested this manually with the following similar config to below:

<jaxrs:server id="customerService" address="/">
        <jaxrs:serviceBeans>
            <!--multiple services support -->
            <ref bean="restfulUserService" />
            <ref bean="restfulLoginService" />
        </jaxrs:serviceBeans>
    </jaxrs:server>

There are currently no tests for the Spring bean definition parser that I
can see and I'm not sure exactly how to write a valid unit test for this.
Maybe someone can enlighten me!

Thanks,

Barry

RE: Patch for JAX-RS Spring configuration [CXF-1416]

Posted by "Liu, Jervis" <jl...@iona.com>.

> -----Original Message-----
> From: Barry Fitzgerald [mailto:barfitzgerald@gmail.com]
> Sent: 2008年2月6日 22:31
> To: cxf-dev@incubator.apache.org
> Subject: Patch for JAX-RS Spring configuration [CXF-1416]
> 
> Hi,
> 
> I've created a patch for CXF-1416. It now enables multiple root resources to
> be configured.
> 
> https://issues.apache.org/jira/browse/CXF-1416
> 
> I've tested this manually with the following similar config to below:
> 
> <jaxrs:server id="customerService" address="/">
>         <jaxrs:serviceBeans>
>             <!--multiple services support -->
>             <ref bean="restfulUserService" />
>             <ref bean="restfulLoginService" />
>         </jaxrs:serviceBeans>
>     </jaxrs:server>
> 
> There are currently no tests for the Spring bean definition parser that I
> can see and I'm not sure exactly how to write a valid unit test for this.
> Maybe someone can enlighten me!
> 
[Liu, Jervis] Hi Barry, in this case you can write a system test. Please take a look at /trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java

> Thanks,
> 
> Barry

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: Patch for JAX-RS Spring configuration [CXF-1416]

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

use an 'Add To VersionControl' option. 'Create Patch' wil then pick it up.
If you do a 'Create Patch' form a trunk then a single patch incorporating all the chnages, in src and tests, in multiple modules, 
will be created...

Cheers, Sergey

----- Original Message ----- 
From: "Barry Fitzgerald" <ba...@gmail.com>
To: <cx...@incubator.apache.org>
Sent: Friday, February 08, 2008 10:22 AM
Subject: Re: Patch for JAX-RS Spring configuration [CXF-1416]


> Sorry about that it's attached now.
>
> Is there an easy way to do this?
>
> I.e.How should I create a patch when adding new files?
>
> Barry
>
> On Feb 8, 2008 2:25 AM, Jervis Liu <je...@gmail.com> wrote:
>
>> Hi Barry, the PetStore class used by the system test is missing in your
>> patch. Could you please attach this file in Jira. Thanks.
>>
>> Cheers,
>> Jervis
>>
>> On Feb 8, 2008 9:43 AM, Jervis Liu <je...@gmail.com> wrote:
>>
>> > I ll do this.
>> >
>> > Cheers,
>> > Jervis
>> >
>> >   On Feb 8, 2008 1:15 AM, Barry Fitzgerald <ba...@gmail.com>
>> > wrote:
>> >
>> > > I've added a patch to Jira now that includes a test. Both patches
>> still
>> > > need
>> > > to applied - one for the code, one for the test.
>> > >
>> > > Thanks,
>> > >
>> > > Barry
>> > >
>> > > On Feb 7, 2008 10:09 AM, Beryozkin, Sergey <Se...@iona.com>
>> > > wrote:
>> > >
>> > > > Hi Barry
>> > > >
>> > > > Thanks for the explanation. I've also read the Jervis's comments, so
>> > > it
>> > > > does make sense. It's useful to define multiple (root) resources
>> > > > possibly sharing the same configuration.
>> > > > I had a minor concern, which was purely about the syntax :
>> > > >
>> > > > > > <jaxrs:server id="customerService" address="/">
>> > > > > >        <jaxrs:serviceBeans>
>> > > > > >            <!--multiple services support -->
>> > > > > >            <ref bean="restfulUserService" />
>> > > > > >            <ref bean="restfulLoginService" />
>> > > > > >        </jaxrs:serviceBeans>
>> > > > > >    </jaxrs:server>
>> > > >
>> > > > It just says me that a customer service is a master service.
>> > > > But then, may be, this is exactly what a user wants to express, to
>> > > show
>> > > > this sort of relationship...
>> > > >
>> > > > Cheers, Sergey
>> > > >
>> > > > -----Original Message-----
>> > > > From: Barry Fitzgerald [mailto:barfitzgerald@gmail.com]
>> > > > Sent: 06 February 2008 21:05
>> > > > To: cxf-dev@incubator.apache.org
>> > > > Subject: Re: Patch for JAX-RS Spring configuration [CXF-1416]
>> > > >
>> > > > Hi Sergey,
>> > > >
>> > > > Thanks for the comment. My rational is as follows:
>> > > >
>> > > >   - The spring config method should closely mirror the non-spring
>> > > > config
>> > > >   method.
>> > > >   - There may be many situations where your server is customised in
>> > > > some
>> > > >   way e.g. injected interceptors - I think in these cases it
>> wouldn't
>> > > >   make sense to have multiple servers defined each with the same
>> > > >   customisation.
>> > > >   - While some scenarios may be covered by sub-resources, in many
>> this
>> > > >   is not applicable.
>> > > >   - Finally this the patch allows the choice to inject multiple root
>> > > >   resources or not, allowing one to choose their ideal approach.
>> > > >
>> > > > In short it's no show stopper but I think it is useful
>> functionality.
>> > > >
>> > > > Barry
>> > > >
>> > > > On Feb 6, 2008 4:13 PM, Sergey Beryozkin <se...@iona.com>
>> > > > wrote:
>> > > >
>> > > > > Hi
>> > > > >
>> > > > > So what sort of problem this patch  is trying to address ?
>> > > > > Why can't a user do :
>> > > > >
>> > > > > <jaxrs:server id="customerService" address="/">
>> > > > > </jaxrs:server>
>> > > > >
>> > > > > <jaxrs:server id="restfulUserService" address="/user">
>> > > > > </jaxrs:server>
>> > > > >
>> > > > > The proposed configuration makes me think that, in this case, a
>> > > > > restfulUserService is a subresource...
>> > > > >
>> > > > > Cheers, Sergey
>> > > > >
>> > > > > > Hi,
>> > > > > >
>> > > > > > I've created a patch for CXF-1416. It now enables multiple root
>> > > > > resources to
>> > > > > > be configured.
>> > > > > >
>> > > > > > https://issues.apache.org/jira/browse/CXF-1416
>> > > > > >
>> > > > > > I've tested this manually with the following similar config to
>> > > > below:
>> > > > > >
>> > > > > > <jaxrs:server id="customerService" address="/">
>> > > > > >        <jaxrs:serviceBeans>
>> > > > > >            <!--multiple services support -->
>> > > > > >            <ref bean="restfulUserService" />
>> > > > > >            <ref bean="restfulLoginService" />
>> > > > > >        </jaxrs:serviceBeans>
>> > > > > >    </jaxrs:server>
>> > > > > >
>> > > > > > There are currently no tests for the Spring bean definition
>> parser
>> > > > that
>> > > > > I
>> > > > > > can see and I'm not sure exactly how to write a valid unit test
>> > > for
>> > > > > this.
>> > > > > > Maybe someone can enlighten me!
>> > > > > >
>> > > > > > Thanks,
>> > > > > >
>> > > > > > Barry
>> > > > > >
>> > > > >
>> > > > > ----------------------------
>> > > > > IONA Technologies PLC (registered in Ireland)
>> > > > > Registered Number: 171387
>> > > > > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
>> > > > Ireland
>> > > > >
>> > > >
>> > > > ----------------------------
>> > > > IONA Technologies PLC (registered in Ireland)
>> > > > Registered Number: 171387
>> > > > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
>> > > Ireland
>> > > >
>> > >
>> >
>> >
>>
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: Patch for JAX-RS Spring configuration [CXF-1416]

Posted by Barry Fitzgerald <ba...@gmail.com>.
Sorry about that it's attached now.

Is there an easy way to do this?

I.e.How should I create a patch when adding new files?

Barry

On Feb 8, 2008 2:25 AM, Jervis Liu <je...@gmail.com> wrote:

> Hi Barry, the PetStore class used by the system test is missing in your
> patch. Could you please attach this file in Jira. Thanks.
>
> Cheers,
> Jervis
>
> On Feb 8, 2008 9:43 AM, Jervis Liu <je...@gmail.com> wrote:
>
> > I ll do this.
> >
> > Cheers,
> > Jervis
> >
> >   On Feb 8, 2008 1:15 AM, Barry Fitzgerald <ba...@gmail.com>
> > wrote:
> >
> > > I've added a patch to Jira now that includes a test. Both patches
> still
> > > need
> > > to applied - one for the code, one for the test.
> > >
> > > Thanks,
> > >
> > > Barry
> > >
> > > On Feb 7, 2008 10:09 AM, Beryozkin, Sergey <Se...@iona.com>
> > > wrote:
> > >
> > > > Hi Barry
> > > >
> > > > Thanks for the explanation. I've also read the Jervis's comments, so
> > > it
> > > > does make sense. It's useful to define multiple (root) resources
> > > > possibly sharing the same configuration.
> > > > I had a minor concern, which was purely about the syntax :
> > > >
> > > > > > <jaxrs:server id="customerService" address="/">
> > > > > >        <jaxrs:serviceBeans>
> > > > > >            <!--multiple services support -->
> > > > > >            <ref bean="restfulUserService" />
> > > > > >            <ref bean="restfulLoginService" />
> > > > > >        </jaxrs:serviceBeans>
> > > > > >    </jaxrs:server>
> > > >
> > > > It just says me that a customer service is a master service.
> > > > But then, may be, this is exactly what a user wants to express, to
> > > show
> > > > this sort of relationship...
> > > >
> > > > Cheers, Sergey
> > > >
> > > > -----Original Message-----
> > > > From: Barry Fitzgerald [mailto:barfitzgerald@gmail.com]
> > > > Sent: 06 February 2008 21:05
> > > > To: cxf-dev@incubator.apache.org
> > > > Subject: Re: Patch for JAX-RS Spring configuration [CXF-1416]
> > > >
> > > > Hi Sergey,
> > > >
> > > > Thanks for the comment. My rational is as follows:
> > > >
> > > >   - The spring config method should closely mirror the non-spring
> > > > config
> > > >   method.
> > > >   - There may be many situations where your server is customised in
> > > > some
> > > >   way e.g. injected interceptors - I think in these cases it
> wouldn't
> > > >   make sense to have multiple servers defined each with the same
> > > >   customisation.
> > > >   - While some scenarios may be covered by sub-resources, in many
> this
> > > >   is not applicable.
> > > >   - Finally this the patch allows the choice to inject multiple root
> > > >   resources or not, allowing one to choose their ideal approach.
> > > >
> > > > In short it's no show stopper but I think it is useful
> functionality.
> > > >
> > > > Barry
> > > >
> > > > On Feb 6, 2008 4:13 PM, Sergey Beryozkin <se...@iona.com>
> > > > wrote:
> > > >
> > > > > Hi
> > > > >
> > > > > So what sort of problem this patch  is trying to address ?
> > > > > Why can't a user do :
> > > > >
> > > > > <jaxrs:server id="customerService" address="/">
> > > > > </jaxrs:server>
> > > > >
> > > > > <jaxrs:server id="restfulUserService" address="/user">
> > > > > </jaxrs:server>
> > > > >
> > > > > The proposed configuration makes me think that, in this case, a
> > > > > restfulUserService is a subresource...
> > > > >
> > > > > Cheers, Sergey
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I've created a patch for CXF-1416. It now enables multiple root
> > > > > resources to
> > > > > > be configured.
> > > > > >
> > > > > > https://issues.apache.org/jira/browse/CXF-1416
> > > > > >
> > > > > > I've tested this manually with the following similar config to
> > > > below:
> > > > > >
> > > > > > <jaxrs:server id="customerService" address="/">
> > > > > >        <jaxrs:serviceBeans>
> > > > > >            <!--multiple services support -->
> > > > > >            <ref bean="restfulUserService" />
> > > > > >            <ref bean="restfulLoginService" />
> > > > > >        </jaxrs:serviceBeans>
> > > > > >    </jaxrs:server>
> > > > > >
> > > > > > There are currently no tests for the Spring bean definition
> parser
> > > > that
> > > > > I
> > > > > > can see and I'm not sure exactly how to write a valid unit test
> > > for
> > > > > this.
> > > > > > Maybe someone can enlighten me!
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Barry
> > > > > >
> > > > >
> > > > > ----------------------------
> > > > > IONA Technologies PLC (registered in Ireland)
> > > > > Registered Number: 171387
> > > > > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> > > > Ireland
> > > > >
> > > >
> > > > ----------------------------
> > > > IONA Technologies PLC (registered in Ireland)
> > > > Registered Number: 171387
> > > > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> > > Ireland
> > > >
> > >
> >
> >
>

Re: Patch for JAX-RS Spring configuration [CXF-1416]

Posted by Jervis Liu <je...@gmail.com>.
Hi Barry, the PetStore class used by the system test is missing in your
patch. Could you please attach this file in Jira. Thanks.

Cheers,
Jervis

On Feb 8, 2008 9:43 AM, Jervis Liu <je...@gmail.com> wrote:

> I ll do this.
>
> Cheers,
> Jervis
>
>   On Feb 8, 2008 1:15 AM, Barry Fitzgerald <ba...@gmail.com>
> wrote:
>
> > I've added a patch to Jira now that includes a test. Both patches still
> > need
> > to applied - one for the code, one for the test.
> >
> > Thanks,
> >
> > Barry
> >
> > On Feb 7, 2008 10:09 AM, Beryozkin, Sergey <Se...@iona.com>
> > wrote:
> >
> > > Hi Barry
> > >
> > > Thanks for the explanation. I've also read the Jervis's comments, so
> > it
> > > does make sense. It's useful to define multiple (root) resources
> > > possibly sharing the same configuration.
> > > I had a minor concern, which was purely about the syntax :
> > >
> > > > > <jaxrs:server id="customerService" address="/">
> > > > >        <jaxrs:serviceBeans>
> > > > >            <!--multiple services support -->
> > > > >            <ref bean="restfulUserService" />
> > > > >            <ref bean="restfulLoginService" />
> > > > >        </jaxrs:serviceBeans>
> > > > >    </jaxrs:server>
> > >
> > > It just says me that a customer service is a master service.
> > > But then, may be, this is exactly what a user wants to express, to
> > show
> > > this sort of relationship...
> > >
> > > Cheers, Sergey
> > >
> > > -----Original Message-----
> > > From: Barry Fitzgerald [mailto:barfitzgerald@gmail.com]
> > > Sent: 06 February 2008 21:05
> > > To: cxf-dev@incubator.apache.org
> > > Subject: Re: Patch for JAX-RS Spring configuration [CXF-1416]
> > >
> > > Hi Sergey,
> > >
> > > Thanks for the comment. My rational is as follows:
> > >
> > >   - The spring config method should closely mirror the non-spring
> > > config
> > >   method.
> > >   - There may be many situations where your server is customised in
> > > some
> > >   way e.g. injected interceptors - I think in these cases it wouldn't
> > >   make sense to have multiple servers defined each with the same
> > >   customisation.
> > >   - While some scenarios may be covered by sub-resources, in many this
> > >   is not applicable.
> > >   - Finally this the patch allows the choice to inject multiple root
> > >   resources or not, allowing one to choose their ideal approach.
> > >
> > > In short it's no show stopper but I think it is useful functionality.
> > >
> > > Barry
> > >
> > > On Feb 6, 2008 4:13 PM, Sergey Beryozkin <se...@iona.com>
> > > wrote:
> > >
> > > > Hi
> > > >
> > > > So what sort of problem this patch  is trying to address ?
> > > > Why can't a user do :
> > > >
> > > > <jaxrs:server id="customerService" address="/">
> > > > </jaxrs:server>
> > > >
> > > > <jaxrs:server id="restfulUserService" address="/user">
> > > > </jaxrs:server>
> > > >
> > > > The proposed configuration makes me think that, in this case, a
> > > > restfulUserService is a subresource...
> > > >
> > > > Cheers, Sergey
> > > >
> > > > > Hi,
> > > > >
> > > > > I've created a patch for CXF-1416. It now enables multiple root
> > > > resources to
> > > > > be configured.
> > > > >
> > > > > https://issues.apache.org/jira/browse/CXF-1416
> > > > >
> > > > > I've tested this manually with the following similar config to
> > > below:
> > > > >
> > > > > <jaxrs:server id="customerService" address="/">
> > > > >        <jaxrs:serviceBeans>
> > > > >            <!--multiple services support -->
> > > > >            <ref bean="restfulUserService" />
> > > > >            <ref bean="restfulLoginService" />
> > > > >        </jaxrs:serviceBeans>
> > > > >    </jaxrs:server>
> > > > >
> > > > > There are currently no tests for the Spring bean definition parser
> > > that
> > > > I
> > > > > can see and I'm not sure exactly how to write a valid unit test
> > for
> > > > this.
> > > > > Maybe someone can enlighten me!
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Barry
> > > > >
> > > >
> > > > ----------------------------
> > > > IONA Technologies PLC (registered in Ireland)
> > > > Registered Number: 171387
> > > > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> > > Ireland
> > > >
> > >
> > > ----------------------------
> > > IONA Technologies PLC (registered in Ireland)
> > > Registered Number: 171387
> > > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> > Ireland
> > >
> >
>
>

Re: Patch for JAX-RS Spring configuration [CXF-1416]

Posted by Jervis Liu <je...@gmail.com>.
I ll do this.

Cheers,
Jervis

On Feb 8, 2008 1:15 AM, Barry Fitzgerald <ba...@gmail.com> wrote:

> I've added a patch to Jira now that includes a test. Both patches still
> need
> to applied - one for the code, one for the test.
>
> Thanks,
>
> Barry
>
> On Feb 7, 2008 10:09 AM, Beryozkin, Sergey <Se...@iona.com>
> wrote:
>
> > Hi Barry
> >
> > Thanks for the explanation. I've also read the Jervis's comments, so it
> > does make sense. It's useful to define multiple (root) resources
> > possibly sharing the same configuration.
> > I had a minor concern, which was purely about the syntax :
> >
> > > > <jaxrs:server id="customerService" address="/">
> > > >        <jaxrs:serviceBeans>
> > > >            <!--multiple services support -->
> > > >            <ref bean="restfulUserService" />
> > > >            <ref bean="restfulLoginService" />
> > > >        </jaxrs:serviceBeans>
> > > >    </jaxrs:server>
> >
> > It just says me that a customer service is a master service.
> > But then, may be, this is exactly what a user wants to express, to show
> > this sort of relationship...
> >
> > Cheers, Sergey
> >
> > -----Original Message-----
> > From: Barry Fitzgerald [mailto:barfitzgerald@gmail.com]
> > Sent: 06 February 2008 21:05
> > To: cxf-dev@incubator.apache.org
> > Subject: Re: Patch for JAX-RS Spring configuration [CXF-1416]
> >
> > Hi Sergey,
> >
> > Thanks for the comment. My rational is as follows:
> >
> >   - The spring config method should closely mirror the non-spring
> > config
> >   method.
> >   - There may be many situations where your server is customised in
> > some
> >   way e.g. injected interceptors - I think in these cases it wouldn't
> >   make sense to have multiple servers defined each with the same
> >   customisation.
> >   - While some scenarios may be covered by sub-resources, in many this
> >   is not applicable.
> >   - Finally this the patch allows the choice to inject multiple root
> >   resources or not, allowing one to choose their ideal approach.
> >
> > In short it's no show stopper but I think it is useful functionality.
> >
> > Barry
> >
> > On Feb 6, 2008 4:13 PM, Sergey Beryozkin <se...@iona.com>
> > wrote:
> >
> > > Hi
> > >
> > > So what sort of problem this patch  is trying to address ?
> > > Why can't a user do :
> > >
> > > <jaxrs:server id="customerService" address="/">
> > > </jaxrs:server>
> > >
> > > <jaxrs:server id="restfulUserService" address="/user">
> > > </jaxrs:server>
> > >
> > > The proposed configuration makes me think that, in this case, a
> > > restfulUserService is a subresource...
> > >
> > > Cheers, Sergey
> > >
> > > > Hi,
> > > >
> > > > I've created a patch for CXF-1416. It now enables multiple root
> > > resources to
> > > > be configured.
> > > >
> > > > https://issues.apache.org/jira/browse/CXF-1416
> > > >
> > > > I've tested this manually with the following similar config to
> > below:
> > > >
> > > > <jaxrs:server id="customerService" address="/">
> > > >        <jaxrs:serviceBeans>
> > > >            <!--multiple services support -->
> > > >            <ref bean="restfulUserService" />
> > > >            <ref bean="restfulLoginService" />
> > > >        </jaxrs:serviceBeans>
> > > >    </jaxrs:server>
> > > >
> > > > There are currently no tests for the Spring bean definition parser
> > that
> > > I
> > > > can see and I'm not sure exactly how to write a valid unit test for
> > > this.
> > > > Maybe someone can enlighten me!
> > > >
> > > > Thanks,
> > > >
> > > > Barry
> > > >
> > >
> > > ----------------------------
> > > IONA Technologies PLC (registered in Ireland)
> > > Registered Number: 171387
> > > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> > Ireland
> > >
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland)
> > Registered Number: 171387
> > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> Ireland
> >
>

Re: Patch for JAX-RS Spring configuration [CXF-1416]

Posted by Barry Fitzgerald <ba...@gmail.com>.
I've added a patch to Jira now that includes a test. Both patches still need
to applied - one for the code, one for the test.

Thanks,

Barry

On Feb 7, 2008 10:09 AM, Beryozkin, Sergey <Se...@iona.com>
wrote:

> Hi Barry
>
> Thanks for the explanation. I've also read the Jervis's comments, so it
> does make sense. It's useful to define multiple (root) resources
> possibly sharing the same configuration.
> I had a minor concern, which was purely about the syntax :
>
> > > <jaxrs:server id="customerService" address="/">
> > >        <jaxrs:serviceBeans>
> > >            <!--multiple services support -->
> > >            <ref bean="restfulUserService" />
> > >            <ref bean="restfulLoginService" />
> > >        </jaxrs:serviceBeans>
> > >    </jaxrs:server>
>
> It just says me that a customer service is a master service.
> But then, may be, this is exactly what a user wants to express, to show
> this sort of relationship...
>
> Cheers, Sergey
>
> -----Original Message-----
> From: Barry Fitzgerald [mailto:barfitzgerald@gmail.com]
> Sent: 06 February 2008 21:05
> To: cxf-dev@incubator.apache.org
> Subject: Re: Patch for JAX-RS Spring configuration [CXF-1416]
>
> Hi Sergey,
>
> Thanks for the comment. My rational is as follows:
>
>   - The spring config method should closely mirror the non-spring
> config
>   method.
>   - There may be many situations where your server is customised in
> some
>   way e.g. injected interceptors - I think in these cases it wouldn't
>   make sense to have multiple servers defined each with the same
>   customisation.
>   - While some scenarios may be covered by sub-resources, in many this
>   is not applicable.
>   - Finally this the patch allows the choice to inject multiple root
>   resources or not, allowing one to choose their ideal approach.
>
> In short it's no show stopper but I think it is useful functionality.
>
> Barry
>
> On Feb 6, 2008 4:13 PM, Sergey Beryozkin <se...@iona.com>
> wrote:
>
> > Hi
> >
> > So what sort of problem this patch  is trying to address ?
> > Why can't a user do :
> >
> > <jaxrs:server id="customerService" address="/">
> > </jaxrs:server>
> >
> > <jaxrs:server id="restfulUserService" address="/user">
> > </jaxrs:server>
> >
> > The proposed configuration makes me think that, in this case, a
> > restfulUserService is a subresource...
> >
> > Cheers, Sergey
> >
> > > Hi,
> > >
> > > I've created a patch for CXF-1416. It now enables multiple root
> > resources to
> > > be configured.
> > >
> > > https://issues.apache.org/jira/browse/CXF-1416
> > >
> > > I've tested this manually with the following similar config to
> below:
> > >
> > > <jaxrs:server id="customerService" address="/">
> > >        <jaxrs:serviceBeans>
> > >            <!--multiple services support -->
> > >            <ref bean="restfulUserService" />
> > >            <ref bean="restfulLoginService" />
> > >        </jaxrs:serviceBeans>
> > >    </jaxrs:server>
> > >
> > > There are currently no tests for the Spring bean definition parser
> that
> > I
> > > can see and I'm not sure exactly how to write a valid unit test for
> > this.
> > > Maybe someone can enlighten me!
> > >
> > > Thanks,
> > >
> > > Barry
> > >
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland)
> > Registered Number: 171387
> > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> Ireland
> >
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>

RE: Patch for JAX-RS Spring configuration [CXF-1416]

Posted by "Liu, Jervis" <jl...@iona.com>.
The capability of serving multiple services in one server might be desirable in some cases. Also this support for multiple root resource classes is required by JSR-311 spec, see section 2.5 (spec version: Editors Draft December 4, 2007) as below:

"1. Identify the root resource class: 
(a) Set U = request URI path,C = {root resource classes},E = {} 
(b) For each class in C add a regular expression (computed using the function R(A) described in 
section 2.5.1) to E as follows: 
* Add R(Tclass) where Tclass is the URI path template specified for the class.
...
"

Cheers,
Jervis
> -----Original Message-----
> From: Barry Fitzgerald [mailto:barfitzgerald@gmail.com]
> Sent: 2008年2月7日 5:05
> To: cxf-dev@incubator.apache.org
> Subject: Re: Patch for JAX-RS Spring configuration [CXF-1416]
> 
> Hi Sergey,
> 
> Thanks for the comment. My rational is as follows:
> 
>    - The spring config method should closely mirror the non-spring config
>    method.
>    - There may be many situations where your server is customised in some
>    way e.g. injected interceptors - I think in these cases it wouldn't
>    make sense to have multiple servers defined each with the same
>    customisation.
>    - While some scenarios may be covered by sub-resources, in many this
>    is not applicable.
>    - Finally this the patch allows the choice to inject multiple root
>    resources or not, allowing one to choose their ideal approach.
> 
> In short it's no show stopper but I think it is useful functionality.
> 
> Barry
> 
> On Feb 6, 2008 4:13 PM, Sergey Beryozkin <se...@iona.com>
> wrote:
> 
> > Hi
> >
> > So what sort of problem this patch  is trying to address ?
> > Why can't a user do :
> >
> > <jaxrs:server id="customerService" address="/">
> > </jaxrs:server>
> >
> > <jaxrs:server id="restfulUserService" address="/user">
> > </jaxrs:server>
> >
> > The proposed configuration makes me think that, in this case, a
> > restfulUserService is a subresource...
> >
> > Cheers, Sergey
> >
> > > Hi,
> > >
> > > I've created a patch for CXF-1416. It now enables multiple root
> > resources to
> > > be configured.
> > >
> > > https://issues.apache.org/jira/browse/CXF-1416
> > >
> > > I've tested this manually with the following similar config to below:
> > >
> > > <jaxrs:server id="customerService" address="/">
> > >        <jaxrs:serviceBeans>
> > >            <!--multiple services support -->
> > >            <ref bean="restfulUserService" />
> > >            <ref bean="restfulLoginService" />
> > >        </jaxrs:serviceBeans>
> > >    </jaxrs:server>
> > >
> > > There are currently no tests for the Spring bean definition parser that
> > I
> > > can see and I'm not sure exactly how to write a valid unit test for
> > this.
> > > Maybe someone can enlighten me!
> > >
> > > Thanks,
> > >
> > > Barry
> > >
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland)
> > Registered Number: 171387
> > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
> >

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

RE: Patch for JAX-RS Spring configuration [CXF-1416]

Posted by "Beryozkin, Sergey" <Se...@iona.com>.
Hi Barry

Thanks for the explanation. I've also read the Jervis's comments, so it
does make sense. It's useful to define multiple (root) resources
possibly sharing the same configuration.
I had a minor concern, which was purely about the syntax :

> > <jaxrs:server id="customerService" address="/">
> >        <jaxrs:serviceBeans>
> >            <!--multiple services support -->
> >            <ref bean="restfulUserService" />
> >            <ref bean="restfulLoginService" />
> >        </jaxrs:serviceBeans>
> >    </jaxrs:server>

It just says me that a customer service is a master service.
But then, may be, this is exactly what a user wants to express, to show
this sort of relationship...

Cheers, Sergey

-----Original Message-----
From: Barry Fitzgerald [mailto:barfitzgerald@gmail.com] 
Sent: 06 February 2008 21:05
To: cxf-dev@incubator.apache.org
Subject: Re: Patch for JAX-RS Spring configuration [CXF-1416]

Hi Sergey,

Thanks for the comment. My rational is as follows:

   - The spring config method should closely mirror the non-spring
config
   method.
   - There may be many situations where your server is customised in
some
   way e.g. injected interceptors - I think in these cases it wouldn't
   make sense to have multiple servers defined each with the same
   customisation.
   - While some scenarios may be covered by sub-resources, in many this
   is not applicable.
   - Finally this the patch allows the choice to inject multiple root
   resources or not, allowing one to choose their ideal approach.

In short it's no show stopper but I think it is useful functionality.

Barry

On Feb 6, 2008 4:13 PM, Sergey Beryozkin <se...@iona.com>
wrote:

> Hi
>
> So what sort of problem this patch  is trying to address ?
> Why can't a user do :
>
> <jaxrs:server id="customerService" address="/">
> </jaxrs:server>
>
> <jaxrs:server id="restfulUserService" address="/user">
> </jaxrs:server>
>
> The proposed configuration makes me think that, in this case, a
> restfulUserService is a subresource...
>
> Cheers, Sergey
>
> > Hi,
> >
> > I've created a patch for CXF-1416. It now enables multiple root
> resources to
> > be configured.
> >
> > https://issues.apache.org/jira/browse/CXF-1416
> >
> > I've tested this manually with the following similar config to
below:
> >
> > <jaxrs:server id="customerService" address="/">
> >        <jaxrs:serviceBeans>
> >            <!--multiple services support -->
> >            <ref bean="restfulUserService" />
> >            <ref bean="restfulLoginService" />
> >        </jaxrs:serviceBeans>
> >    </jaxrs:server>
> >
> > There are currently no tests for the Spring bean definition parser
that
> I
> > can see and I'm not sure exactly how to write a valid unit test for
> this.
> > Maybe someone can enlighten me!
> >
> > Thanks,
> >
> > Barry
> >
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
Ireland
>

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: Patch for JAX-RS Spring configuration [CXF-1416]

Posted by Barry Fitzgerald <ba...@gmail.com>.
Hi Sergey,

Thanks for the comment. My rational is as follows:

   - The spring config method should closely mirror the non-spring config
   method.
   - There may be many situations where your server is customised in some
   way e.g. injected interceptors - I think in these cases it wouldn't
   make sense to have multiple servers defined each with the same
   customisation.
   - While some scenarios may be covered by sub-resources, in many this
   is not applicable.
   - Finally this the patch allows the choice to inject multiple root
   resources or not, allowing one to choose their ideal approach.

In short it's no show stopper but I think it is useful functionality.

Barry

On Feb 6, 2008 4:13 PM, Sergey Beryozkin <se...@iona.com> wrote:

> Hi
>
> So what sort of problem this patch  is trying to address ?
> Why can't a user do :
>
> <jaxrs:server id="customerService" address="/">
> </jaxrs:server>
>
> <jaxrs:server id="restfulUserService" address="/user">
> </jaxrs:server>
>
> The proposed configuration makes me think that, in this case, a
> restfulUserService is a subresource...
>
> Cheers, Sergey
>
> > Hi,
> >
> > I've created a patch for CXF-1416. It now enables multiple root
> resources to
> > be configured.
> >
> > https://issues.apache.org/jira/browse/CXF-1416
> >
> > I've tested this manually with the following similar config to below:
> >
> > <jaxrs:server id="customerService" address="/">
> >        <jaxrs:serviceBeans>
> >            <!--multiple services support -->
> >            <ref bean="restfulUserService" />
> >            <ref bean="restfulLoginService" />
> >        </jaxrs:serviceBeans>
> >    </jaxrs:server>
> >
> > There are currently no tests for the Spring bean definition parser that
> I
> > can see and I'm not sure exactly how to write a valid unit test for
> this.
> > Maybe someone can enlighten me!
> >
> > Thanks,
> >
> > Barry
> >
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>

Re: Patch for JAX-RS Spring configuration [CXF-1416]

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

So what sort of problem this patch  is trying to address ?
Why can't a user do :

<jaxrs:server id="customerService" address="/">
</jaxrs:server>

<jaxrs:server id="restfulUserService" address="/user">
</jaxrs:server>

The proposed configuration makes me think that, in this case, a restfulUserService is a subresource...

Cheers, Sergey

> Hi,
> 
> I've created a patch for CXF-1416. It now enables multiple root resources to
> be configured.
> 
> https://issues.apache.org/jira/browse/CXF-1416
> 
> I've tested this manually with the following similar config to below:
> 
> <jaxrs:server id="customerService" address="/">
>        <jaxrs:serviceBeans>
>            <!--multiple services support -->
>            <ref bean="restfulUserService" />
>            <ref bean="restfulLoginService" />
>        </jaxrs:serviceBeans>
>    </jaxrs:server>
> 
> There are currently no tests for the Spring bean definition parser that I
> can see and I'm not sure exactly how to write a valid unit test for this.
> Maybe someone can enlighten me!
> 
> Thanks,
> 
> Barry
>

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland