use of org.apache.cxf.feature.LoggingFeature in project camel by apache.
the class RsClientBlueprintBean method setLoggingSizeLimit.
public void setLoggingSizeLimit(int loggingSizeLimit) {
this.loggingSizeLimit = loggingSizeLimit;
if (loggingFeature != null) {
getFeatures().remove(loggingFeature);
if (loggingSizeLimit > 0) {
loggingFeature = new LoggingFeature(loggingSizeLimit);
} else {
loggingFeature = new LoggingFeature();
}
getFeatures().add(loggingFeature);
}
}
use of org.apache.cxf.feature.LoggingFeature in project camel by apache.
the class RsServerBlueprintBean method setLoggingSizeLimit.
public void setLoggingSizeLimit(int loggingSizeLimit) {
this.loggingSizeLimit = loggingSizeLimit;
if (loggingFeature != null) {
getFeatures().remove(loggingFeature);
if (loggingSizeLimit > 0) {
loggingFeature = new LoggingFeature(loggingSizeLimit);
} else {
loggingFeature = new LoggingFeature();
}
getFeatures().add(loggingFeature);
}
}
use of org.apache.cxf.feature.LoggingFeature in project camel by apache.
the class SpringJAXRSClientFactoryBean method setLoggingFeatureEnabled.
public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
if (loggingFeature != null) {
getFeatures().remove(loggingFeature);
loggingFeature = null;
}
if (loggingFeatureEnabled) {
if (getLoggingSizeLimit() > 0) {
loggingFeature = new LoggingFeature(getLoggingSizeLimit());
} else {
loggingFeature = new LoggingFeature();
}
getFeatures().add(loggingFeature);
}
}
use of org.apache.cxf.feature.LoggingFeature in project camel by apache.
the class SpringJAXRSServerFactoryBean method setLoggingFeatureEnabled.
public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
if (loggingFeature != null) {
getFeatures().remove(loggingFeature);
loggingFeature = null;
}
if (loggingFeatureEnabled) {
if (getLoggingSizeLimit() > 0) {
loggingFeature = new LoggingFeature(getLoggingSizeLimit());
} else {
loggingFeature = new LoggingFeature();
}
getFeatures().add(loggingFeature);
}
}
use of org.apache.cxf.feature.LoggingFeature in project camel by apache.
the class CxfEndpoint method setupServerFactoryBean.
/**
* Populate server factory bean
*/
protected void setupServerFactoryBean(ServerFactoryBean sfb, Class<?> cls) {
// address
sfb.setAddress(getAddress());
sfb.setServiceClass(cls);
sfb.setInInterceptors(in);
sfb.setOutInterceptors(out);
sfb.setOutFaultInterceptors(outFault);
sfb.setInFaultInterceptors(inFault);
sfb.setFeatures(features);
if (schemaLocations != null) {
sfb.setSchemaLocations(schemaLocations);
}
if (bindingConfig != null) {
sfb.setBindingConfig(bindingConfig);
}
if (dataBinding != null) {
sfb.setDataBinding(dataBinding);
}
if (serviceFactoryBean != null) {
setServiceFactory(sfb, serviceFactoryBean);
}
if (sfb instanceof JaxWsServerFactoryBean && handlers != null) {
((JaxWsServerFactoryBean) sfb).setHandlers(handlers);
}
if (getTransportId() != null) {
sfb.setTransportId(getTransportId());
}
if (getBindingId() != null) {
sfb.setBindingId(getBindingId());
}
// wsdl url
if (getWsdlURL() != null) {
sfb.setWsdlURL(getWsdlURL());
}
// service name qname
if (getServiceName() != null) {
sfb.setServiceName(getServiceName());
}
// port qname
if (getPortName() != null) {
sfb.setEndpointName(getPortName());
}
// apply feature here
if (!CxfEndpointUtils.hasAnnotation(cls, WebServiceProvider.class)) {
if (getDataFormat() == DataFormat.PAYLOAD) {
sfb.getFeatures().add(new PayLoadDataFormatFeature(allowStreaming));
} else if (getDataFormat().dealias() == DataFormat.CXF_MESSAGE) {
sfb.getFeatures().add(new CXFMessageDataFormatFeature());
sfb.setDataBinding(new SourceDataBinding());
} else if (getDataFormat().dealias() == DataFormat.RAW) {
RAWDataFormatFeature feature = new RAWDataFormatFeature();
if (this.getExchangePattern().equals(ExchangePattern.InOnly)) {
//if DataFormat is RAW|MESSAGE, can't read message so can't
//determine it's oneway so need get the MEP from URI explicitly
feature.setOneway(true);
}
feature.addInIntercepters(getInInterceptors());
feature.addOutInterceptors(getOutInterceptors());
sfb.getFeatures().add(feature);
}
} else {
LOG.debug("Ignore DataFormat mode {} since SEI class is annotated with WebServiceProvider", getDataFormat());
}
if (isLoggingFeatureEnabled()) {
if (getLoggingSizeLimit() != 0) {
sfb.getFeatures().add(new LoggingFeature(getLoggingSizeLimit()));
} else {
sfb.getFeatures().add(new LoggingFeature());
}
}
if (getDataFormat() == DataFormat.PAYLOAD) {
sfb.setDataBinding(new HybridSourceDataBinding());
}
// set the document-literal wrapped style
if (getWrappedStyle() != null && getDataFormat().dealias() != DataFormat.CXF_MESSAGE) {
setWrapped(sfb, getWrappedStyle());
}
// any optional properties
if (getProperties() != null) {
if (sfb.getProperties() != null) {
// add to existing properties
sfb.getProperties().putAll(getProperties());
} else {
sfb.setProperties(getProperties());
}
LOG.debug("ServerFactoryBean: {} added properties: {}", sfb, getProperties());
}
if (this.isSkipPayloadMessagePartCheck()) {
if (sfb.getProperties() == null) {
sfb.setProperties(new HashMap<String, Object>());
}
sfb.getProperties().put("soap.no.validate.parts", Boolean.TRUE);
}
if (this.isSkipFaultLogging()) {
if (sfb.getProperties() == null) {
sfb.setProperties(new HashMap<String, Object>());
}
sfb.getProperties().put(FaultListener.class.getName(), new NullFaultListener());
}
sfb.setBus(getBus());
sfb.setStart(false);
getNullSafeCxfEndpointConfigurer().configure(sfb);
}
Aggregations