Package org.apache.catalina.connector

Examples of org.apache.catalina.connector.Connector


        } catch (Exception e) {
            e.printStackTrace();
        }
       
        Tomcat tomcat = getTomcatInstance();
        Connector connector = tomcat.getConnector();
        if (connector.getProtocolHandlerClassName().contains("Apr")) {
            // This test is only for JSSE based SSL connectors
            return;
        }

        connector.setProperty("sslImplemenationName",
                "org.apache.tomcat.util.net.jsse.TesterBug50640SslImpl");
        connector.setProperty(TesterBug50640SslImpl.PROPERTY_NAME,
                TesterBug50640SslImpl.PROPERTY_VALUE);
       
        connector.setProperty("sslProtocol", "tls");
       
        File keystoreFile =
            new File("test/org/apache/tomcat/util/net/localhost.jks");
        connector.setAttribute(
                "keystoreFile", keystoreFile.getAbsolutePath());

        connector.setSecure(true);           
        connector.setProperty("SSLEnabled", "true");

        File appDir = new File(getBuildDirectory(), "webapps/examples");
        tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());

        tomcat.start();
View Full Code Here


    }

    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

    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

    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

        desc.getStoreFactory().setStoreAppender(new ConnectorStoreAppender());
        factory.setRegistry(registry);
        desc.addTransientAttribute("minProcessor");
        desc.addTransientAttribute("maxProcessor");
        registerDescriptor("Listener", LifecycleListener.class);
        connector = new Connector("HTTP/1.1");
    }
View Full Code Here

    }

    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.coyote.ajp.AjpProtocol");
            } 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

            throw new RuntimeOperationsException(new IllegalArgumentException(
                    "Attribute name is null"), "Attribute name is null");

        Object result = null;
        try {
            Connector connector = (Connector) getManagedResource();
            result = IntrospectionUtils.getProperty(connector, name);
        } catch (InstanceNotFoundException e) {
            throw new MBeanException(e);
        } catch (InvalidTargetObjectTypeException e) {
            throw new MBeanException(e);
View Full Code Here

        if (name == null)
            throw new RuntimeOperationsException(new IllegalArgumentException(
                    "Attribute name is null"), "Attribute name is null");

        try {
            Connector connector = (Connector) getManagedResource();
            IntrospectionUtils.setProperty(connector, name, String.valueOf(value));
        } catch (InstanceNotFoundException e) {
            throw new MBeanException(e);
        } catch (InvalidTargetObjectTypeException e) {
            throw new MBeanException(e);
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.