Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can also add the feature to the server by using ServerFactoryBean, or the client by using the ClientFactoryBean or the ClientProxyFactoryBean

Code Block
java
java
import org.apache.cxf.frontend.ServerFactoryBean;
import org.apache.cxf.frontend.ClientFactoryBean;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
...
ServerFactoryBean serverFactoryBean = new ServerFactoryBean();
MyFeature myFeature = new MyFeature();
// added my feature to the serverFactoryBean
serverFactoryBean.setFeatures(new ArrayList().addCollections.singletonList(myFeature));
...

ClientFactoryBean clientFactoryBean = new ClientFactoryBean();
clientFactoryBean.setFeatures(new ArrayList().addCollections.singletonList(myFeature));
...

ClientProxyFactoryBean clientFactoryBean = new ClientProxyFactoryBean();
clientFactoryBean.setFeatures(Collections.singletonList(policyFeature)); 

Adding a Feature through configuration

...