Grokbase Groups Camel dev June 2011
FAQ
Hi all,

I am still looking into camel-cxf. I found that the spring configuration
is done in a bit strange way.

For example in the cxfrs component there is a jaxrs and a spring
package. Still classes with spring references are present on both
packages and the packages from a dependency cycle.
There is for example a CxfRsEndpoint and a CxfRsSpringEndpoint. Still
the CxfRsEndpoint creates a SpringJAXRSClientFactoryBean. I would rather
have expected that the CxfRsSpringEndpoint would do that.

Also the SpringJAXRSClientFactoryBean is not looked up in the spring
context but rather created by hand and then configured using the
configure method which calls spring to set the properties. I would
rather have expected that the SpringJAXRSClientFactoryBean is simply
looked up in spring.

Can someone explain to me the reason why it works that way?

Christian

--
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com

Search Discussions

  • Willem Jiang at Jun 16, 2011 at 2:17 pm
    The main reason that we use the SpringJAXRSClientFactoryBean and
    SpringJAXBServerFactoryBean is I want the users of camel-cxfrs component
    can still leverage their knowledge of CXF JAXRS front end.

    And there are some difference between the client and server
    configuration, we need to treat them differently.

    Because we need to support create the CxfRsClient and CxfRsServer with
    URI or Spring configuration, we use CxfRsEndpoint and
    CXFRsSpringEndpoint to support these two requirement.

    On 6/16/11 9:33 PM, Christian Schneider wrote:
    Hi all,

    I am still looking into camel-cxf. I found that the spring configuration
    is done in a bit strange way.

    For example in the cxfrs component there is a jaxrs and a spring
    package. Still classes with spring references are present on both
    packages and the packages from a dependency cycle.
    There is for example a CxfRsEndpoint and a CxfRsSpringEndpoint. Still
    the CxfRsEndpoint creates a SpringJAXRSClientFactoryBean. I would rather
    have expected that the CxfRsSpringEndpoint would do that.

    Also the SpringJAXRSClientFactoryBean is not looked up in the spring
    context but rather created by hand and then configured using the
    configure method which calls spring to set the properties. I would
    rather have expected that the SpringJAXRSClientFactoryBean is simply
    looked up in spring.

    Can someone explain to me the reason why it works that way?

    Christian

    --
    Willem
    ----------------------------------
    FuseSource
    Web: http://www.fusesource.com
    Blog: http://willemjiang.blogspot.com (English)
    http://jnn.javaeye.com (Chinese)
    Twitter: willemjiang
    Weibo: willemjiang
  • Christian Schneider at Jun 17, 2011 at 6:59 am
    Hi Willem,

    thanks for you explanations.

    I think the usage of the Spring*FactoryBeans is a good idea. It also
    frees us from following every config change the cxf project does. Does
    the style of calling a configure method on a factory come from CXF. I
    know that this is the default style in CXF. If yes then we probably
    can´t change it.

    Btw. if we are so near to the cxf config style... Would it be possible
    to use the original cxf syntax for spring configs? At the moment we have
    a separate spring xml namespace for the cxf component. I think it would
    be much easier for cxf users if they could simply use the client and
    endpoint configs from cxf. I do not know if this is possible though.

    Christian

    Am 16.06.2011 16:16, schrieb Willem Jiang:
    The main reason that we use the SpringJAXRSClientFactoryBean and
    SpringJAXBServerFactoryBean is I want the users of camel-cxfrs
    component can still leverage their knowledge of CXF JAXRS front end.

    And there are some difference between the client and server
    configuration, we need to treat them differently.

    Because we need to support create the CxfRsClient and CxfRsServer with
    URI or Spring configuration, we use CxfRsEndpoint and
    CXFRsSpringEndpoint to support these two requirement.
    --
    Christian Schneider
    http://www.liquid-reality.de

    Open Source Architect
    http://www.talend.com
  • Willem Jiang at Jun 17, 2011 at 7:18 am

    On 6/17/11 2:58 PM, Christian Schneider wrote:
    Hi Willem,

    thanks for you explanations.

    I think the usage of the Spring*FactoryBeans is a good idea. It also
    frees us from following every config change the cxf project does. Does
    the style of calling a configure method on a factory come from CXF. I
    know that this is the default style in CXF. If yes then we probably
    can´t change it.
    Yes, it's the default configure style in CXF :)
    Btw. if we are so near to the cxf config style... Would it be possible
    to use the original cxf syntax for spring configs? At the moment we have
    a separate spring xml namespace for the cxf component. I think it would
    be much easier for cxf users if they could simply use the client and
    endpoint configs from cxf. I do not know if this is possible though.
    If we just can treat the cxf endpoint or client as abstract bean which
    has no instance can be mapped to CXF server or client, we can simple
    reuse the them to configure the camel-cxf endpoint or camel-cxfrs endpoint.
    But in most case if people define a <jaxws:endpoint>, the spring will
    create a CXF server according to this spring configuration.

    And we also do some enhancements on the <cxfEndpoint> to support
    configure the jaxws handler or setting the dataformat.

    So I don't think it's a good idea to simply reuse the configs from CXF
    Christian

    Am 16.06.2011 16:16, schrieb Willem Jiang:
    The main reason that we use the SpringJAXRSClientFactoryBean and
    SpringJAXBServerFactoryBean is I want the users of camel-cxfrs
    component can still leverage their knowledge of CXF JAXRS front end.

    And there are some difference between the client and server
    configuration, we need to treat them differently.

    Because we need to support create the CxfRsClient and CxfRsServer with
    URI or Spring configuration, we use CxfRsEndpoint and
    CXFRsSpringEndpoint to support these two requirement.

    --
    Willem
    ----------------------------------
    FuseSource
    Web: http://www.fusesource.com
    Blog: http://willemjiang.blogspot.com (English)
    http://jnn.javaeye.com (Chinese)
    Twitter: willemjiang
    Weibo: willemjiang
  • Christian Schneider at Jun 17, 2011 at 8:09 am
    Yes after thinking about it I also found that cxf would create an
    endpoint or client for a original config. So I think you are right it
    would be a bad idea.

    Christian


    Am 17.06.2011 09:17, schrieb Willem Jiang:
    On 6/17/11 2:58 PM, Christian Schneider wrote:
    If we just can treat the cxf endpoint or client as abstract bean which
    has no instance can be mapped to CXF server or client, we can simple
    reuse the them to configure the camel-cxf endpoint or camel-cxfrs
    endpoint.
    But in most case if people define a <jaxws:endpoint>, the spring will
    create a CXF server according to this spring configuration.

    And we also do some enhancements on the <cxfEndpoint> to support
    configure the jaxws handler or setting the dataformat.

    So I don't think it's a good idea to simply reuse the configs from CXF
    --
    Christian Schneider
    http://www.liquid-reality.de

    Open Source Architect
    http://www.talend.com

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescamel
postedJun 16, '11 at 1:34p
activeJun 17, '11 at 8:09a
posts5
users2
websitecamel.apache.org

People

Translate

site design / logo © 2018 Grokbase