geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kh...@apache.org
Subject [17/35] geode git commit: GEODE-2671: When a locator is started with a custom jmx-manager-port, the embedded pulse server still tries to connect to jmx using 1099
Date Tue, 28 Mar 2017 16:46:45 GMT
GEODE-2671: When a locator is started with a custom jmx-manager-port, the embedded pulse server
still tries to connect to jmx using 1099


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/45da1b25
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/45da1b25
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/45da1b25

Branch: refs/heads/feature/GEODE-2420
Commit: 45da1b25ba4dff064ed64c9b445f5c47539aedfb
Parents: afc5e3a
Author: Kevin J. Duling <kduling@pivotal.io>
Authored: Mon Mar 20 14:52:54 2017 -0700
Committer: Ken Howe <khowe@pivotal.io>
Committed: Mon Mar 27 14:01:44 2017 -0700

----------------------------------------------------------------------
 geode-assembly/build.gradle                     |  2 +-
 .../tools/pulse/PulseVerificationTest.java      |  6 ++-
 .../management/internal/ManagementAgent.java    | 55 ++++++++++----------
 geode-pulse/build.gradle                        |  2 +-
 .../tools/pulse/internal/PulseAppListener.java  | 13 ++---
 geode-pulse/src/main/resources/pulse.properties |  4 --
 6 files changed, 39 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/45da1b25/geode-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/geode-assembly/build.gradle b/geode-assembly/build.gradle
