felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r738251 - /felix/trunk/http.jetty/src/main/java/org/apache/felix/http/jetty/Activator.java
Date Tue, 27 Jan 2009 21:28:48 GMT
Author: marrs
Date: Tue Jan 27 21:28:47 2009
New Revision: 738251

URL: http://svn.apache.org/viewvc?rev=738251&view=rev
Log:
FELIX-783 Extended initializeHTTPS() to use NIO or traditional IO based on the property.

Modified:
    felix/trunk/http.jetty/src/main/java/org/apache/felix/http/jetty/Activator.java

Modified: felix/trunk/http.jetty/src/main/java/org/apache/felix/http/jetty/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/http.jetty/src/main/java/org/apache/felix/http/jetty/Activator.java?rev=738251&r1=738250&r2=738251&view=diff
==============================================================================
--- felix/trunk/http.jetty/src/main/java/org/apache/felix/http/jetty/Activator.java (original)
+++ felix/trunk/http.jetty/src/main/java/org/apache/felix/http/jetty/Activator.java Tue Jan
27 21:28:47 2009
@@ -26,6 +26,7 @@
 import org.mortbay.jetty.bio.SocketConnector;
 import org.mortbay.jetty.nio.SelectChannelConnector;
 import org.mortbay.jetty.security.HashUserRealm;
+import org.mortbay.jetty.security.SslSelectChannelConnector;
 import org.mortbay.jetty.security.SslSocketConnector;
 import org.mortbay.jetty.servlet.Context;
 import org.mortbay.jetty.servlet.OsgiServletHandler;
@@ -342,33 +343,42 @@
     //      keystore, passwords etc. into it's own pluggable service
     protected void initializeHTTPS() throws Exception
     {
-
-        SslSocketConnector s_listener = new SslSocketConnector();
-        s_listener.addLifeCycleListener(
-                new ConnectorListener(m_httpsPortProperty)
-            );
-                
-        s_listener.setPort( m_httpsPort );
-        s_listener.setMaxIdleTime( 60000 );
-
-        if ( m_keystore != null )
-        {
-            s_listener.setKeystore( m_keystore );
-        }
-
-        if ( m_passwd != null )
-        {
-            System.setProperty( SslSocketConnector.PASSWORD_PROPERTY, m_passwd );
-            s_listener.setPassword( m_passwd );
+        if (m_useNIO) {
+            SslSelectChannelConnector s_listener = new SslSelectChannelConnector();
+            s_listener.addLifeCycleListener(new ConnectorListener(m_httpsPortProperty));
+            s_listener.setPort(m_httpsPort);
+            s_listener.setMaxIdleTime(60000);
+            if (m_keystore != null) {
+                s_listener.setKeystore(m_keystore);
+            }
+            if (m_passwd != null) {
+                System.setProperty(SslSelectChannelConnector.PASSWORD_PROPERTY, m_passwd);
+                s_listener.setPassword(m_passwd);
+            }
+            if (m_keyPasswd != null) {
+                System.setProperty(SslSelectChannelConnector.KEYPASSWORD_PROPERTY, m_keyPasswd);
+                s_listener.setKeyPassword(m_keyPasswd);
+            }
+            m_server.addConnector(s_listener);
         }
-
-        if ( m_keyPasswd != null )
-        {
-            System.setProperty( SslSocketConnector.KEYPASSWORD_PROPERTY, m_keyPasswd );
-            s_listener.setKeyPassword( m_keyPasswd );
+        else {
+            SslSocketConnector s_listener = new SslSocketConnector();
+            s_listener.addLifeCycleListener(new ConnectorListener(m_httpsPortProperty));
+            s_listener.setPort(m_httpsPort);
+            s_listener.setMaxIdleTime(60000);
+            if (m_keystore != null) {
+                s_listener.setKeystore(m_keystore);
+            }
+            if (m_passwd != null) {
+                System.setProperty(SslSocketConnector.PASSWORD_PROPERTY, m_passwd);
+                s_listener.setPassword(m_passwd);
+            }
+            if (m_keyPasswd != null) {
+                System.setProperty(SslSocketConnector.KEYPASSWORD_PROPERTY, m_keyPasswd);
+                s_listener.setKeyPassword(m_keyPasswd);
+            }
+            m_server.addConnector(s_listener);
         }
-
-        m_server.addConnector( s_listener );
     }
 
 



Mime
View raw message