org.apache.cxf.resource.ResourceManager.getResourceResolvers()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(125)

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

ResourceManager.getResourceResolvers介绍

[英]Get all the currently registered resolvers. This method should return an unmodifiable view of the list of resolvers so that resolvers added after this method has been called will alter the list returned.
[中]获取所有当前注册的解析程序。此方法应返回冲突解决程序列表的不可修改视图,以便调用此方法后添加的冲突解决程序将更改返回的列表。

代码示例

代码示例来源: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-frontend-jaxws

/**
 * @param instance
 */
protected void injectResources(Object instance) {
  if (instance != null && !blockInjection) {
    ResourceManager resourceManager = getBus().getExtension(ResourceManager.class);
    List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
    resourceManager = new DefaultResourceManager(resolvers);
    resourceManager.addResourceResolver(new WebServiceContextResourceResolver());
    ResourceInjector injector = new ResourceInjector(resourceManager);
    if (Proxy.isProxyClass(instance.getClass()) && getServiceClass() != null) {
      injector.inject(instance, getServiceClass());
      if (!blockPostConstruct) {
        injector.construct(instance, getServiceClass());
      }
    } else {
      injector.inject(instance);
      if (!blockPostConstruct) {
        injector.construct(instance);
      }
    }
  }
}

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

public ResourceInjector(ResourceManager resMgr) {
  this(resMgr, resMgr == null ? null : resMgr.getResourceResolvers());
}

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

public ResourceInjector(ResourceManager resMgr) {
  this(resMgr, resMgr == null ? null : resMgr.getResourceResolvers());
}

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

public ResourceInjector(ResourceManager resMgr) {
  this(resMgr, resMgr == null ? null : resMgr.getResourceResolvers());
}

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

public ResourceInjector(ResourceManager resMgr) {
  this(resMgr, resMgr == null ? null : resMgr.getResourceResolvers());
}

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

public ResourceInjector(ResourceManager resMgr) {
  this(resMgr, resMgr == null ? null : resMgr.getResourceResolvers());
}

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

private void buildHandlerChain(JaxWsClientProxy cp) {
  AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder();
  JaxWsServiceFactoryBean sf = (JaxWsServiceFactoryBean)getServiceFactory();
  @SuppressWarnings("rawtypes")
  List<Handler> chain = new ArrayList<>(handlers);
  if (loadHandlers) {
    chain.addAll(builder.buildHandlerChainFromClass(sf.getServiceClass(),
                            sf.getEndpointInfo().getName(),
                            sf.getServiceQName(),
                            this.getBindingId()));
  }
  if (!chain.isEmpty()) {
    ResourceManager resourceManager = getBus().getExtension(ResourceManager.class);
    List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
    resourceManager = new DefaultResourceManager(resolvers);
    resourceManager.addResourceResolver(new WebServiceContextResourceResolver());
    ResourceInjector injector = new ResourceInjector(resourceManager);
    for (Handler<?> h : chain) {
      if (Proxy.isProxyClass(h.getClass()) && getServiceClass() != null) {
        injector.inject(h, getServiceClass());
        injector.construct(h, getServiceClass());
      } else {
        injector.inject(h);
        injector.construct(h);
      }
    }
  }
  cp.getBinding().setHandlerChain(chain);
}

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

private ResourceInjector injectCxfResources(final Object implementor) {
  ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
  final List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
  resourceManager = new DefaultResourceManager(resolvers);
  if (!resourceManager.getResourceResolvers().contains(WEB_SERVICE_CONTEXT_RESOURCE_RESOLVER)) {
    resourceManager.addResourceResolver(WEB_SERVICE_CONTEXT_RESOURCE_RESOLVER);
  }
  final ResourceInjector injector = new ResourceInjector(resourceManager);
  injector.inject(implementor);
  return injector;
}

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

private ResourceInjector injectCxfResources(final Object implementor) {
  ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
  final List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
  resourceManager = new DefaultResourceManager(resolvers);
  if (!resourceManager.getResourceResolvers().contains(WEB_SERVICE_CONTEXT_RESOURCE_RESOLVER)) {
    resourceManager.addResourceResolver(WEB_SERVICE_CONTEXT_RESOURCE_RESOLVER);
  }
  final ResourceInjector injector = new ResourceInjector(resourceManager);
  injector.inject(implementor);
  return injector;
}

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

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.camel/camel-cxf

List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
resourceManager = new DefaultResourceManager(resolvers);
resourceManager.addResourceResolver(new WebServiceContextResourceResolver());

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

/**
 * @param instance
 */
protected void injectResources(Object instance) {
  if (instance != null && !blockInjection) {
    ResourceManager resourceManager = getBus().getExtension(ResourceManager.class);
    List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
    resourceManager = new DefaultResourceManager(resolvers);
    resourceManager.addResourceResolver(new WebServiceContextResourceResolver());
    ResourceInjector injector = new ResourceInjector(resourceManager);
    if (Proxy.isProxyClass(instance.getClass()) && getServiceClass() != null) {
      injector.inject(instance, getServiceClass());
      if (!blockPostConstruct) {
        injector.construct(instance, getServiceClass());
      }
    } else {
      injector.inject(instance);
      if (!blockPostConstruct) {
        injector.construct(instance);
      }
    }
  }
}

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

private void buildHandlerChain(JaxWsClientProxy cp) {
  AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder();
  JaxWsServiceFactoryBean sf = (JaxWsServiceFactoryBean)getServiceFactory();
  @SuppressWarnings("rawtypes")
  List<Handler> chain = new ArrayList<>(handlers);
  if (loadHandlers) {
    chain.addAll(builder.buildHandlerChainFromClass(sf.getServiceClass(),
                            sf.getEndpointInfo().getName(),
                            sf.getServiceQName(),
                            this.getBindingId()));
  }
  if (!chain.isEmpty()) {
    ResourceManager resourceManager = getBus().getExtension(ResourceManager.class);
    List<ResourceResolver> resolvers = resourceManager.getResourceResolvers();
    resourceManager = new DefaultResourceManager(resolvers);
    resourceManager.addResourceResolver(new WebServiceContextResourceResolver());
    ResourceInjector injector = new ResourceInjector(resourceManager);
    for (Handler<?> h : chain) {
      if (Proxy.isProxyClass(h.getClass()) && getServiceClass() != null) {
        injector.inject(h, getServiceClass());
        injector.construct(h, getServiceClass());
      } else {
        injector.inject(h);
        injector.construct(h);
      }
    }
  }
  cp.getBinding().setHandlerChain(chain);
}

相关文章