public void setInInterceptors(List<Interceptor<? extends Message>> interceptors) { if (bus != null) { bus.getInInterceptors().addAll(interceptors); } else { super.setInInterceptors(interceptors); } }
public static void setup(Bus bus) { if (!NO_LOCAL_BC && !BC_GLOBALLY_AVAILABLE) { if (Holder.provider != null) { bus.getInInterceptors().add(Holder.inInterceptor); bus.getOutInterceptors().add(Holder.outInterceptor); } } }
public List<Interceptor<? extends Message>> getInInterceptors() { if (bus != null) { return bus.getInInterceptors(); } return super.getInInterceptors(); }
public synchronized void removeBusInterceptors() { bus.getInInterceptors().remove(PolicyInInterceptor.INSTANCE); bus.getOutInterceptors().remove(PolicyOutInterceptor.INSTANCE); bus.getInFaultInterceptors().remove(ClientPolicyInFaultInterceptor.INSTANCE); bus.getOutFaultInterceptors().remove(ServerPolicyOutFaultInterceptor.INSTANCE); bus.getInFaultInterceptors().remove(PolicyVerificationInFaultInterceptor.INSTANCE); addedBusInterceptors = false; }
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 setupInLogging() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); PrintWriter writer = new PrintWriter(bos, true); LoggingInInterceptor in = new LoggingInInterceptor(writer); this.bus.getInInterceptors().add(in); return bos; }
protected ByteArrayOutputStream setupInLogging() { PayloadLogEventSender sender = new PayloadLogEventSender(); LoggingInInterceptor in = new LoggingInInterceptor(sender); this.bus.getInInterceptors().add(in); this.bus.getInFaultInterceptors().add(in); return sender.bos; }
protected void run() { Bus bus = BusFactory.getDefaultBus(); setBus(bus); Map<String, Object> inProperties = new HashMap<>(); inProperties.put(ConfigurationConstants.ACTION, ConfigurationConstants.SAML_TOKEN_SIGNED); inProperties.put(ConfigurationConstants.PW_CALLBACK_REF, new KeystorePasswordCallback()); inProperties.put(ConfigurationConstants.SIG_VER_PROP_FILE, "bob.properties"); WSS4JInInterceptor inInterceptor = new WSS4JInInterceptor(inProperties); bus.getInInterceptors().add(inInterceptor); broker.updateWsdl(bus, "testutils/jms_test.wsdl"); Endpoint.publish(null, new SecurityGreeterImplTwoWayJMS()); }
@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()); }
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 = "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 = "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 = "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); }
protected static PhaseInterceptorChain setupInInterceptorChain(ClientConfiguration cfg) { PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class); List<Interceptor<? extends Message>> i1 = cfg.getBus().getInInterceptors(); List<Interceptor<? extends Message>> i2 = cfg.getInInterceptors(); List<Interceptor<? extends Message>> i3 = cfg.getConduitSelector().getEndpoint().getInInterceptors(); PhaseInterceptorChain chain = new PhaseChainCache().get(pm.getInPhases(), i1, i2, i3); chain.add(new ClientResponseFilterInterceptor()); return chain; }
@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 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); }