001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one
003     * or more contributor license agreements.  See the NOTICE file
004     * distributed with this work for additional information
005     * regarding copyright ownership.  The ASF licenses this file
006     * to you under the Apache License, Version 2.0 (the
007     * "License"); you may not use this file except in compliance
008     * with the License.  You may obtain a copy of the License at
009     *
010     *  http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing,
013     * software distributed under the License is distributed on an
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     * KIND, either express or implied.  See the License for the
016     * specific language governing permissions and limitations
017     * under the License.
018     */
019    
020    
021    package org.apache.geronimo.jetty6.connector;
022    
023    import org.apache.geronimo.jetty6.JettyContainer;
024    import org.apache.geronimo.management.geronimo.WebManager;
025    import org.apache.geronimo.gbean.GBeanInfo;
026    import org.apache.geronimo.gbean.GBeanInfoBuilder;
027    import org.apache.geronimo.system.threads.ThreadPool;
028    import org.mortbay.jetty.nio.BlockingChannelConnector;
029    
030    /**
031     * @version $Rev: 543715 $ $Date: 2007-06-02 04:10:16 -0400 (Sat, 02 Jun 2007) $
032     */
033    public class HTTPBlockingConnector extends JettyConnector {
034        public HTTPBlockingConnector(JettyContainer container, ThreadPool threadPool) {
035            super(container, new BlockingChannelConnector(), threadPool, "HTTPBlockingConnector");
036        }
037    
038        public String getProtocol() {
039            return WebManager.PROTOCOL_HTTP;
040        }
041    
042        public int getDefaultPort() {
043            return 80;
044        }
045    
046        public void setRedirectPort(int port) {
047            BlockingChannelConnector connector = (BlockingChannelConnector) listener;
048            connector.setConfidentialPort(port);
049            connector.setIntegralPort(port);
050            connector.setIntegralScheme("https");
051            connector.setConfidentialScheme("https");
052        }
053    
054        public static final GBeanInfo GBEAN_INFO;
055    
056        static {
057            GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Jetty Blocking Channel Connector HTTP", HTTPBlockingConnector.class, JettyConnector.GBEAN_INFO);
058            infoFactory.setConstructor(new String[]{"JettyContainer", "ThreadPool"});
059            GBEAN_INFO = infoFactory.getBeanInfo();
060        }
061    
062        public static GBeanInfo getGBeanInfo() {
063            return GBEAN_INFO;
064        }
065    }