01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
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: package org.apache.geronimo.jetty6.connector;
21:
22: import org.apache.geronimo.jetty6.JettyContainer;
23: import org.apache.geronimo.management.geronimo.WebManager;
24: import org.apache.geronimo.gbean.GBeanInfo;
25: import org.apache.geronimo.gbean.GBeanInfoBuilder;
26: import org.apache.geronimo.system.threads.ThreadPool;
27: import org.mortbay.jetty.nio.BlockingChannelConnector;
28:
29: /**
30: * @version $Rev: 543715 $ $Date: 2007-06-02 01:10:16 -0700 (Sat, 02 Jun 2007) $
31: */
32: public class HTTPBlockingConnector extends JettyConnector {
33: public HTTPBlockingConnector(JettyContainer container,
34: ThreadPool threadPool) {
35: super (container, new BlockingChannelConnector(), threadPool,
36: "HTTPBlockingConnector");
37: }
38:
39: public String getProtocol() {
40: return WebManager.PROTOCOL_HTTP;
41: }
42:
43: public int getDefaultPort() {
44: return 80;
45: }
46:
47: public void setRedirectPort(int port) {
48: BlockingChannelConnector connector = (BlockingChannelConnector) listener;
49: connector.setConfidentialPort(port);
50: connector.setIntegralPort(port);
51: connector.setIntegralScheme("https");
52: connector.setConfidentialScheme("https");
53: }
54:
55: public static final GBeanInfo GBEAN_INFO;
56:
57: static {
58: GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(
59: "Jetty Blocking Channel Connector HTTP",
60: HTTPBlockingConnector.class, JettyConnector.GBEAN_INFO);
61: infoFactory.setConstructor(new String[] { "JettyContainer",
62: "ThreadPool" });
63: GBEAN_INFO = infoFactory.getBeanInfo();
64: }
65:
66: public static GBeanInfo getGBeanInfo() {
67: return GBEAN_INFO;
68: }
69: }
|