Package org.apache.catalina.connector

Examples of org.apache.catalina.connector.Connector


    }

    public Connector createConnector(String address, int port,
             String protocol) {

        Connector connector = null;

  if (address != null) {
      /*
       * InetAddress.toString() returns a string of the form
       * "<hostname>/<literal_IP>". Get the latter part, so that the
       * address can be parsed (back) into an InetAddress using
       * InetAddress.getByName().
       */
      int index = address.indexOf('/');
      if (index != -1) {
    address = address.substring(index + 1);
      }
  }

  if (log.isDebugEnabled()) {
            log.debug("Creating connector for address='" +
          ((address == null) ? "ALL" : address) +
          "' port='" + port + "' protocol='" + protocol + "'");
  }

        try {

            if (protocol.equals("ajp")) {
                connector = new Connector("org.apache.jk.server.JkCoyoteHandler");
            } else if (protocol.equals("memory")) {
                connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler");
            } else if (protocol.equals("http")) {
                connector = new Connector();
            } else if (protocol.equals("https")) {
                connector = new Connector();
                connector.setScheme("https");
                connector.setSecure(true);
                connector.setProperty("SSLEnabled","true");
                // FIXME !!!! SET SSL PROPERTIES
            } else {
                connector = new Connector(protocol);
            }

            if (address != null) {
                IntrospectionUtils.setProperty(connector, "address",
                                               "" + address);
View Full Code Here


            protocol = "https";
        } else {
            protocol = "http";
        }

        Connector connector = null;
        if (UtilValidate.isNotEmpty(connectorProp.properties)) {
            connector = embedded.createConnector(address, port, protocol);
            try {
                for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
                    connector.setProperty(prop.name, prop.value);
                    //connector.setAttribute(prop.name, prop.value);
                }

                if (connectorProp.properties.containsKey("URIEncoding")) {
                    connector.setURIEncoding(connectorProp.properties.get("URIEncoding").value);
                }

                embedded.addConnector(connector);
            } catch (Exception e) {
                throw new ContainerException(e);
View Full Code Here

    public void addConnector(Connector connector) {

        synchronized (connectors) {
            connector.setContainer(this.container);
            connector.setService(this);
            Connector results[] = new Connector[connectors.length + 1];
            System.arraycopy(connectors, 0, results, 0, connectors.length);
            results[connectors.length] = connector;
            connectors = results;

            if (initialized) {
View Full Code Here

                }
            }
            connectors[j].setContainer(null);
            connector.setService(null);
            int k = 0;
            Connector results[] = new Connector[connectors.length - 1];
            for (int i = 0; i < connectors.length; i++) {
                if (i != j)
                    results[k++] = connectors[i];
            }
            connectors = results;
View Full Code Here

        System.setProperty("catalina.base", base.getAbsolutePath());

        // Trigger loading of catalina.properties
        CatalinaProperties.getProperty("foo");

        Connector connector = new Connector(Http11Protocol.class.getName());
        connector.setPort(configuration.getHttpPort());
        connector.setAttribute("connectionTimeout", "3000");
        tomcat.getService().addConnector(connector);
        tomcat.setConnector(connector);
        tomcat.setBaseDir(base.getAbsolutePath());
        tomcat.getHost().setAppBase(webapps.getAbsolutePath());
View Full Code Here

        this.name = name;
        this.container = container;

        //Create the Connector object
        connector = new Connector(protocol);


        //Set the parameters
        setParameters(connector, initParams);
       
View Full Code Here

        host.setName("localhost");
        host.setAppBase(appBase.getAbsolutePath());
        engine.addChild(host);

        // buildSource a empty request/response
        Connector connector = new Connector("HTTP/1.1");
        request = new MockRequest();
        request.setConnector(connector);
        response = new MockResponse();
        request.setResponse(response);
        request.setMethod("POST");
View Full Code Here

            ContextConfig config = new ContextConfig();
            ((Lifecycle)context).addLifecycleListener(config);
            host.addChild(context);
           
            // Install an HTTP connector
            Connector connector;
            try {
                engine.start();
                connector = new CustomConnector();
                connector.setPort(portNumber);
                connector.setContainer(engine);
                connector.initialize();
                connector.start();
            } catch (Exception e) {
                throw new ServletMappingException(e);
            }
           
            // Keep track of the running server
View Full Code Here

    }
   
    private boolean isNativeAPRLibInstalled() {

        try {
          Connector connector = new Connector("HTTP/1.1");
            if (!connector.getProtocolHandlerClassName().equalsIgnoreCase("org.apache.coyote.http11.Http11AprProtocol")) {       
               return false;
            }
        } catch (Exception e) {
          
           return false;
View Full Code Here

        this.name = name;
        this.container = container;

        //Create the Connector object
        connector = new Connector(protocol);


        //Set the parameters
        setParameters(connector, initParams);
       
View Full Code Here

TOP

Related Classes of org.apache.catalina.connector.Connector

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.