Author: pferraro
Date: 2009-02-12 16:01:48 -0500 (Thu, 12 Feb 2009)
New Revision: 2286
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPRequestFactory.java
Log:
Consolidate isAJP() logic into Utils method
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java 2009-02-11 14:39:35
UTC (rev 2285)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/Utils.java 2009-02-12 21:01:48
UTC (rev 2286)
@@ -78,14 +78,10 @@
* protocol="org.apache.coyote.ajp.AjpProtocol"
* protocol="AJP/1.3"
*/
- if (connector.getProtocol().startsWith("AJP")) // Return the first AJP
connector found
+ if (isAJP(connector))
{
return connector;
}
- if (connector.getProtocol().startsWith("org.apache.coyote.ajp")) //
Return the first AJP connector found
- {
- return connector;
- }
ProtocolHandler handler = connector.getProtocolHandler();
@@ -107,6 +103,13 @@
return bestConnector;
}
+ public static boolean isAJP(Connector connector)
+ {
+ String protocol = connector.getProtocol();
+
+ return protocol.startsWith("AJP") ||
protocol.startsWith("org.apache.coyote.ajp");
+ }
+
/**
* Return the address on which the connector is bound.
*
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPRequestFactory.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPRequestFactory.java 2009-02-11
14:39:35 UTC (rev 2285)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPRequestFactory.java 2009-02-12
21:01:48 UTC (rev 2286)
@@ -62,12 +62,7 @@
boolean reverseConnection =
Boolean.TRUE.equals(IntrospectionUtils.getProperty(handler,
"reverseConnection"));
boolean ssl = Boolean.TRUE.equals(IntrospectionUtils.getProperty(handler,
"SSLEnabled"));
- // The name is not enough when using org.apache.jk.common.ChannelSocket (it is
container).
- boolean ajp = ((String) IntrospectionUtils.getProperty(handler,
"name")).startsWith("ajp-");
- if (!ajp)
- ajp = ((String) IntrospectionUtils.getProperty(connector,
"protocol")).startsWith("AJP");
- if (!ajp)
- ajp = ((String) IntrospectionUtils.getProperty(connector,
"protocol")).startsWith("org.apache.coyote.ajp");
+ boolean ajp = Utils.isAJP(connector);
if (reverseConnection)
{