[jboss-cvs] JBoss Profiler SVN: r451 - in branches/JBossProfiler2: src/etc and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sun May 18 10:56:37 EDT 2008
Author: jesper.pedersen
Date: 2008-05-18 10:56:36 -0400 (Sun, 18 May 2008)
New Revision: 451
Modified:
branches/JBossProfiler2/doc/README.txt
branches/JBossProfiler2/src/etc/jboss-service.xml
branches/JBossProfiler2/src/main/org/jboss/profiler/as/Communicator.java
branches/JBossProfiler2/src/main/org/jboss/profiler/as/CommunicatorMBean.java
Log:
Automatic detect the binding address when running inside the AS
Modified: branches/JBossProfiler2/doc/README.txt
===================================================================
--- branches/JBossProfiler2/doc/README.txt 2008-05-17 16:09:31 UTC (rev 450)
+++ branches/JBossProfiler2/doc/README.txt 2008-05-18 14:56:36 UTC (rev 451)
@@ -205,9 +205,6 @@
-------------------
Configuration can be found in jboss-service.xml
-Host The host name
- default: localhost
-
Socket Should socket communication be enabled ?
[true|false] default: true
Modified: branches/JBossProfiler2/src/etc/jboss-service.xml
===================================================================
--- branches/JBossProfiler2/src/etc/jboss-service.xml 2008-05-17 16:09:31 UTC (rev 450)
+++ branches/JBossProfiler2/src/etc/jboss-service.xml 2008-05-18 14:56:36 UTC (rev 451)
@@ -18,9 +18,6 @@
<mbean code="org.jboss.profiler.as.Communicator"
name="org.jboss.profiler:service=Communicator">
- <!-- The host name -->
- <attribute name="Host">localhost</attribute>
-
<!-- Socket -->
<attribute name="Socket">true</attribute>
Modified: branches/JBossProfiler2/src/main/org/jboss/profiler/as/Communicator.java
===================================================================
--- branches/JBossProfiler2/src/main/org/jboss/profiler/as/Communicator.java 2008-05-17 16:09:31 UTC (rev 450)
+++ branches/JBossProfiler2/src/main/org/jboss/profiler/as/Communicator.java 2008-05-18 14:56:36 UTC (rev 451)
@@ -26,6 +26,8 @@
import org.jboss.profiler.connectors.SocketHandler;
import org.jboss.profiler.shared.Version;
+import java.net.InetAddress;
+
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.transport.Connector;
@@ -76,7 +78,14 @@
* Constructor
*/
public Communicator() {
- host = "localhost";
+ host = System.getProperty("jboss.bind.address");
+ if (host == null || host.trim().equals("")) {
+ try {
+ host = InetAddress.getLocalHost().getHostName();
+ } catch (Throwable t) {
+ host = "localhost";
+ }
+ }
socket = true;
socketPort = 5400;
@@ -102,33 +111,6 @@
}
/**
- * Set the host
- * @param h The host
- */
- public void setHost(String h) {
- host = h;
-
- try {
- if (initialized && socket) {
- stopSocket();
- startSocket();
- }
-
- if (initialized && rmi) {
- stopRMI();
- startRMI();
- }
-
- if (initialized && http) {
- stopHTTP();
- startHTTP();
- }
- } catch (Exception e) {
- log.error(e.getMessage(), e);
- }
- }
-
- /**
* Is socket enabled ?
* @return True if enabled; otherwise false
*/
Modified: branches/JBossProfiler2/src/main/org/jboss/profiler/as/CommunicatorMBean.java
===================================================================
--- branches/JBossProfiler2/src/main/org/jboss/profiler/as/CommunicatorMBean.java 2008-05-17 16:09:31 UTC (rev 450)
+++ branches/JBossProfiler2/src/main/org/jboss/profiler/as/CommunicatorMBean.java 2008-05-18 14:56:36 UTC (rev 451)
@@ -34,12 +34,6 @@
public String getHost();
/**
- * Set the host
- * @param h The host
- */
- public void setHost(String h);
-
- /**
* Is socket enabled ?
* @return True if enabled; otherwise false
*/
More information about the jboss-cvs-commits
mailing list