index 1900896..304a1c4 100755
--- a/geode-assembly/build.gradle
+++ b/geode-assembly/build.gradle
@@ -58,12 +58,12 @@ dependencies {
   archives project(':geode-old-client-support')
   archives project(':geode-web')
   archives project(':geode-web-api')
-  archives project(':geode-pulse')
   archives project(':geode-wan')
   archives project(':geode-cq')
   archives project(':geode-rebalancer')
 
   testCompile project(':geode-junit')
+  testCompile project(':geode-pulse')
   testCompile files(project(':geode-core').sourceSets.test.output)
   testCompile ('org.springframework:spring-web:' + project.'springframework.version') {
     exclude module: 'aopalliance'

http://git-wip-us.apache.org/repos/asf/geode/blob/45da1b25/geode-assembly/src/test/java/org/apache/geode/tools/pulse/PulseVerificationTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/tools/pulse/PulseVerificationTest.java
b/geode-assembly/src/test/java/org/apache/geode/tools/pulse/PulseVerificationTest.java
index 5771125..a8fca32 100644
--- a/geode-assembly/src/test/java/org/apache/geode/tools/pulse/PulseVerificationTest.java
+++ b/geode-assembly/src/test/java/org/apache/geode/tools/pulse/PulseVerificationTest.java
@@ -39,6 +39,7 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Test;
+import org.junit.contrib.java.lang.system.RestoreSystemProperties;
 import org.junit.experimental.categories.Category;
 
 import java.util.ArrayList;
@@ -52,10 +53,13 @@ public class PulseVerificationTest {
   @ClassRule
   public static LocatorStarterRule locatorStarterRule = new LocatorStarterRule();
 
+  @ClassRule
+  public static RestoreSystemProperties restoreSystemProperties = new RestoreSystemProperties();
+
   private static int httpPort = AvailablePortHelper.getRandomAvailableTCPPort();
 
   // use a random port when fixing GEODE-2671
-  private static int jmxPort = 1099; // AvailablePortHelper.getRandomAvailableTCPPort();
+  private static int jmxPort = AvailablePortHelper.getRandomAvailableTCPPort();
 
   private static HttpHost host;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/45da1b25/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
index e88360b..025e5e5 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
@@ -14,6 +14,32 @@
  */
 package org.apache.geode.management.internal;
 
+import org.apache.geode.GemFireConfigException;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.lang.StringUtils;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.net.SSLConfigurationFactory;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.internal.net.SocketCreatorFactory;
+import org.apache.geode.internal.security.SecurableCommunicationChannel;
+import org.apache.geode.internal.security.SecurityService;
+import org.apache.geode.internal.security.shiro.JMXShiroAuthenticator;
+import org.apache.geode.internal.tcp.TCPConduit;
+import org.apache.geode.management.ManagementException;
+import org.apache.geode.management.ManagementService;
+import org.apache.geode.management.ManagerMXBean;
+import org.apache.geode.management.internal.security.AccessControlMBean;
+import org.apache.geode.management.internal.security.MBeanServerWrapper;
+import org.apache.geode.management.internal.security.ResourceConstants;
+import org.apache.geode.management.internal.unsafe.ReadOpFileAccessController;
+import org.apache.logging.log4j.Logger;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+
 import java.io.IOException;
 import java.io.Serializable;
 import java.lang.management.ManagementFactory;
@@ -42,33 +68,6 @@ import javax.management.remote.rmi.RMIJRMPServerImpl;
 import javax.management.remote.rmi.RMIServerImpl;
 import javax.rmi.ssl.SslRMIClientSocketFactory;
 
-import org.apache.logging.log4j.Logger;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ServerConnector;
-
-import org.apache.geode.GemFireConfigException;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.internal.GemFireVersion;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.lang.StringUtils;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.security.SecurityService;
-import org.apache.geode.internal.net.SSLConfigurationFactory;
-import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.net.SocketCreatorFactory;
-import org.apache.geode.internal.security.SecurableCommunicationChannel;
-import org.apache.geode.internal.security.shiro.JMXShiroAuthenticator;
-import org.apache.geode.internal.tcp.TCPConduit;
-import org.apache.geode.management.ManagementException;
-import org.apache.geode.management.ManagementService;
-import org.apache.geode.management.ManagerMXBean;
-import org.apache.geode.management.internal.security.AccessControlMBean;
-import org.apache.geode.management.internal.security.MBeanServerWrapper;
-import org.apache.geode.management.internal.security.ResourceConstants;
-import org.apache.geode.management.internal.unsafe.ReadOpFileAccessController;
-
 /**
  * Agent implementation that controls the JMX server end points for JMX clients to connect,
such as
  * an RMI server.
@@ -100,6 +99,7 @@ public class ManagementAgent {
    * embedded pulse webapp can use a local MBeanServer instead of a remote JMX connection.
    */
   private static final String PULSE_EMBEDDED_PROP = "pulse.embedded";
+  private static final String PULSE_PORT_PROP = "pulse.port";
 
   public ManagementAgent(DistributionConfig config) {
     this.config = config;
@@ -267,6 +267,7 @@ public class ManagementAgent {
           }
 
           System.setProperty(PULSE_EMBEDDED_PROP, "true");
+          System.setProperty(PULSE_PORT_PROP, "" + config.getJmxManagerPort());
 
           this.httpServer = JettyHelper.startJetty(this.httpServer);
 

http://git-wip-us.apache.org/repos/asf/geode/blob/45da1b25/geode-pulse/build.gradle
----------------------------------------------------------------------
diff --git a/geode-pulse/build.gradle b/geode-pulse/build.gradle
index 298ae5a..a038f73 100755
--- a/geode-pulse/build.gradle
+++ b/geode-pulse/build.gradle
@@ -29,7 +29,7 @@ sourceSets {
 
 dependencies {
   compile 'org.springframework:spring-beans:' + project.'springframework.version'
-  
+
   compile 'commons-beanutils:commons-beanutils:' + project.'commons-beanutils.version'
   compile 'commons-collections:commons-collections:' + project.'commons-collections.version'
   compile 'commons-digester:commons-digester:' + project.'commons-digester.version'

http://git-wip-us.apache.org/repos/asf/geode/blob/45da1b25/geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/PulseAppListener.java
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/PulseAppListener.java
b/geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/PulseAppListener.java
index 4bad45c..e1666ec 100644
--- a/geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/PulseAppListener.java
+++ b/geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/PulseAppListener.java
@@ -31,7 +31,6 @@ import java.io.InputStream;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.net.InetAddress;
-import java.net.UnknownHostException;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -141,13 +140,6 @@ public class PulseAppListener implements ServletContextListener {
       try {
         // Get host name of machine running pulse in embedded mode
         sysPulseHost = InetAddress.getLocalHost().getCanonicalHostName();
-      } catch (UnknownHostException e) {
-        if (LOGGER.fineEnabled()) {
-          LOGGER.fine(
-              resourceBundle.getString("LOG_MSG_JMX_CONNECTION_UNKNOWN_HOST") + e.getMessage());
-        }
-        // Set default host name
-        sysPulseHost = PulseConstants.GEMFIRE_DEFAULT_HOST;
       } catch (Exception e) {
         if (LOGGER.fineEnabled()) {
           LOGGER.fine(
@@ -156,7 +148,10 @@ public class PulseAppListener implements ServletContextListener {
         // Set default host name
         sysPulseHost = PulseConstants.GEMFIRE_DEFAULT_HOST;
       }
-      sysPulsePort = PulseConstants.GEMFIRE_DEFAULT_PORT;
+      sysPulsePort = System.getProperty(PulseConstants.SYSTEM_PROPERTY_PULSE_PORT);
+      if (StringUtils.isBlank(sysPulsePort)) {
+        sysPulsePort = PulseConstants.GEMFIRE_DEFAULT_PORT;
+      }
 
     } else {
       // Application Pulse is running in Non-Embedded Mode

http://git-wip-us.apache.org/repos/asf/geode/blob/45da1b25/geode-pulse/src/main/resources/pulse.properties
----------------------------------------------------------------------
diff --git a/geode-pulse/src/main/resources/pulse.properties b/geode-pulse/src/main/resources/pulse.properties
index 878bc68..d47d469 100644
--- a/geode-pulse/src/main/resources/pulse.properties
+++ b/geode-pulse/src/main/resources/pulse.properties
@@ -25,10 +25,6 @@ pulse.useLocator=false
 pulse.host=localhost
 pulse.port=1099
 
-pulse.useLocator=false
-pulse.host=localhost
-pulse.port=9999
-
 #pulse.useSSL.locator=true
 #pulse.useSSL.manager=true
 


Mime
View raw message