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

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

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

Bus.setId介绍

暂无

代码示例

代码示例来源:origin: org.apache.tomee/openejb-cxf-transport

private static Bus initDefaultBus() {
  final ClassLoader cl = Thread.currentThread().getContextClassLoader();
  Thread.currentThread().setContextClassLoader(CxfUtil.class.getClassLoader());
  try { // create the bus reusing cxf logic but skipping factory lookup
    final Bus bus = BusFactory.newInstance(CXFBusFactory.class.getName()).createBus();
    bus.setId(SystemInstance.get().getProperty("openejb.cxf.bus.id", "openejb.cxf.bus"));
    final BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
    bindingFactoryMap = (Map<String, BindingFactory>) Reflections.get(bfm, "bindingFactories");
    bus.setExtension(new OpenEJBHttpDestinationFactory(), HttpDestinationFactory.class);
    // ensure client proxies can use app classes
    CXFBusFactory.setDefaultBus(Bus.class.cast(Proxy.newProxyInstance(CxfUtil.class.getClassLoader(), new Class<?>[]{Bus.class}, new ClientAwareBusHandler())));
    bus.setProperty(ClassUnwrapper.class.getName(), new ClassUnwrapper() {
      @Override
      public Class<?> getRealClass(final Object o) {
        final Class<?> aClass = o.getClass();
        Class<?> c = aClass;
        while (c.getName().contains("$$")) {
          c = c.getSuperclass();
        }
        return c == Object.class ? aClass : c;
      }
    });
    SystemInstance.get().addObserver(new LifecycleManager());
    initAuthenticators();
    return bus; // we keep as internal the real bus and just expose to cxf the client aware bus to be able to cast it easily
  } finally {
    Thread.currentThread().setContextClassLoader(cl);
  }
}

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

public void setBus(Bus bb) {
  if (bus == bb) {
    return;
  }
  if (properties != null) {
    bb.setProperties(properties);
    properties = null;
  }
  if (!getInInterceptors().isEmpty()) {
    bb.getInInterceptors().addAll(getInInterceptors());
  }
  if (!getOutInterceptors().isEmpty()) {
    bb.getOutInterceptors().addAll(getOutInterceptors());
  }
  if (!getInFaultInterceptors().isEmpty()) {
    bb.getInFaultInterceptors().addAll(getInFaultInterceptors());
  }
  if (!getOutFaultInterceptors().isEmpty()) {
    bb.getOutFaultInterceptors().addAll(getOutFaultInterceptors());
  }
  if (!StringUtils.isEmpty(id)) {
    bb.setId(id);
  }
  if (features != null) {
    bb.setFeatures(features);
    features = null;
  }
  bus = bb;
}

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

public void setBus(Bus bb) {
  if (bus == bb) {
    return;
  }
  if (properties != null) {
    bb.setProperties(properties);
    properties = null;
  }
  if (!getInInterceptors().isEmpty()) {
    bb.getInInterceptors().addAll(getInInterceptors());
  }
  if (!getOutInterceptors().isEmpty()) {
    bb.getOutInterceptors().addAll(getOutInterceptors());
  }
  if (!getInFaultInterceptors().isEmpty()) {
    bb.getInFaultInterceptors().addAll(getInFaultInterceptors());
  }
  if (!getOutFaultInterceptors().isEmpty()) {
    bb.getOutFaultInterceptors().addAll(getOutFaultInterceptors());
  }
  if (!StringUtils.isEmpty(id)) {
    bb.setId(id);
  }
  if (features != null) {
    bb.setFeatures(features);
    features = null;
  }
  bus = bb;
}

相关文章