Search in sources :

Example 1 with ServletContextResourceResolver

use of org.apache.cxf.transport.servlet.ServletContextResourceResolver in project BIMserver by opensourceBIM.

the class GenericWebServiceServlet method init.

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);
}
Also used : ServletContextResourceResolver(org.apache.cxf.transport.servlet.ServletContextResourceResolver) ResourceManager(org.apache.cxf.resource.ResourceManager)

Example 2 with ServletContextResourceResolver

use of org.apache.cxf.transport.servlet.ServletContextResourceResolver in project jbossws-cxf by jbossws.

the class CXFServletExt method updateAvailableBusWithServletInfo.

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()));
}
Also used : ServletContextResourceResolver(org.apache.cxf.transport.servlet.ServletContextResourceResolver) BusHolder(org.jboss.wsf.stack.cxf.configuration.BusHolder) ResourceManager(org.apache.cxf.resource.ResourceManager)

Aggregations

ResourceManager (org.apache.cxf.resource.ResourceManager)2 ServletContextResourceResolver (org.apache.cxf.transport.servlet.ServletContextResourceResolver)2 BusHolder (org.jboss.wsf.stack.cxf.configuration.BusHolder)1