diff --git a/container/catalina-standalone/src/main/java/org/jboss/modcluster/container/catalina/standalone/ModClusterListener.java b/container/catalina-standalone/src/main/java/org/jboss/modcluster/container/catalina/standalone/ModClusterListener.java index 86249cff8..6e1250c73 100644 --- a/container/catalina-standalone/src/main/java/org/jboss/modcluster/container/catalina/standalone/ModClusterListener.java +++ b/container/catalina-standalone/src/main/java/org/jboss/modcluster/container/catalina/standalone/ModClusterListener.java @@ -361,6 +361,16 @@ public boolean enableContext(String hostName, String contextPath) { public Map getProxyConfiguration() { return this.service.getProxyConfiguration(); } + public String getProxyConfigurationString() { + String result = null; + + Map map = this.service.getProxyConfiguration(); + if (map.isEmpty()) + return null; + Object results[] = map.values().toArray(); + result = (String) results[0]; + return result; + } /** * {@inhericDoc} @@ -371,6 +381,16 @@ public Map getProxyConfiguration() { public Map getProxyInfo() { return this.service.getProxyInfo(); } + public String getProxyInfoString() { + String result = null; + + Map map = this.service.getProxyInfo(); + if (map.isEmpty()) + return null; + Object results[] = map.values().toArray(); + result = (String) results[0]; + return result; + } /** * {@inhericDoc} @@ -411,6 +431,9 @@ public void reset() { public boolean stop(long timeout, TimeUnit unit) { return this.service.stop(timeout, unit); } + public boolean stop(long timeout) { + return this.service.stop(timeout, TimeUnit.SECONDS); + } /** * {@inhericDoc} @@ -422,4 +445,7 @@ public boolean stop(long timeout, TimeUnit unit) { public boolean stopContext(String host, String path, long timeout, TimeUnit unit) { return this.service.stopContext(host, path, timeout, unit); } + public boolean stopContext(String host, String path, long timeout) { + return this.service.stopContext(host, path, timeout, TimeUnit.SECONDS); + } } diff --git a/core/src/main/java/org/jboss/modcluster/advertise/impl/MulticastSocketFactoryImpl.java b/core/src/main/java/org/jboss/modcluster/advertise/impl/MulticastSocketFactoryImpl.java index 7316bbc7f..a4a2be938 100755 --- a/core/src/main/java/org/jboss/modcluster/advertise/impl/MulticastSocketFactoryImpl.java +++ b/core/src/main/java/org/jboss/modcluster/advertise/impl/MulticastSocketFactoryImpl.java @@ -46,7 +46,21 @@ public class MulticastSocketFactoryImpl implements MulticastSocketFactory { public MulticastSocketFactoryImpl() { String value = this.getSystemProperty("os.name"); - this.linuxlike = (value != null) && (value.toLowerCase().startsWith("linux") || value.toLowerCase().startsWith("mac") || value.toLowerCase().startsWith("hp")); + boolean linuxlike = (value != null) && (value.toLowerCase().startsWith("linux") || value.toLowerCase().startsWith("hp")); + if (value != null && value.toLowerCase().startsWith("mac")) { + value = this.getSystemProperty("os.version"); + if (value != null) { + String[] subs = value.split("\\." ); + if (Integer.parseInt(subs[0]) > 10) { + linuxlike = false; + } else if (Integer.parseInt(subs[0]) == 10 && Integer.parseInt(subs[1]) > 9) { + linuxlike = false; + } else if (Integer.parseInt(subs[0]) == 10 && Integer.parseInt(subs[1]) == 9 && Integer.parseInt(subs[2]) >=5 ) { + linuxlike = false; + } + } + } + this.linuxlike = linuxlike; } private String getSystemProperty(final String key) { diff --git a/native/mod_manager/mod_manager.c b/native/mod_manager/mod_manager.c index a4eb0b722..9ef40300b 100644 --- a/native/mod_manager/mod_manager.c +++ b/native/mod_manager/mod_manager.c @@ -113,6 +113,8 @@ #define TEXT_PLAIN 1 #define TEXT_XML 2 +static int use_ws = 0; + /* shared memory */ static mem_t *contextstatsmem = NULL; static mem_t *nodestatsmem = NULL; @@ -499,6 +501,11 @@ static int manager_init(apr_pool_t *p, apr_pool_t *plog, /* first call do nothing */ apr_pool_userdata_set((const void *)1, userdata_key, apr_pool_cleanup_null, s->process->pool); return OK; + } else { + /* check if we should use ws or http */ + if (ap_find_linked_module("mod_proxy_wstunnel.c") != NULL) { + use_ws = -1; + } } if (mconf->basefilename) { @@ -975,6 +982,12 @@ static char * process_config(request_rec *r, char **ptr, int *errtype) return SROUBAD; } + if (use_ws && strcmp(nodeinfo.mess.Type, "ajp")) { + if (!strcmp(nodeinfo.mess.Type, "http")) + strcpy(nodeinfo.mess.Type, "ws"); + if (!strcmp(nodeinfo.mess.Type, "https")) + strcpy(nodeinfo.mess.Type, "wss"); + } /* Insert or update balancer description */ if (insert_update_balancer(balancerstatsmem, &balancerinfo) != APR_SUCCESS) { *errtype = TYPEMEM;