public List<Interceptor<? extends Message>> getOutInterceptors() { if (bus != null) { return bus.getOutInterceptors(); } return super.getOutInterceptors(); }
public void setOutInterceptors(List<Interceptor<? extends Message>> interceptors) { if (bus != null) { bus.getOutInterceptors().addAll(interceptors); } else { super.setOutInterceptors(interceptors); } }
public List<Interceptor<? extends Message>> getOutInterceptors() { if (bus != null) { return bus.getOutInterceptors(); } return super.getOutInterceptors(); }
void registerInterceptorsToBus() { ResponseTimeMessageInInterceptor in = new ResponseTimeMessageInInterceptor(); ResponseTimeMessageInvokerInterceptor invoker = new ResponseTimeMessageInvokerInterceptor(); ResponseTimeMessageOutInterceptor out = new ResponseTimeMessageOutInterceptor(); bus.getInInterceptors().add(in); bus.getInInterceptors().add(invoker); bus.getOutInterceptors().add(out); bus.getOutFaultInterceptors().add(out); bus.setExtension(this, CounterRepository.class); //create CounterRepositroyMoniter to writer the counter log //if the service is stopped or removed, the counters should remove itself }
protected ByteArrayOutputStream setupOutLogging() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); PrintWriter writer = new PrintWriter(bos, true); LoggingOutInterceptor out = new LoggingOutInterceptor(writer); this.bus.getOutInterceptors().add(out); return bos; }
private ByteArrayOutputStream setupOutLogging() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); PrintWriter writer = new PrintWriter(bos, true); LoggingOutInterceptor out = new LoggingOutInterceptor(new PrintWriterEventSender(writer)); this.bus.getOutInterceptors().add(out); return bos; }
protected ByteArrayOutputStream setupOutLogging() { PayloadLogEventSender sender = new PayloadLogEventSender(); LoggingOutInterceptor out = new LoggingOutInterceptor(sender); this.bus.getOutInterceptors().add(out); this.bus.getOutFaultInterceptors().add(out); return sender.bos; }
public void setUpBus(String port) throws Exception { SpringBusFactory bf = new SpringBusFactory(); bus = bf.createBus("org/apache/cxf/systest/ws/policy/rmwsdl.xml"); BusFactory.setDefaultBus(bus); outRecorder = new OutMessageRecorder(); bus.getOutInterceptors().add(outRecorder); inRecorder = new InMessageRecorder(); bus.getInInterceptors().add(inRecorder); } }
@org.junit.Before public void setUp() throws Exception { createBus(); getBus().getOutInterceptors().add(new LoggingOutInterceptor()); getBus().getInInterceptors().add(new LoggingInInterceptor()); }
protected void run() { String configurationFile = "undertowBasicAuthServer.xml"; URL configure = UndertowBasicAuthServer.class.getResource(configurationFile); Bus bus = new SpringBusFactory().createBus(configure, true); bus.getInInterceptors().add(new LoggingInInterceptor()); bus.getOutInterceptors().add(new LoggingOutInterceptor()); BusFactory.setDefaultBus(bus); setBus(bus); GreeterImpl implementor = new GreeterImpl(); ep = Endpoint.publish(ADDRESS, implementor); }
protected void run() { String configurationFile = "jettyBasicAuthServer.xml"; URL configure = JettyBasicAuthServer.class.getResource(configurationFile); Bus bus = new SpringBusFactory().createBus(configure, true); bus.getInInterceptors().add(new LoggingInInterceptor()); bus.getOutInterceptors().add(new LoggingOutInterceptor()); BusFactory.setDefaultBus(bus); setBus(bus); GreeterImpl implementor = new GreeterImpl(); ep = Endpoint.publish(ADDRESS, implementor); }
protected void run() { String configurationFile = "jettyDigestServer.xml"; URL configure = JettyBasicAuthServer.class.getResource(configurationFile); Bus bus = new SpringBusFactory().createBus(configure, true); bus.getInInterceptors().add(new LoggingInInterceptor()); bus.getOutInterceptors().add(new LoggingOutInterceptor()); BusFactory.setDefaultBus(bus); setBus(bus); GreeterImpl implementor = new GreeterImpl(); ep = Endpoint.publish(ADDRESS, implementor); }
@org.junit.Before public void setUp() { BusFactory.setThreadDefaultBus(getStaticBus()); BusFactory.getThreadDefaultBus().getOutInterceptors().add(new LoggingOutInterceptor()); BusFactory.getThreadDefaultBus().getInInterceptors().add(new LoggingInInterceptor()); BusFactory.getThreadDefaultBus().getInInterceptors().add(new MalformedResponseInterceptor()); }
@org.junit.Test public void testGetWSDL() throws Exception { BusFactory bf = BusFactory.newInstance(); Bus bus = bf.createBus(); bus.getInInterceptors().add(new LoggingInInterceptor()); bus.getOutInterceptors().add(new LoggingOutInterceptor()); MyHTTPConduitConfigurer myHttpConduitConfig = new MyHTTPConduitConfigurer(); bus.setExtension(myHttpConduitConfig, HTTPConduitConfigurer.class); JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(bus); factory.createClient(ADDRESS + "?wsdl"); }
@org.junit.Test public void testGetWSDL() throws Exception { BusFactory bf = BusFactory.newInstance(); Bus bus = bf.createBus(); bus.getInInterceptors().add(new LoggingInInterceptor()); bus.getOutInterceptors().add(new LoggingOutInterceptor()); MyHTTPConduitConfigurer myHttpConduitConfig = new MyHTTPConduitConfigurer(); bus.setExtension(myHttpConduitConfig, HTTPConduitConfigurer.class); JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(bus); factory.createClient(ADDRESS + "?wsdl"); }
@org.junit.Test public void testGetWSDL() throws Exception { BusFactory bf = BusFactory.newInstance(); Bus bus = bf.createBus(); bus.getInInterceptors().add(new LoggingInInterceptor()); bus.getOutInterceptors().add(new LoggingOutInterceptor()); MyHTTPConduitConfigurer myHttpConduitConfig = new MyHTTPConduitConfigurer(); bus.setExtension(myHttpConduitConfig, HTTPConduitConfigurer.class); JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(bus); factory.createClient(ADDRESS + "?wsdl"); }
@Test public void testGetWSDL() throws Exception { BusFactory bf = BusFactory.newInstance(); Bus bus = bf.createBus(); bus.getInInterceptors().add(new LoggingInInterceptor()); bus.getOutInterceptors().add(new LoggingOutInterceptor()); MyHTTPConduitConfigurer myHttpConduitConfig = new MyHTTPConduitConfigurer(); bus.setExtension(myHttpConduitConfig, HTTPConduitConfigurer.class); JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(bus); factory.createClient(ADDRESS + "?wsdl"); }
protected static PhaseInterceptorChain setupOutInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getOutInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getOutInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getOutInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getOutPhases(), i1, i2, i3); chain.add(new ClientRequestFilterInterceptor()); return chain; }
protected static PhaseInterceptorChain setupOutInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getOutInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getOutInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getOutInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getOutPhases(), i1, i2, i3); chain.add(new ClientRequestFilterInterceptor()); return chain; }
protected void addVerifiers() { MAPVerifier mapVerifier = new MAPVerifier(); mapVerifier.verificationCache = this; HeaderVerifier headerVerifier = new HeaderVerifier(); headerVerifier.verificationCache = this; Interceptor<?>[] interceptors = {mapVerifier, headerVerifier}; addInterceptors(getBus().getInInterceptors(), interceptors); addInterceptors(getBus().getInFaultInterceptors(), interceptors); addInterceptors(getBus().getOutInterceptors(), interceptors); addInterceptors(getBus().getOutFaultInterceptors(), interceptors); }