Save This Page
Home » geronimo-2.2-source-release » org.apache.geronimo.jetty7.connector » [javadoc | source]
    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one
    3    * or more contributor license agreements.  See the NOTICE file
    4    * distributed with this work for additional information
    5    * regarding copyright ownership.  The ASF licenses this file
    6    * to you under the Apache License, Version 2.0 (the
    7    * "License"); you may not use this file except in compliance
    8    * with the License.  You may obtain a copy of the License at
    9    *
   10    *  http://www.apache.org/licenses/LICENSE-2.0
   11    *
   12    * Unless required by applicable law or agreed to in writing,
   13    * software distributed under the License is distributed on an
   14    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   15    * KIND, either express or implied.  See the License for the
   16    * specific language governing permissions and limitations
   17    * under the License.
   18    */
   19   
   20   
   21   package org.apache.geronimo.jetty7.connector;
   22   
   23   import org.apache.geronimo.jetty7.JettyContainer;
   24   import org.apache.geronimo.management.geronimo.WebManager;
   25   import org.apache.geronimo.gbean.GBeanInfo;
   26   import org.apache.geronimo.gbean.GBeanInfoBuilder;
   27   import org.apache.geronimo.system.threads.ThreadPool;
   28   import org.eclipse.jetty.server.nio.BlockingChannelConnector;
   29   
   30   /**
   31    * @version $Rev: 759104 $ $Date: 2009-03-27 04:21:58 -0700 (Fri, 27 Mar 2009) $
   32    */
   33   public class HTTPBlockingConnector extends JettyConnector {
   34       public HTTPBlockingConnector(JettyContainer container, ThreadPool threadPool) {
   35           super(container, new BlockingChannelConnector(), threadPool, "HTTPBlockingConnector");
   36       }
   37   
   38       public String getProtocol() {
   39           return WebManager.PROTOCOL_HTTP;
   40       }
   41   
   42       public int getDefaultPort() {
   43           return 80;
   44       }
   45   
   46       public void setRedirectPort(int port) {
   47           BlockingChannelConnector connector = (BlockingChannelConnector) listener;
   48           connector.setConfidentialPort(port);
   49           connector.setIntegralPort(port);
   50           connector.setIntegralScheme("https");
   51           connector.setConfidentialScheme("https");
   52       }
   53   
   54       public static final GBeanInfo GBEAN_INFO;
   55   
   56       static {
   57           GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Jetty Blocking Channel Connector HTTP", HTTPBlockingConnector.class, JettyConnector.GBEAN_INFO);
   58           infoFactory.setConstructor(new String[]{"JettyContainer", "ThreadPool"});
   59           GBEAN_INFO = infoFactory.getBeanInfo();
   60       }
   61   
   62       public static GBeanInfo getGBeanInfo() {
   63           return GBEAN_INFO;
   64       }
   65   }

Save This Page
Home » geronimo-2.2-source-release » org.apache.geronimo.jetty7.connector » [javadoc | source]