Package org.apache.tomcat.util.http.mapper

Examples of org.apache.tomcat.util.http.mapper.Mapper$Wrapper


      }
   }
  
   public void registerOnDemandContext(String serviceName, String hostName, String contextName)
   {
      Mapper mapper = mappers.get(serviceName);
      if (mapper != null)
      {
         // ensure the path starts w/ slash or Mapper won't match it correctly
         if (contextName.length() > 0 && ('/' != contextName.charAt(0)))
         {
            contextName = "/" + contextName;
         }
         mapper.addOnDemandContext(hostName, contextName);
      }
      else
      {
         log.warn("Cannot register on-demand context for unknown engine " + serviceName);
      }
View Full Code Here


      }
   }
  
   public void removeOnDemandContext(String serviceName, String hostName, String contextName)
   {
      Mapper mapper = mappers.get(serviceName);
      if (mapper != null)
      {
         mapper.removeContext(hostName, contextName);
      }
      else
      {
         log.warn("Cannot remove on-demand context for unknown engine " + serviceName);
      }
View Full Code Here

    }

    private String getWrapperName(ServletRequest request, GeronimoStandardContext webContext) {

        MappingData mappingData = new MappingData();
        Mapper mapper = webContext.getMapper();
        MessageBytes mb = MessageBytes.newInstance();

        String dispatchPath = (String) request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
        mb.setString(webContext.getName() + dispatchPath);

        try {
            mapper.map(mb, mappingData);
            StandardWrapper wrapper = (StandardWrapper) mappingData.wrapper;
            return wrapper.getName();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
View Full Code Here

    }

    private String getWrapperName(ServletRequest request, GeronimoStandardContext webContext) {

        MappingData mappingData = new MappingData();
        Mapper mapper = webContext.getMapper();
        MessageBytes mb = MessageBytes.newInstance();

        String dispatchPath = (String) request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
        mb.setString(webContext.getName() + dispatchPath);

        try {
            mapper.map(mb, mappingData);
            StandardWrapper wrapper = (StandardWrapper) mappingData.wrapper;
            return wrapper.getName();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
View Full Code Here

    private String getWrapperName(ServletRequest request,
            GeronimoStandardContext webContext) {
       
        MappingData mappingData = new MappingData();
        Mapper mapper = webContext.getMapper();
        MessageBytes mb = MessageBytes.newInstance();
       
        String dispatchPath =
            (String) request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
        mb.setString(webContext.getName() + dispatchPath);
       
        try {
            mapper.map(mb, mappingData);
            StandardWrapper wrapper = (StandardWrapper) mappingData.wrapper;
            return wrapper.getName();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

        // the listener is started
        ArrayList<VirtualServer> virtualServers =
            getVirtualServersForHttpListenerId(httpService,
                                               httpListener.getId());
        if (virtualServers != null) {
            Mapper mapper = connector.getMapper();

            Server serverBean = null;
            try {
                serverBean = ServerBeansFactory.getServerBean(configContext);
            } catch (ConfigException e) {
                _logger.log(Level.SEVERE, "webcontainer.configError", e);
            }      

            for (Iterator<VirtualServer> it = virtualServers.iterator();
                                                    it.hasNext(); ) {
                VirtualServer vs = it.next();
                boolean found = false;
                int[] ports = vs.getPorts();
                for (int i=0; i<ports.length; i++) {
                    if (ports[i] == connector.getPort()) {
                        found = true;
                        break;
                    }
                }
                if (!found) {
                    int[] newPorts = new int[ports.length + 1];
                    System.arraycopy(ports, 0, newPorts, 0, ports.length);
                    newPorts[ports.length] = connector.getPort();
                    vs.setPorts(newPorts);
                }

                // Check if virtual server has default-web-module configured,
                // and if so, configure the http listener's mapper with this
                // information
                String defaultWebModulePath = vs.getDefaultContextPath(serverBean);
                if (defaultWebModulePath != null) {
                    try {
                        mapper.setDefaultContextPath(vs.getName(),
                                                     defaultWebModulePath);
                        vs.setDefaultContextPath(defaultWebModulePath);
                    } catch (Exception e) {
                        throw new LifecycleException(e);
                    }
View Full Code Here

        for (int i=0; i<connectors.length; i++) {
            PECoyoteConnector conn = (PECoyoteConnector) connectors[i];
            int port = conn.getPort();
            for (int j=0; j<ports.length; j++) {
                if (port == ports[j]) {
                    Mapper mapper = conn.getMapper();
                    try {
                        mapper.setDefaultContextPath(virtualServer.getName(),
                                                     defaultContextPath);
                        virtualServer.setDefaultContextPath(defaultContextPath);
                    } catch (Exception e) {
                        throw new LifecycleException(e);
                    }
View Full Code Here

    }

    private String getWrapperName(ServletRequest request, GeronimoStandardContext webContext) {

        MappingData mappingData = new MappingData();
        Mapper mapper = webContext.getMapper();
        MessageBytes mb = MessageBytes.newInstance();

        String dispatchPath = (String) request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
        mb.setString(webContext.getName() + dispatchPath);

        try {
            mapper.map(mb, mappingData);
            StandardWrapper wrapper = (StandardWrapper) mappingData.wrapper;
            return wrapper.getName();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
View Full Code Here

    private String getWrapperName(ServletRequest request,
                                  GeronimoStandardContext webContext) {

        MappingData mappingData = new MappingData();
        Mapper mapper = webContext.getMapper();
        MessageBytes mb = MessageBytes.newInstance();

        String dispatchPath =
            (String) request.getAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR);
        mb.setString(webContext.getName() + dispatchPath);

        try {
            mapper.map(mb, mappingData);
            StandardWrapper wrapper = (StandardWrapper) mappingData.wrapper;
            return wrapper.getName();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
View Full Code Here

        String pattern = "/*";
        ctx.addChild(wrapper);
        ctx.addServletMapping(pattern, wrapper.getName());

        // Must be added to the main mapper as no dynamic servlets usually
        Mapper mapper = webServer.getService().getMapper();
        mapper.addWrapper(virtualHost.getName(), ctx.getPath(), pattern, wrapper, false);

        if (httpContext != null && actx == null) {
            // We have a new shared context, save it for later use

            // The shared Servlet Context is put on a weak has map, which means that
View Full Code Here

TOP

Related Classes of org.apache.tomcat.util.http.mapper.Mapper$Wrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.