use of org.apache.cxf.interceptor.LoggingInInterceptor in project qi4j-sdk by Qi4j.
the class HelloMain method main.
public static void main(String[] args) {
HelloWorldImpl implementor = new HelloWorldImpl();
JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
svrFactory.setServiceClass(HelloWorld.class);
svrFactory.setAddress("http://localhost:9001/helloWorld");
svrFactory.setServiceBean(implementor);
svrFactory.getInInterceptors().add(new LoggingInInterceptor());
svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
svrFactory.create();
}
use of org.apache.cxf.interceptor.LoggingInInterceptor in project maven-plugins by apache.
the class RestJiraDownloader method setupWebClient.
private WebClient setupWebClient(String jiraUrl) {
WebClient client = WebClient.create(jiraUrl);
ClientConfiguration clientConfiguration = WebClient.getConfig(client);
HTTPConduit http = clientConfiguration.getHttpConduit();
// MCHANGES-324 - Maintain the client session
clientConfiguration.getRequestContext().put(Message.MAINTAIN_SESSION, Boolean.TRUE);
if (getLog().isDebugEnabled()) {
clientConfiguration.getInInterceptors().add(new LoggingInInterceptor());
clientConfiguration.getOutInterceptors().add(new LoggingOutInterceptor());
}
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
// MCHANGES-341 Externalize JIRA server timeout values to the configuration section
getLog().debug("RestJiraDownloader: connectionTimeout: " + connectionTimeout);
httpClientPolicy.setConnectionTimeout(connectionTimeout);
httpClientPolicy.setAllowChunking(false);
getLog().debug("RestJiraDownloader: receiveTimout: " + receiveTimout);
httpClientPolicy.setReceiveTimeout(receiveTimout);
// MCHANGES-334 RestJiraDownloader doesn't honor proxy settings
getProxyInfo(jiraUrl);
if (proxyHost != null) {
getLog().debug("Using proxy: " + proxyHost + " at port " + proxyPort);
httpClientPolicy.setProxyServer(proxyHost);
httpClientPolicy.setProxyServerPort(proxyPort);
httpClientPolicy.setProxyServerType(ProxyServerType.HTTP);
if (proxyUser != null) {
ProxyAuthorizationPolicy proxyAuthorizationPolicy = new ProxyAuthorizationPolicy();
proxyAuthorizationPolicy.setAuthorizationType("Basic");
proxyAuthorizationPolicy.setUserName(proxyUser);
proxyAuthorizationPolicy.setPassword(proxyPass);
http.setProxyAuthorization(proxyAuthorizationPolicy);
}
}
if (webUser != null) {
AuthorizationPolicy authPolicy = new AuthorizationPolicy();
authPolicy.setAuthorizationType("Basic");
authPolicy.setUserName(webUser);
authPolicy.setPassword(webPassword);
http.setAuthorization(authPolicy);
}
http.setClient(httpClientPolicy);
return client;
}
use of org.apache.cxf.interceptor.LoggingInInterceptor in project tesb-rt-se by Talend.
the class StsConfigurator method removeMessageLogging.
private void removeMessageLogging(Bus bus) {
Collection<Feature> features = bus.getFeatures();
Feature logFeature = null;
Interceptor inLogInterceptor = null;
Interceptor outLogInterceptor = null;
for (Feature feature : features) {
if (feature instanceof LoggingFeature) {
logFeature = feature;
break;
}
}
if (logFeature != null) {
features.remove(logFeature);
}
for (Interceptor interceptor : bus.getInInterceptors()) {
if (interceptor instanceof LoggingInInterceptor) {
inLogInterceptor = interceptor;
break;
}
}
for (Interceptor interceptor : bus.getOutInterceptors()) {
if (interceptor instanceof LoggingOutInterceptor) {
outLogInterceptor = interceptor;
break;
}
}
if (inLogInterceptor != null) {
bus.getInInterceptors().remove(inLogInterceptor);
// System.out.println("\nRemove in Interceptor = " + inLogInterceptor.getClass().getName());
}
if (outLogInterceptor != null) {
bus.getOutInterceptors().remove(outLogInterceptor);
// System.out.println("\nRemove out Interceptor = " + inLogInterceptor.getClass().getName());
}
}
use of org.apache.cxf.interceptor.LoggingInInterceptor in project tesb-rt-se by Talend.
the class StsConfiguratorTest method getBus.
private Bus getBus() {
Collection<Feature> features = new ArrayList<Feature>();
features.add(new LoggingFeature());
List<Interceptor<? extends Message>> inInterceptors = new ArrayList<Interceptor<? extends Message>>();
inInterceptors.add(new LoggingInInterceptor());
List<Interceptor<? extends Message>> inFaultInterceptors = new ArrayList<Interceptor<? extends Message>>();
inFaultInterceptors.add(new LoggingInInterceptor());
List<Interceptor<? extends Message>> outInterceptors = new ArrayList<Interceptor<? extends Message>>();
outInterceptors.add(new LoggingOutInterceptor());
List<Interceptor<? extends Message>> outFaultInterceptors = new ArrayList<Interceptor<? extends Message>>();
outFaultInterceptors.add(new LoggingOutInterceptor());
Bus bus = createMock(Bus.class);
expect(bus.getFeatures()).andReturn(features).anyTimes();
expect(bus.getInInterceptors()).andReturn(inInterceptors).anyTimes();
expect(bus.getOutInterceptors()).andReturn(outInterceptors).anyTimes();
expect(bus.getInFaultInterceptors()).andReturn(inFaultInterceptors).anyTimes();
expect(bus.getOutFaultInterceptors()).andReturn(outFaultInterceptors).anyTimes();
replay(bus);
return bus;
}
Aggregations