use of org.apache.cxf.feature.Feature in project tesb-rt-se by Talend.
the class JmsConfigurator method configureServerFactory.
public JaxWsServerFactoryBean configureServerFactory(JaxWsServerFactoryBean serverFactory) {
if (jmsConfiguration == null || serverFactory == null || (serviceName == null && configuration == null)) {
return null;
}
if (!jmsConfigured) {
setupJmsConfiguration();
}
final JMSConfigFeature feature = new JMSConfigFeature();
feature.setJmsConfig(jmsConfiguration);
List<Feature> features = serverFactory.getFeatures();
if (features == null) {
features = new ArrayList<Feature>();
}
features.add(feature);
serverFactory.setFeatures(features);
return serverFactory;
}
use of org.apache.cxf.feature.Feature in project tesb-rt-se by Talend.
the class CallContext method createCallbackProxy.
public <T> T createCallbackProxy(final Class<T> proxyInterface) {
final JaxWsProxyFactoryBean callback = new JaxWsProxyFactoryBean();
callback.setServiceName(serviceName);
callback.setEndpointName(new QName(serviceName.getNamespaceURI(), serviceName.getLocalPart() + "Port"));
callback.setAddress(replyToAddress);
callback.setServiceClass(proxyInterface);
final List<Feature> features = callback.getFeatures();
features.add(new RequestCallbackFeature());
if (logging) {
features.add(new LoggingFeature());
}
if (serviceActivityMonitoring) {
features.add(getEventFeature());
}
final Map<String, Object> properties = new HashMap<String, Object>();
properties.put(RequestCallbackFeature.CALLCONTEXT_PROPERTY_NAME, this);
callback.setProperties(properties);
return callback.create(proxyInterface);
}
use of org.apache.cxf.feature.Feature in project tesb-rt-se by Talend.
the class CallContext method setupEndpoint.
public static void setupEndpoint(final Endpoint endpoint) {
if (!(endpoint instanceof EndpointImpl)) {
throw new IllegalArgumentException("Only CXF JAX-WS endpoints supported. ");
}
final EndpointImpl ep = (EndpointImpl) endpoint;
final List<Feature> features = new ArrayList<Feature>();
features.add(new RequestCallbackFeature());
if (logging) {
features.add(new LoggingFeature());
}
if (serviceActivityMonitoring) {
features.add(getEventFeature());
}
if (ep.getFeatures() != null) {
features.addAll(ep.getFeatures());
}
ep.setFeatures(features);
ep.getProperties().put(NULL_MEANS_ONEWAY, Boolean.TRUE);
}
use of org.apache.cxf.feature.Feature in project fabric8 by fabric8io.
the class ManagedApiFeature method initializeProvider.
@Override
protected void initializeProvider(InterceptorProvider provider, final Bus bus) {
if (provider instanceof Endpoint) {
EndpointImpl endpointImpl = (EndpointImpl) provider;
List<Feature> features = endpointImpl.getActiveFeatures();
if (features == null) {
features = new ArrayList<Feature>();
features.add(this);
endpointImpl.initializeActiveFeatures(features);
} else {
features.add(this);
}
} else if (provider instanceof Bus) {
FactoryBeanListenerManager factoryBeanListenerManager = bus.getExtension(FactoryBeanListenerManager.class);
if (factoryBeanListenerManager == null) {
factoryBeanListenerManager = new FactoryBeanListenerManager(bus);
}
factoryBeanListenerManager.addListener(new FactoryBeanListener() {
@Override
public void handleEvent(Event arg0, AbstractServiceFactoryBean arg1, Object... arg2) {
if (arg0.equals(Event.SERVER_CREATED) && (arg2[0] instanceof Server)) {
Server server = (Server) arg2[0];
initialize(server, bus);
}
}
});
} else {
List<Feature> features = (List<Feature>) bus.getFeatures();
if (features == null) {
features = new ArrayList<Feature>();
features.add(this);
} else {
features.add(this);
}
}
}
use of org.apache.cxf.feature.Feature in project fabric8 by fabric8io.
the class SwaggerFeature method initializeProvider.
@Override
protected void initializeProvider(InterceptorProvider provider, final Bus bus) {
if (!(provider instanceof Endpoint)) {
FactoryBeanListenerManager factoryBeanListenerManager = bus.getExtension(FactoryBeanListenerManager.class);
if (factoryBeanListenerManager == null) {
factoryBeanListenerManager = new FactoryBeanListenerManager(bus);
}
factoryBeanListenerManager.addListener(new FactoryBeanListener() {
@Override
public void handleEvent(Event arg0, AbstractServiceFactoryBean arg1, Object... arg2) {
if (arg0.equals(Event.SERVER_CREATED) && (arg2[0] instanceof Server)) {
Server server = (Server) arg2[0];
if (server.getEndpoint().getEndpointInfo().getBinding().getBindingId().equals("http://apache.org/cxf/binding/jaxrs")) {
initialize(server, bus);
}
}
}
});
return;
}
EndpointImpl endpointImpl = (EndpointImpl) provider;
List<Feature> features = endpointImpl.getActiveFeatures();
if (features == null) {
features = new ArrayList<Feature>();
features.add(this);
endpointImpl.initializeActiveFeatures(features);
} else {
features.add(this);
}
}
Aggregations