You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2013/04/09 10:30:16 UTC

[jira] [Comment Edited] (CXF-4953) JAXRSClientFactoryBean doesn't take the bus features into consideration

    [ https://issues.apache.org/jira/browse/CXF-4953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13626385#comment-13626385 ] 

Willem Jiang edited comment on CXF-4953 at 4/9/13 8:28 AM:
-----------------------------------------------------------

In most case, we just setup a new interceptor into the feature, and cxf will load the interceptor from bus when it setup the interceptor chains for the client or server. But we could do more then interceptor setting work in the feature, such as the JMSFeature which could help CXF setup the JMS configuration or changing the behavior of the Client to support the fail over.
My suggestion is let the JAXRSClientFactoryBean check the features from Bus and apply them to itself. The code could like this
{code}
    protected void applyFeatures(AbstractClient client) {
        if (getFeatures() != null) {
            for (AbstractFeature feature : getFeatures()) {
                feature.initialize(client.getConfiguration(), getBus());
            }
        }
        
        // apply the feature from bus
        if (getBus().getFeatures() != null) {
             for (AbstractFeature feature : getBus().getFeatures()) {
                feature.initialize(client.getConfiguration(), getBus());
             }
        }
    }

{code}
                
      was (Author: njiang):
    In most case, we just setup a new interceptor into the feature, and cxf will load the interceptor from bus when it setup the interceptor chains for the client or server. But we could do more then interceptor setting work in the feature, such as the JMSFeature which could help CXF setup the JMS configuration or changing the behavior of the Client to support the fail over.
My suggestion is let the JAXRSClientFactoryBean check the features from Bus and apply them to itself. The code could like this
{code}
    protected void applyFeatures(AbstractClient client) {
        if (getFeatures() != null) {
            for (AbstractFeature feature : getFeatures()) {
                feature.initialize(client.getConfiguration(), getBus());
            }
        }
        
        // apply the feature from bus
        if (getBus().getFeatures()=null) {
             for (AbstractFeature feature : getBus().getFeatures()) {
                feature.initialize(client.getConfiguration(), getBus());
             }
        }
    }

{code}
                  
> JAXRSClientFactoryBean doesn't take the bus features into consideration 
> ------------------------------------------------------------------------
>
>                 Key: CXF-4953
>                 URL: https://issues.apache.org/jira/browse/CXF-4953
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.4, 2.6.7, 2.5.10
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>
> When we set the feature into to bus, the feature should be applied to all the JAXRSClientFactoryBean by default.
> Current JAXRSClientFactoryBean just take the features which are set to itself into consideration.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira