Revision: 00d38f3f7b23
Author: George Vagenas <[email protected]>
Date: Wed Aug 7 09:20:44 2013
Log: Fixes issue 121
Conflicts:
core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java
http://code.google.com/p/jain-sip/source/detail?r=00d38f3f7b23&repo=ha
Modified:
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java
=======================================
---
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java
Tue Apr 16 06:26:36 2013
+++
/core/src/main/java/org/mobicents/ha/javax/sip/LoadBalancerHeartBeatingServiceImpl.java
Wed Aug 7 09:20:44 2013
@@ -457,6 +457,34 @@
String httpPortString =
System.getProperty("org.mobicents.properties.httpPort");
String sslPortString =
System.getProperty("org.mobicents.properties.sslPort");
+
+ if(httpPortString==null && sslPortString==null){
+ logger.logWarning("HTTP or HTTPS port couldn't be retrieved from System
properties, trying with JMX");
+ Integer httpPort = null;
+ Boolean httpBound = false;
+ Integer sslPort = null;
+ Boolean sslBound = false;
+
+ MBeanServer mBeanServer =
ManagementFactory.getPlatformMBeanServer();
+ try {
+ ObjectName http = new
ObjectName("jboss.as:socket-binding-group=standard-sockets,socket-binding=http");
+ httpPort = (Integer) mBeanServer.getAttribute(http,
"boundPort");
+ httpBound = (Boolean) mBeanServer.getAttribute(http,
"bound");
+
+ ObjectName https = new
ObjectName("jboss.as:socket-binding-group=standard-sockets,socket-binding=https");
+ sslPort = (Integer) mBeanServer.getAttribute(https,
"boundPort");
+ sslBound = (Boolean) mBeanServer.getAttribute(https,
"bound");
+
+ } catch (Exception e) {} //Ignore any exceptions
+
+ if(httpBound && httpPort!=null){
+ System.setProperty("org.mobicents.properties.httpPort",
String.valueOf(httpPort));
+ } else if (sslBound && sslPort!=null){
+ System.setProperty("org.mobicents.properties.sslPort",
String.valueOf(sslPort));
+ }
+ }
+
+ Properties props = System.getProperties();
for (String ipAddress : ipAddresses) {
SIPNode node = new SIPNode(hostName, ipAddress);
--
---
You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.