Author: olamy
Date: Mon Dec 19 10:01:34 2011
New Revision: 1220675

URL: http://svn.apache.org/viewvc?rev=1220675&view=rev
Log:
[MTOMCAT-109] nio protocol is impossible to use with tomcat exec mojo.
add an option in tomcat runner to override it tru cli
-httpProtocol
as it can be change on application start not only in the produced jar.

Modified:
    
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
    
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7RunnerCli.java

Modified: 
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java?rev=1220675&r1=1220674&r2=1220675&view=diff
==============================================================================
--- 
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
 (original)
+++ 
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7Runner.java
 Mon Dec 19 10:01:34 2011
@@ -77,6 +77,8 @@ public class Tomcat7Runner
 
     public boolean debug = false;
 
+    public String httpProtocol;
+
     public File extractDirectory = new File( ".extract" );
 
     Catalina container;
@@ -150,6 +152,11 @@ public class Tomcat7Runner
 
             String connectorHttpProtocol = runtimeProperties.getProperty( 
HTTP_PROTOCOL_KEY );
 
+            if ( httpProtocol != null && httpProtocol.trim().length() > 0 )
+            {
+                connectorHttpProtocol = httpProtocol;
+            }
+
             debugMessage( "use connectorHttpProtocol:" + connectorHttpProtocol 
);
 
             Connector connector = new Connector( connectorHttpProtocol );

Modified: 
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7RunnerCli.java
URL: 
http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7RunnerCli.java?rev=1220675&r1=1220674&r2=1220675&view=diff
==============================================================================
--- 
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7RunnerCli.java
 (original)
+++ 
tomcat/maven-plugin/trunk/tomcat7-war-runner/src/main/java/org/apache/tomcat/maven/runner/Tomcat7RunnerCli.java
 Mon Dec 19 10:01:34 2011
@@ -65,12 +65,15 @@ public class Tomcat7RunnerCli
     static Option sysProps = OptionBuilder.withDescription( "use value for 
given property" ).hasArgs().withDescription(
         "key=value" ).withValueSeparator().create( 'D' );
 
+    static Option httpProtocol = OptionBuilder.withArgName( "httpProtocol" 
).hasArg().withDescription(
+        "http protocol to use: HTTP/1.1 or 
org.apache.coyote.http11.Http11NioProtocol" ).create( "httpProtocol" );
+
     static Options options = new Options();
 
     static
     {
         options.addOption( httpPort ).addOption( httpsPort ).addOption( 
ajpPort ).addOption( serverXmlPath ).addOption(
-            resetExtract ).addOption( help ).addOption( debug ).addOption( 
sysProps );
+            resetExtract ).addOption( help ).addOption( debug ).addOption( 
sysProps ).addOption( httpProtocol );
     }
 
 
@@ -128,6 +131,11 @@ public class Tomcat7RunnerCli
             tomcat7Runner.debug = true;
         }
 
+        if ( line.hasOption( httpProtocol.getOpt() ) )
+        {
+            tomcat7Runner.httpProtocol = line.getOptionValue( 
httpProtocol.getOpt() );
+        }
+
         if ( line.hasOption( sysProps.getOpt() ) )
         {
             Properties systemProperties = line.getOptionProperties( 
sysProps.getOpt() );



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to