Package org.apache.coyote

Examples of org.apache.coyote.ProtocolHandler


      {
         log.error("Protocol handler class instatiation failed: protocolHandlerClassName", e);
         return;
      }
     
      ProtocolHandler protocolHandler = null;
      for (int i = 0; i < connectHomes.size(); i++)
      {
         try
         {
            protocolHandler = (ProtocolHandler) clazz.newInstance();
         }
         catch(Exception e)
         {
            log.error("Protocol handler instantiation failed", e);
            return;
         }
         protocolHandler.setAdapter(this);

         // Pass all attributes to the protocol handler
         Iterator keys = config.keySet().iterator();
         while(keys.hasNext())
         {
View Full Code Here


      {
         for (int i = 0; i < protocolHandlers.size(); i++)
         {
            try
            {
               final ProtocolHandler protocolHandler = (ProtocolHandler) protocolHandlers.get(i);
               Home home = (Home) getHomes().get(i);
               setProperty(protocolHandler, "address", home.host);
               setProperty(protocolHandler, "port", "" + home.port);

               //TODO: -TME - Should not have to hard set this every time.  Should
               // be a way to figure out if this is needed or not.

               // Need to set the MBeanServer to use since there is no direct way to do it.
               setProperty(protocolHandler, "locator", getLocator().getLocatorURI());
               RemotingSSLImplementation.setMBeanServer(getLocator().getLocatorURI(), getMBeanServer());

               ServerSocketFactory svrSocketFactory = getServerSocketFactory();
               if(svrSocketFactory != null)
               {
                  RemotingServerSocketFactory.setServerSocketFactory(getLocator().getLocatorURI(), svrSocketFactory);
                  setProperty(protocolHandler, "SocketFactory", RemotingServerSocketFactory.class.getName());
               }

               try
               {
                  AccessController.doPrivileged( new PrivilegedExceptionAction()
                  {
                     public Object run() throws Exception
                     {
                        protocolHandler.init();
                        protocolHandler.start();
                        return null;
                     }
                  });
               }
               catch (PrivilegedActionException e)
View Full Code Here

      {
         log.error("Protocol handler class instatiation failed: protocolHandlerClassName", e);
         return;
      }
     
      ProtocolHandler protocolHandler = null;
      for (int i = 0; i < connectHomes.size(); i++)
      {
         try
         {
            protocolHandler = (ProtocolHandler) clazz.newInstance();
         }
         catch(Exception e)
         {
            log.error("Protocol handler instantiation failed", e);
            return;
         }
         protocolHandler.setAdapter(this);

         // Pass all attributes to the protocol handler
         Iterator keys = config.keySet().iterator();
         while(keys.hasNext())
         {
View Full Code Here

      {
         for (int i = 0; i < protocolHandlers.size(); i++)
         {
            try
            {
               final ProtocolHandler protocolHandler = (ProtocolHandler) protocolHandlers.get(i);
               Home home = (Home) getHomes().get(i);
               setProperty(protocolHandler, "address", home.host);
               setProperty(protocolHandler, "port", "" + home.port);

               //TODO: -TME - Should not have to hard set this every time.  Should
               // be a way to figure out if this is needed or not.

               // Need to set the MBeanServer to use since there is no direct way to do it.
               setProperty(protocolHandler, "locator", getLocator().getLocatorURI());
               RemotingSSLImplementation.setMBeanServer(getLocator().getLocatorURI(), getMBeanServer());

               ServerSocketFactory svrSocketFactory = getServerSocketFactory();
               if(svrSocketFactory != null)
               {
                  RemotingServerSocketFactory.setServerSocketFactory(getLocator().getLocatorURI(), svrSocketFactory);
                  setProperty(protocolHandler, "SocketFactory", RemotingServerSocketFactory.class.getName());
               }

               try
               {
                  AccessController.doPrivileged( new PrivilegedExceptionAction()
                  {
                     public Object run() throws Exception
                     {
                        protocolHandler.init();
                        protocolHandler.start();
                        return null;
                     }
                  });
               }
               catch (PrivilegedActionException e)
View Full Code Here

            Iterator it = protocolHandlers.iterator();
            while (it.hasNext())
            {
               try
               {
                  ProtocolHandler protocolHandler = (ProtocolHandler) it.next();
                  protocolHandler.destroy();
               }
               catch(Exception e)
               {
                  log.error("Stop error", e);
               }
View Full Code Here

      if (this.maxThreads > 0) {
        factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
          @Override
          public void customize(Connector connector) {
            ProtocolHandler handler = connector.getProtocolHandler();
            if (handler instanceof AbstractProtocol) {
              @SuppressWarnings("rawtypes")
              AbstractProtocol protocol = (AbstractProtocol) handler;
              protocol.setMaxThreads(Tomcat.this.maxThreads);
            }
          }
        });
      }

      if (this.maxHttpHeaderSize > 0) {
        factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
          @Override
          public void customize(Connector connector) {
            ProtocolHandler handler = connector.getProtocolHandler();
            if (handler instanceof AbstractHttp11Protocol) {
              @SuppressWarnings("rawtypes")
              AbstractHttp11Protocol protocol = (AbstractHttp11Protocol) handler;
              protocol.setMaxHttpHeaderSize(Tomcat.this.maxHttpHeaderSize);
            }
View Full Code Here

            throw new ContainerException(e);
        }

        Connector[] cons = embedded.findConnectors();
        for (int i = 0; i < cons.length; i++) {
            ProtocolHandler ph = cons[i].getProtocolHandler();
            if (ph instanceof Http11Protocol) {
                Http11Protocol hph = (Http11Protocol) ph;
                Debug.logInfo("Connector " + hph.getProtocol() + " @ " + hph.getPort() + " - " +
                    (hph.getSecure() ? "secure" : "not-secure") + " [" + cons[i].getProtocolHandlerClassName() + "] started.", module);
            } else {
View Full Code Here

    }

    public Connector(String protocol) {
        setProtocol(protocol);
        // Instantiate protocol handler
        ProtocolHandler p = null;
        try {
            Class<?> clazz = Class.forName(protocolHandlerClassName);
            p = (ProtocolHandler) clazz.newInstance();
        } catch (Exception e) {
            log.error(sm.getString(
View Full Code Here

                TesterSupport.isRenegotiationSupported(getTomcatInstance()));

        TesterSupport.configureClientCertContext(tomcat);

        // Override the defaults
        ProtocolHandler handler = tomcat.getConnector().getProtocolHandler();
        if (handler instanceof AbstractHttp11JsseProtocol) {
            ((AbstractHttp11JsseProtocol<?>) handler).setTruststoreFile(null);
        } else {
            // Unexpected
            fail("Unexpected handler type");
View Full Code Here

TOP

Related Classes of org.apache.coyote.ProtocolHandler

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.