本文整理了Java中org.apache.cxf.resource.ResourceManager.addResourceResolver
方法的一些代码示例,展示了ResourceManager.addResourceResolver
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ResourceManager.addResourceResolver
方法的具体详情如下:
包路径:org.apache.cxf.resource.ResourceManager
类名称:ResourceManager
方法名:addResourceResolver
[英]Add a ResourceResolver
. The newly added resolver is added at the head of the list so the most recently added will be queried first.
[中]添加一个ResourceResolver
。新添加的冲突解决程序将添加到列表的开头,因此将首先查询最近添加的冲突解决程序。
代码示例来源: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-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: 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-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: 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.jboss.ws.cxf/jbossws-cxf-server
protected static void setResourceResolver(Bus bus, ResourceResolver resourceResolver)
{
if (resourceResolver != null)
{
bus.getExtension(ResourceManager.class).addResourceResolver(resourceResolver);
}
}
代码示例来源:origin: org.kantega.respiro/respiro-cxf-plugin
public ContextClassLoaderResourceResolver(Bus bus) {
bus.getExtension(ResourceManager.class).addResourceResolver(this);
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
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: apache/cxf
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: apache/cxf
@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-bundle-jaxrs
public void setBundleContext(final BundleContext c) {
context = c;
ClassLoader bundleClassLoader =
AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
return new BundleDelegatingClassLoader(c.getBundle(),
this.getClass().getClassLoader());
}
});
super.setExtension(bundleClassLoader, ClassLoader.class);
// Setup the resource resolver with the bundle classloader
ResourceManager rm = super.getExtension(ResourceManager.class);
rm.addResourceResolver(new ClassLoaderResolver(bundleClassLoader));
super.setExtension(c, BundleContext.class);
}
public void setBlueprintContainer(BlueprintContainer con) {
代码示例来源:origin: apache/cxf
public void setBundleContext(final BundleContext c) {
context = c;
ClassLoader bundleClassLoader =
AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
return new BundleDelegatingClassLoader(c.getBundle(),
this.getClass().getClassLoader());
}
});
super.setExtension(bundleClassLoader, ClassLoader.class);
// Setup the resource resolver with the bundle classloader
ResourceManager rm = super.getExtension(ResourceManager.class);
rm.addResourceResolver(new ClassLoaderResolver(bundleClassLoader));
super.setExtension(c, BundleContext.class);
}
public void setBlueprintContainer(BlueprintContainer con) {
代码示例来源:origin: org.jboss.ws.cxf/jbossws-cxf-client
protected void initializeBus(Bus bus) {
super.initializeBus(bus);
final ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
resourceManager.addResourceResolver(JBossWSResourceInjectionResolver.getInstance());
SecurityProviderConfig.setup(bus);
}
代码示例来源: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: org.jboss.ws.cxf/jbossws-cxf-server
private void updateAvailableBusWithServletInfo(ServletConfig servletConfig)
{
BusHolder holder = endpoint.getService().getDeployment().getAttachment(BusHolder.class);
//set the bus from deployment into the CXF servlet and assign it to the current thread (do not touch the default bus!)
bus = holder.getBus();
BusFactory.setThreadDefaultBus(bus);
//update the resource manager adding the ServletContextResourceResolver that was to be added by CXF servlet
ResourceManager resourceManager = bus.getExtension(ResourceManager.class);
resourceManager.addResourceResolver(new ServletContextResourceResolver(servletConfig.getServletContext()));
}
代码示例来源:origin: apache/cxf
public Object postProcessAfterInitialization(Object bean, String beanId) throws BeansException {
if (!isProcessing) {
if (resourceManager == null && bean instanceof ResourceManager) {
resourceManager = (ResourceManager)bean;
resourceManager.addResourceResolver(new BusApplicationContextResourceResolver(context));
}
return bean;
}
if (bean != null
&& injectable(bean, beanId)) {
new ResourceInjector(getResourceManager(bean)).construct(bean);
}
return bean;
}
代码示例来源:origin: org.apache.cxf/cxf-core
public Object postProcessAfterInitialization(Object bean, String beanId) throws BeansException {
if (!isProcessing) {
if (resourceManager == null && bean instanceof ResourceManager) {
resourceManager = (ResourceManager)bean;
resourceManager.addResourceResolver(new BusApplicationContextResourceResolver(context));
}
return bean;
}
if (bean != null
&& injectable(bean, beanId)) {
new ResourceInjector(getResourceManager(bean)).construct(bean);
}
return bean;
}
代码示例来源:origin: org.apache.cxf/cxf-rt-core
public Object postProcessAfterInitialization(Object bean, String beanId) throws BeansException {
if (!isProcessing) {
if (resourceManager == null && bean instanceof ResourceManager) {
resourceManager = (ResourceManager)bean;
resourceManager.addResourceResolver(new BusApplicationContextResourceResolver(context));
}
return bean;
}
if (bean != null
&& injectable(bean, beanId)) {
new ResourceInjector(getResourceManager(bean)).construct(bean);
}
return bean;
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
public Object postProcessAfterInitialization(Object bean, String beanId) throws BeansException {
if (!isProcessing) {
if (resourceManager == null && bean instanceof ResourceManager) {
resourceManager = (ResourceManager)bean;
resourceManager.addResourceResolver(new BusApplicationContextResourceResolver(context));
}
return bean;
}
if (bean != null
&& injectable(bean, beanId)) {
new ResourceInjector(getResourceManager(bean)).construct(bean);
}
return bean;
}
内容来源于网络,如有侵权,请联系作者删除!