Source Code Cross Referenced for HTTPSSelectChannelConnector.java in  » EJB-Server-geronimo » plugins » org » apache » geronimo » jetty6 » connector » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server geronimo » plugins » org.apache.geronimo.jetty6.connector 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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:        package org.apache.geronimo.jetty6.connector;
021:
022:        import javax.net.ssl.KeyManagerFactory;
023:
024:        import org.apache.geronimo.gbean.GBeanInfo;
025:        import org.apache.geronimo.gbean.GBeanInfoBuilder;
026:        import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
027:        import org.apache.geronimo.jetty6.JettyContainer;
028:        import org.apache.geronimo.jetty6.JettySecureConnector;
029:        import org.apache.geronimo.management.geronimo.KeystoreManager;
030:        import org.apache.geronimo.management.geronimo.WebManager;
031:        import org.apache.geronimo.system.threads.ThreadPool;
032:        import org.mortbay.jetty.nio.SelectChannelConnector;
033:
034:        /**
035:         * Implementation of a HTTPS connector based on Jetty's SslConnector (which uses pure JSSE).
036:         *
037:         * @version $Rev: 564252 $ $Date: 2007-08-09 09:02:09 -0700 (Thu, 09 Aug 2007) $
038:         */
039:        public class HTTPSSelectChannelConnector extends JettyConnector
040:                implements  JettySecureConnector {
041:            private final GeronimoSelectChannelSSLListener https;
042:            private String algorithm;
043:
044:            public HTTPSSelectChannelConnector(JettyContainer container,
045:                    ThreadPool threadPool, KeystoreManager keystoreManager) {
046:                super (container, new GeronimoSelectChannelSSLListener(
047:                        keystoreManager), threadPool,
048:                        "HTTPSSelectChannelConnector");
049:                https = (GeronimoSelectChannelSSLListener) listener;
050:            }
051:
052:            public int getDefaultPort() {
053:                return 443;
054:            }
055:
056:            public String getProtocol() {
057:                return WebManager.PROTOCOL_HTTPS;
058:            }
059:
060:            public String getAlgorithm() {
061:                return algorithm;
062:            }
063:
064:            /**
065:             * Algorithm to use.
066:             * As different JVMs have different implementations available, the default algorithm can be used by supplying the value "Default".
067:             *
068:             * @param algorithm the algorithm to use, or "Default" to use the default from {@link javax.net.ssl.KeyManagerFactory#getDefaultAlgorithm()}
069:             */
070:            public void setAlgorithm(String algorithm) {
071:                // cache the value so the null
072:                this .algorithm = algorithm;
073:                if ("default".equalsIgnoreCase(algorithm)) {
074:                    algorithm = KeyManagerFactory.getDefaultAlgorithm();
075:                }
076:                https.setSslKeyManagerFactoryAlgorithm(algorithm);
077:            }
078:
079:            public String getSecureProtocol() {
080:                return https.getProtocol();
081:            }
082:
083:            public void setSecureProtocol(String protocol) {
084:                https.setProtocol(protocol);
085:            }
086:
087:            public void setClientAuthRequired(boolean needClientAuth) {
088:                https.setNeedClientAuth(needClientAuth);
089:            }
090:
091:            public boolean isClientAuthRequired() {
092:                return https.getNeedClientAuth();
093:            }
094:
095:            public void setClientAuthRequested(boolean wantClientAuth) {
096:                https.setWantClientAuth(wantClientAuth);
097:            }
098:
099:            public boolean isClientAuthRequested() {
100:                return https.getWantClientAuth();
101:            }
102:
103:            public void setKeyStore(String keyStore) {
104:                https.setKeyStore(keyStore);
105:            }
106:
107:            public String getKeyStore() {
108:                return https.getKeyStore();
109:            }
110:
111:            public void setTrustStore(String trustStore) {
112:                https.setTrustStore(trustStore);
113:            }
114:
115:            public String getTrustStore() {
116:                return https.getTrustStore();
117:            }
118:
119:            public void setKeyAlias(String keyAlias) {
120:                https.setKeyAlias(keyAlias);
121:            }
122:
123:            public String getKeyAlias() {
124:                return https.getKeyAlias();
125:            }
126:
127:            //TODO does this make sense???
128:            public void setRedirectPort(int port) {
129:                SelectChannelConnector socketListener = (SelectChannelConnector) listener;
130:                socketListener.setConfidentialPort(port);
131:                socketListener.setIntegralPort(port);
132:                socketListener.setIntegralScheme("https");
133:                socketListener.setConfidentialScheme("https");
134:            }
135:
136:            public static final GBeanInfo GBEAN_INFO;
137:
138:            static {
139:                GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(
140:                        "Jetty SelectChannel Connector HTTPS",
141:                        HTTPSSelectChannelConnector.class,
142:                        JettyConnector.GBEAN_INFO);
143:                infoFactory.addAttribute("algorithm", String.class, true, true);
144:                infoFactory.addAttribute("secureProtocol", String.class, true,
145:                        true);
146:                infoFactory.addAttribute("keyStore", String.class, true, true);
147:                infoFactory.addAttribute("keyAlias", String.class, true, true);
148:                infoFactory
149:                        .addAttribute("trustStore", String.class, true, true);
150:                infoFactory.addAttribute("clientAuthRequired", boolean.class,
151:                        true, true);
152:                infoFactory.addAttribute("clientAuthRequested", boolean.class,
153:                        true, true);
154:                infoFactory.addReference("KeystoreManager",
155:                        KeystoreManager.class, NameFactory.GERONIMO_SERVICE);
156:                infoFactory.addInterface(JettySecureConnector.class);
157:                infoFactory.setConstructor(new String[] { "JettyContainer",
158:                        "ThreadPool", "KeystoreManager" });
159:                GBEAN_INFO = infoFactory.getBeanInfo();
160:            }
161:
162:            public static GBeanInfo getGBeanInfo() {
163:                return GBEAN_INFO;
164:            }
165:
166:            // ================= NO LONGER USED!!! =====================
167:            // todo: remove these from the SSL interface
168:
169:            public String getKeystoreFileName() {
170:                return null;
171:            }
172:
173:            public void setKeystoreFileName(String name) {
174:            }
175:
176:            public void setKeystorePassword(String password) {
177:            }
178:
179:            public String getKeystoreType() {
180:                return null;
181:            }
182:
183:            public void setKeystoreType(String type) {
184:            }
185:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.