org.apache.cxf.Bus.getOutFaultInterceptors()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(10.9k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.apache.cxf.Bus.getOutFaultInterceptors()方法的一些代码示例,展示了Bus.getOutFaultInterceptors()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bus.getOutFaultInterceptors()方法的具体详情如下:
包路径:org.apache.cxf.Bus
类名称:Bus
方法名:getOutFaultInterceptors

Bus.getOutFaultInterceptors介绍

暂无

代码示例

代码示例来源:origin: apache/cxf

public List<Interceptor<? extends Message>> getOutFaultInterceptors() {
  if (bus != null) {
    return bus.getOutFaultInterceptors();
  }
  return super.getOutFaultInterceptors();
}

代码示例来源:origin: org.apache.cxf/cxf-core

public void setOutFaultInterceptors(List<Interceptor<? extends Message>> interceptors) {
  if (bus != null) {
    bus.getOutFaultInterceptors().addAll(interceptors);
  } else {
    super.setOutFaultInterceptors(interceptors);
  }
}

代码示例来源:origin: apache/cxf

public void setOutFaultInterceptors(List<Interceptor<? extends Message>> interceptors) {
  if (bus != null) {
    bus.getOutFaultInterceptors().addAll(interceptors);
  } else {
    super.setOutFaultInterceptors(interceptors);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-core

public List<Interceptor<? extends Message>> getOutFaultInterceptors() {
  if (bus != null) {
    return bus.getOutFaultInterceptors();
  }
  return super.getOutFaultInterceptors();
}

代码示例来源:origin: apache/cxf

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;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-ws-policy

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;
}

代码示例来源:origin: apache/cxf

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
}

代码示例来源:origin: apache/cxf

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;
}

代码示例来源:origin: apache/cxf

@Test
public void testExceptionPropertyOrder() throws Throwable {
  ((Bus)applicationContext.getBean("cxf")).getOutFaultInterceptors().add(new LoggingOutInterceptor(fault));
  TestService testClient = getTestClient();
  ((BindingProvider)testClient).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                             "http://localhost:" + PORT
                               + "/service/TestEndpoint");
  try {
    testClient.echo("Exception");
  } catch (PropertyOrderException e) {
    Assert.assertTrue("Expect <message> element is before <data> element :" + fault.getMessage(),
             fault.getMessage().indexOf("</message><data") > -1);
  }
}

代码示例来源:origin: apache/cxf

