Package org.apache.catalina.connector

Examples of org.apache.catalina.connector.Connector


       
        return factory;
    }
   
    private Connector createSslConnector() {
        Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
        Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();
        final int httpsPort = Utils.GetSystemPort(Constants.SYS_HTTPS_PORT);
        try {
          File keyStore = com.groupon.odo.proxylib.Utils.copyResourceToLocalFile("tomcat.ks", "tomcat.ks");
          connector.setScheme("https");
          connector.setSecure(true);
          connector.setPort(httpsPort);
          protocol.setSSLEnabled(true);
          protocol.setSslProtocol("TLS");
          protocol.setKeystoreFile(keyStore.getAbsolutePath());
          protocol.setKeystorePass("changeit");
          return connector;
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

    public boolean isPrintValue(Object bean, Object bean2, String attrName,
            StoreDescription desc) {
        boolean isPrint = super.isPrintValue(bean, bean2, attrName, desc);
        if (isPrint) {
            if ("jkHome".equals(attrName)) {
                Connector connector = ((Connector) bean);
                File catalinaBase = getCatalinaBase();
                File jkHomeBase = getJkHomeBase((String) connector
                        .getProperty("jkHome"), catalinaBase);
                isPrint = !catalinaBase.equals(jkHomeBase);

            }
        }
View Full Code Here

        if (service instanceof StandardService) {
            ((StandardService) service).addPropertyChangeListener(this);
        }

        // Create the MBeans for the corresponding Connectors
        Connector connectors[] = service.findConnectors();
        for (int j = 0; j < connectors.length; j++) {
            createMBeans(connectors[j]);
        }

        // Create the MBean for the associated Engine and friends
View Full Code Here

        if (engine != null) {
            destroyMBeans(engine);
        }

        // Deregister the MBeans for the corresponding Connectors
        Connector connectors[] = service.findConnectors();
        for (int j = 0; j < connectors.length; j++) {
            destroyMBeans(connectors[j], service);
        }

        if (service instanceof StandardService) {
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

     *
     * @exception Exception if an MBean cannot be created or registered
     */
    private String createConnector(String parent, String address, int port, boolean isAjp, boolean isSSL)
        throws Exception {
        Connector retobj = new Connector();
        if ((address!=null) && (address.length()>0)) {
            retobj.setProperty("address", address);
        }
        // Set port number
        retobj.setPort(port);
        // Set the protocol
        retobj.setProtocol(isAjp ? "AJP/1.3" : "HTTP/1.1");
        // Set SSL
        retobj.setSecure(isSSL);
        retobj.setScheme(isSSL ? "https" : "http");
        // Add the new instance to its parent component
        // FIX ME - addConnector will fail
        ObjectName pname = new ObjectName(parent);
        Service service = getService(pname);
        service.addConnector(retobj);
       
        // Return the corresponding MBean name
        ObjectName coname = retobj.getObjectName();
       
        return (coname.toString());
    }
View Full Code Here

        Server server = ServerFactory.getServer();
        Service service = getService(oname);
        String port = oname.getKeyProperty("port");
        //String address = oname.getKeyProperty("address");

        Connector conns[] = (Connector[]) service.findConnectors();

        for (int i = 0; i < conns.length; i++) {
            String connAddress = String.valueOf(conns[i].getProperty("address"));
            String connPort = ""+conns[i].getPort();
View Full Code Here

        if (service instanceof StandardService) {
            ((StandardService) service).addPropertyChangeListener(this);
        }

        // Create the MBeans for the corresponding Connectors
        Connector connectors[] = service.findConnectors();
        for (int j = 0; j < connectors.length; j++) {
            createMBeans(connectors[j]);
        }

        // Create the MBean for the associated Engine and friends
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.