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