protected void run()  {
  System.setProperty("temp.location", tmpDir);
  SpringBusFactory bf = new SpringBusFactory();
  Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/rm.xml");
  BusFactory.setDefaultBus(bus);
  setBus(bus);
  LoggingInInterceptor in = new LoggingInInterceptor();
  bus.getInInterceptors().add(in);
  LoggingOutInterceptor out = new LoggingOutInterceptor();
  bus.getOutInterceptors().add(out);
  bus.getOutFaultInterceptors().add(out);
  GreeterImpl implementor = new GreeterImpl();
  String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
  ep = Endpoint.publish(address, implementor);
  LOG.info("Published greeter endpoint.");
}
public void tearDown() {

代码示例来源:origin: apache/cxf

protected void run()  {
  SpringBusFactory bf = new SpringBusFactory();
  Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/http-addr-server.xml");
  setBus(bus);
  GreeterImpl implementor = new GreeterImpl();
  implementor.setThrowAlways(true);
  Endpoint.publish("http://localhost:" + PORT + "/SoapContext/GreeterPort", implementor);
  LOG.info("Published greeter endpoint.");
  LoggingInInterceptor in = new LoggingInInterceptor();
  LoggingOutInterceptor out = new LoggingOutInterceptor();
  bus.getInInterceptors().add(in);
  bus.getOutInterceptors().add(out);
  bus.getOutFaultInterceptors().add(out);
}

代码示例来源:origin: apache/cxf

protected void run()  {
  System.setProperty("temp.location", tmpDir);
  SpringBusFactory bf = new SpringBusFactory();
  Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/addr-wsdl11.xml");
  BusFactory.setDefaultBus(bus);
  setBus(bus);
  LoggingInInterceptor in = new LoggingInInterceptor();
  bus.getInInterceptors().add(in);
  bus.getInFaultInterceptors().add(in);
  LoggingOutInterceptor out = new LoggingOutInterceptor();
  bus.getOutInterceptors().add(out);
  bus.getOutFaultInterceptors().add(out);
  GreeterImpl implementor = new GreeterImpl();
  String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
  ep = Endpoint.publish(address, implementor);
  LOG.info("Published greeter endpoint.");
}
public void tearDown() {

代码示例来源:origin: apache/cxf

protected void run()  {
  System.setProperty("temp.location", tmpDir);
  SpringBusFactory bf = new SpringBusFactory();
  Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/addr0705.xml");
  BusFactory.setDefaultBus(bus);
  setBus(bus);
  LoggingInInterceptor in = new LoggingInInterceptor();
  bus.getInInterceptors().add(in);
  bus.getInFaultInterceptors().add(in);
  LoggingOutInterceptor out = new LoggingOutInterceptor();
  bus.getOutInterceptors().add(out);
  bus.getOutFaultInterceptors().add(out);
  GreeterImpl implementor = new GreeterImpl();
  String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
  ep = Endpoint.publish(address, implementor);
  LOG.info("Published greeter endpoint.");
}
public void tearDown() {

代码示例来源:origin: apache/cxf

protected void run()  {
  SpringBusFactory bf = new SpringBusFactory();
  Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/http-server.xml");
  setBus(bus);
  GreeterImpl implementor = new GreeterImpl();
  implementor.setThrowAlways(true);
  ep = Endpoint.publish("http://localhost:" + PORT + "/SoapContext/GreeterPort", implementor);
  LOG.info("Published greeter endpoint.");
  LoggingInInterceptor in = new LoggingInInterceptor();
  LoggingOutInterceptor out = new LoggingOutInterceptor();
  bus.getInInterceptors().add(in);
  bus.getOutInterceptors().add(out);
  bus.getOutFaultInterceptors().add(out);
}

代码示例来源:origin: apache/cxf

protected void run()  {
  SpringBusFactory bf = new SpringBusFactory();
  Bus bus = bf.createBus();
  setBus(bus);
  BusFactory.setDefaultBus(bus);
  LoggingInInterceptor in = new LoggingInInterceptor();
  LoggingOutInterceptor out = new LoggingOutInterceptor();
  bus.getInInterceptors().add(in);
  bus.getOutInterceptors().add(out);
  bus.getOutFaultInterceptors().add(out);
  HttpGreeterImpl implementor = new HttpGreeterImpl();
  implementor.setThrowAlways(true);
  String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
  ep = Endpoint.publish(address, implementor);
  LOG.info("Published greeter endpoint.");
}
public void tearDown() {

代码示例来源:origin: apache/cxf

@After
public void tearDown() throws Exception {
  Interceptor<?>[] interceptors = {mapVerifier, headerVerifier };
  removeInterceptors(staticBus.getInInterceptors(), interceptors);
  removeInterceptors(staticBus.getOutInterceptors(), interceptors);
  removeInterceptors(staticBus.getOutFaultInterceptors(), interceptors);
  removeInterceptors(staticBus.getInFaultInterceptors(), interceptors);
  if (greeter instanceof Closeable) {
    ((Closeable)greeter).close();
  }
  greeter = null;
  mapVerifier = null;
  headerVerifier = null;
  verified = null;
  messageIDs.clear();
}

代码示例来源:origin: apache/cxf

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);
}

代码示例来源:origin: apache/cxf

protected void initializeInterceptors(Exchange ex, PhaseInterceptorChain chain) {
  Endpoint e = ex.getEndpoint();
  Client c = ex.get(Client.class);
  chain.add(getBus().getOutFaultInterceptors());
  if (c != null) {
    chain.add(c.getOutFaultInterceptors());
  }
  chain.add(e.getService().getOutFaultInterceptors());
  chain.add(e.getOutFaultInterceptors());
  chain.add(e.getBinding().getOutFaultInterceptors());
  if (e.getService().getDataBinding() instanceof InterceptorProvider) {
    chain.add(((InterceptorProvider)e.getService().getDataBinding()).getOutFaultInterceptors());
  }
  addToChain(chain, ex.getInMessage());
  addToChain(chain, ex.getOutFaultMessage());
}
private void addToChain(PhaseInterceptorChain chain, Message m) {

代码示例来源:origin: org.apache.cxf/cxf-core

protected void initializeInterceptors(Exchange ex, PhaseInterceptorChain chain) {
  Endpoint e = ex.getEndpoint();
  Client c = ex.get(Client.class);
  chain.add(getBus().getOutFaultInterceptors());
  if (c != null) {
    chain.add(c.getOutFaultInterceptors());
  }
  chain.add(e.getService().getOutFaultInterceptors());
  chain.add(e.getOutFaultInterceptors());
  chain.add(e.getBinding().getOutFaultInterceptors());
  if (e.getService().getDataBinding() instanceof InterceptorProvider) {
    chain.add(((InterceptorProvider)e.getService().getDataBinding()).getOutFaultInterceptors());
  }
  addToChain(chain, ex.getInMessage());
  addToChain(chain, ex.getOutFaultMessage());
}
private void addToChain(PhaseInterceptorChain chain, Message m) {

代码示例来源:origin: org.apache.cxf/cxf-api

protected void initializeInterceptors(Exchange ex, PhaseInterceptorChain chain) {
  Endpoint e = ex.get(Endpoint.class);
  Client c = ex.get(Client.class);
  chain.add(getBus().getOutFaultInterceptors());
  if (c != null) {
    chain.add(c.getOutFaultInterceptors());
  }
  chain.add(e.getService().getOutFaultInterceptors());
  chain.add(e.getOutFaultInterceptors());
  chain.add(e.getBinding().getOutFaultInterceptors());
  if (e.getService().getDataBinding() instanceof InterceptorProvider) {
    chain.add(((InterceptorProvider)e.getService().getDataBinding()).getOutFaultInterceptors());
  }
  
  addToChain(chain, ex.getInMessage());
  addToChain(chain, ex.getOutFaultMessage());
}
private void addToChain(PhaseInterceptorChain chain, Message m) {

相关文章