You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by wa...@apache.org on 2009/01/02 13:56:42 UTC
svn commit: r730709 -
/felix/trunk/http.jetty/src/main/java/org/apache/felix/http/jetty/Activator.java
Author: walkerr
Date: Fri Jan 2 04:56:42 2009
New Revision: 730709
URL: http://svn.apache.org/viewvc?rev=730709&view=rev
Log:
FELIX-870 Added config property to allow NIO to be selectively disabled in favour of simple blocking sockets.
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=730709&r1=730708&r2=730709&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 Fri Jan 2 04:56:42 2009
@@ -23,6 +23,7 @@
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.handler.HandlerCollection;
+import org.mortbay.jetty.bio.SocketConnector;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.security.HashUserRealm;
import org.mortbay.jetty.security.SslSocketConnector;
@@ -87,6 +88,10 @@
name of the service property to set with the https port used. If not supplied
then the HTTPS_PORT property name will be used for the service property */
public static final String HTTPS_SVCPROP_PORT = "org.apache.felix.http.svcprop.port.secure";
+
+ /** Felix specific property. Controls whether NIO will be used. If not supplied
+ then will default to true. */
+ public static final String HTTP_NIO = "org.apache.felix.http.nio";
/** Legacy Oscar property support. Controls whether to enable HTTPS */
public static final String OSCAR_HTTPS_ENABLE = "org.ungoverned.osgi.bundle.https.enable";
@@ -253,7 +258,8 @@
m_server.addUserRealm( realm );
// Add a regular HTTP listener
- Connector connector = new SelectChannelConnector();
+ Connector connector = getBooleanProperty( HTTP_NIO, true ) ?
+ (Connector) new SelectChannelConnector() : (Connector) new SocketConnector();
connector.addLifeCycleListener(
new ConnectorListener(getStringProperty(HTTP_SVCPROP_PORT, HTTP_PORT))
);