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

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

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

Bus.getExtension介绍

暂无

代码示例

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

protected ClassLoader initClassLoader() {
  return bus.getExtension(ClassLoader.class);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

private void initConfig() {
  cproviderFactory = bus.getExtension(ContinuationProviderFactory.class);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

@Resource
public final void setBus(Bus b) {
  bus = b;
  if (bus != null
    && bus.getExtension(ResourceManager.class) != null) {
    bus.getExtension(ResourceManager.class).addResourceResolver(this);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

private void configureObject(Object instance) {
  Configurer configurer = bus.getExtension(Configurer.class);
  if (null != configurer) {
    configurer.configureBean(instance);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

protected HTTPConduitFactory findFactory(EndpointInfo endpointInfo, Bus bus) {
  HTTPConduitFactory f = endpointInfo.getProperty(HTTPConduitFactory.class.getName(), HTTPConduitFactory.class);
  if (f == null) {
    f = bus.getExtension(HTTPConduitFactory.class);
  }
  return f;
}
public Destination getDestination(EndpointInfo endpointInfo, Bus bus) throws IOException {

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

private void configureObject(String name, Object instance) {
  Configurer configurer = bus.getExtension(Configurer.class);
  if (null != configurer) {
    configurer.configureBean(name, instance);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

protected void registerServletContextResolver(ServletConfig sc) {
  if (Boolean.valueOf(sc.getInitParameter(IGNORE_SERVLET_CONTEXT_RESOLVER))) {
    return;
  }
  ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
  resourceManager.addResourceResolver(new ServletContextResourceResolver(sc.getServletContext()));
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

protected void configure(Bus bus, Object bean, String name, String extraName) {
  Configurer configurer = bus.getExtension(Configurer.class);
  if (null != configurer) {
    configurer.configureBean(name, bean);
    if (extraName != null) {
      configurer.configureBean(extraName, bean);
    }
  }
}

代码示例来源:origin: opensourceBIM/BIMserver

private static DestinationRegistry getDestinationRegistryFromBus(Bus bus) {
  DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
  try {
    DestinationFactory df = dfm.getDestinationFactory("http://cxf.apache.org/transports/http/configuration");
    if (df instanceof HTTPTransportFactory) {
      HTTPTransportFactory transportFactory = (HTTPTransportFactory) df;
      return transportFactory.getRegistry();
    }
  } catch (BusException e) {
    // why are we throwing a busexception if the DF isn't found?
  }
  return null;
}

代码示例来源:origin: opensourceBIM/BIMserver

public void init(ServletConfig sc) throws ServletException {
  // Setting this property because otherwise a file named
  // "wsdl.properties" will be read from the JRE, which is not possible
  // due to restrictive permissions
  System.setProperty("javax.wsdl.factory.WSDLFactory", "com.ibm.wsdl.factory.WSDLFactoryImpl");
  if (this.bus == null) {
    loadBus(sc);
  }
  loader = bus.getExtension(ClassLoader.class);
  ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
  resourceManager.addResourceResolver(new ServletContextResourceResolver(sc.getServletContext()));
  if (destinationRegistry == null) {
    this.destinationRegistry = getDestinationRegistryFromBus(this.bus);
  }
  this.controller = createServletController(sc);
  redirectList = parseListSequence(sc.getInitParameter(REDIRECTS_PARAMETER));
  redirectQueryCheck = Boolean.valueOf(sc.getInitParameter(REDIRECT_QUERY_CHECK_PARAMETER));
  dispatcherServletName = sc.getInitParameter(REDIRECT_SERVLET_NAME_PARAMETER);
  dispatcherServletPath = sc.getInitParameter(REDIRECT_SERVLET_PATH_PARAMETER);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

public HTTPWSDLExtensionLoader(Bus b) {
  WSDLManager manager = b.getExtension(WSDLManager.class);
  createExtensor(manager, javax.wsdl.Port.class,
          org.apache.cxf.transports.http.configuration.HTTPClientPolicy.class);
  createExtensor(manager, javax.wsdl.Port.class,
          org.apache.cxf.transports.http.configuration.HTTPServerPolicy.class);
  createExtensor(manager, javax.wsdl.Port.class,
          AddressType.class);
}
public void createExtensor(WSDLManager manager,

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

public void assertMessage(Message message) {
  PolicyDataEngine policyDataEngine = bus.getExtension(PolicyDataEngine.class);
  policyDataEngine.assertMessage(message, getClient(), new ClientPolicyCalculator());
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

public void assertMessage(Message message) {
  PolicyDataEngine pde = bus.getExtension(PolicyDataEngine.class);
  pde.assertMessage(message, calcServerPolicy(message), new ServerPolicyCalculator());
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

/**
   * JAX-WS section 9.3.1: The runtime MUST then carry out any injections
   * requested by the handler, typically via the javax .annotation.Resource
   * annotation. After all the injections have been carried out, including in
   * the case where no injections were requested, the runtime MUST invoke the
   * method carrying a javax.annotation .PostConstruct annotation, if present.
   */
  private void configHandler(Handler<?> handler) {
    if (handler != null) {
      ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
      ResourceInjector injector = new ResourceInjector(resourceManager);
      injector.inject(handler);
      injector.construct(handler);
    }

  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

private void initializeViaInjection(Handler<?> handler, final Map<String, String> params) {
  if (bus != null) {
    ResourceManager resMgr = bus.getExtension(ResourceManager.class);
    List<ResourceResolver> resolvers = resMgr.getResourceResolvers();
    resolvers.add(new InitParamResourceResolver(params));
    ResourceInjector resInj = new ResourceInjector(resMgr, resolvers);
    resInj.inject(handler);
    resInj.construct(handler);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

protected InputStream getResourceAsStream(String path) {
  InputStream is = ClassLoaderUtils.getResourceAsStream(path, AbstractHTTPServlet.class);
  if (is == null && getBus() != null) {
    ResourceManager rm = getBus().getExtension(ResourceManager.class);
    if (rm != null) {
      is = rm.resolveResource(path, InputStream.class);
    }
  }
  return is;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

private synchronized HTTPServerPolicy calcServerPolicyInternal(Message m) {
  HTTPServerPolicy sp = serverPolicy;
  if (!serverPolicyCalced) {
    PolicyDataEngine pde = bus.getExtension(PolicyDataEngine.class);
    if (pde != null) {
      sp = pde.getServerEndpointPolicy(m, endpointInfo, this, new ServerPolicyCalculator());
    }
    if (null == sp) {
      sp = endpointInfo.getTraversedExtensor(
          new HTTPServerPolicy(), HTTPServerPolicy.class);
    }
    serverPolicy = sp;
    serverPolicyCalced = true;
  }
  return sp;
}
private HTTPServerPolicy calcServerPolicy(Message m) {

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

public HTTPClientPolicy getClient(Message message) {
  ClientPolicyCalculator cpc = new ClientPolicyCalculator();
  HTTPClientPolicy pol = message.get(HTTPClientPolicy.class);
  updateClientPolicy(message);
  if (pol != null) {
    pol = cpc.intersect(pol, clientSidePolicy);
  } else {
    pol = clientSidePolicy;
  }
  PolicyDataEngine policyDataEngine = bus.getExtension(PolicyDataEngine.class);
  if (policyDataEngine == null) {
    return pol;
  }
  return policyDataEngine.getPolicy(message, pol, cpc);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-jaxws

public Server create() {
  ClassLoaderHolder orig = null;
  try {
    if (bus != null) {
      ClassLoader loader = bus.getExtension(ClassLoader.class);
      if (loader != null) {
        orig = ClassLoaderUtils.setThreadContextClassloader(loader);
      }
    }
    Server server = super.create();
    initializeResourcesAndHandlerChain(server);
    checkPrivateEndpoint(server.getEndpoint());
    return server;
  } finally {
    if (orig != null) {
      orig.reset();
    }
  }
}

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

@Before
public void setUp() throws Exception {
  this.tika = new TikaConfig(getClass().getResourceAsStream("tika-config-for-server-tests.xml"));
  TikaResource.init(tika,
      new CommonsDigester(DIGESTER_READ_LIMIT, "md5,sha1:32"),
      new DefaultInputStreamFactory(), new ServerStatus(true));
  JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
  setUpResources(sf);
  setUpProviders(sf);
  sf.setAddress(endPoint + "/");
  BindingFactoryManager manager = sf.getBus().getExtension(
      BindingFactoryManager.class
  );
  JAXRSBindingFactory factory = new JAXRSBindingFactory();
  factory.setBus(sf.getBus());
  manager.registerBindingFactory(
      JAXRSBindingFactory.JAXRS_BINDING_ID,
      factory
  );
  server = sf.create();
}

相关文章