brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [2/8] brooklyn-server git commit: Define constant for PortForwardManager(scope=global)
Date Wed, 08 Jun 2016 20:23:32 GMT
Define constant for PortForwardManager(scope=global)

Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/fb067f7f
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/fb067f7f
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/fb067f7f

Branch: refs/heads/master
Commit: fb067f7f96adfc57d620938c689e739ce699afaa
Parents: 2989176
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue Jun 7 00:26:56 2016 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Tue Jun 7 00:26:56 2016 +0100

----------------------------------------------------------------------
 .../apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java    | 3 ++-
 .../brooklyn/core/location/access/BrooklynAccessUtils.java      | 2 +-
 .../location/access/PortForwardManagerLocationResolver.java     | 4 +++-
 .../core/location/access/PublicNetworkFaceEnricher.java         | 2 +-
 .../org/apache/brooklyn/location/ssh/SshMachineLocation.java    | 3 ++-
 .../brooklyn/core/location/access/BrooklynAccessUtilsTest.java  | 2 +-
 .../location/access/PortForwardManagerLocationResolverTest.java | 2 +-
 .../core/location/access/PortForwardManagerRebindTest.java      | 2 +-
 .../brooklyn/core/location/access/PortForwardManagerTest.java   | 4 ++--
 .../core/location/access/PublicNetworkFaceEnricherTest.java     | 2 +-
 .../org/apache/brooklyn/location/jclouds/JcloudsLocation.java   | 5 +++--
 .../JcloudsLocationReleasePortForwardingDefaultTest.java        | 3 ++-
 .../apache/brooklyn/location/winrm/WinRmMachineLocation.java    | 3 ++-
 13 files changed, 22 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java
index 30112f2..0f5f75d 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ByonLocationsYamlTest.java
@@ -32,6 +32,7 @@ import org.apache.brooklyn.core.entity.Entities;
 import org.apache.brooklyn.core.location.LocationPredicates;
 import org.apache.brooklyn.core.location.Machines;
 import org.apache.brooklyn.core.location.access.PortForwardManager;
+import org.apache.brooklyn.core.location.access.PortForwardManagerLocationResolver;
 import org.apache.brooklyn.core.location.cloud.CloudLocationConfig;
 import org.apache.brooklyn.entity.software.base.DoNothingSoftwareProcess;
 import org.slf4j.Logger;
@@ -200,7 +201,7 @@ public class ByonLocationsYamlTest extends AbstractYamlTest {
 
         Entity app = createStartWaitAndLogApplication(new StringReader(yaml));
         FixedListMachineProvisioningLocation<MachineLocation> loc = (FixedListMachineProvisioningLocation<MachineLocation>)
Iterables.get(app.getLocations(), 0);
-        PortForwardManager pfm = (PortForwardManager) mgmt().getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+        PortForwardManager pfm = (PortForwardManager) mgmt().getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
         
         Set<MachineLocation> machines = loc.getAvailable();
         assertEquals(machines.size(), 2, "machines="+machines);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/core/src/main/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtils.java
b/core/src/main/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtils.java
index 8d5e777..40f71e2 100644
--- a/core/src/main/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtils.java
+++ b/core/src/main/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtils.java
@@ -67,7 +67,7 @@ public class BrooklynAccessUtils {
         PortForwardManager pfw = entity.getConfig(PORT_FORWARDING_MANAGER);
         if (pfw == null) {
             log.debug("No PortForwardManager, using default");
-            pfw = (PortForwardManager) entityInternal.getManagementContext().getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+            pfw = (PortForwardManager) entityInternal.getManagementContext().getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
         }
 
         Collection<Location> ll = entity.getLocations();

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerLocationResolver.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerLocationResolver.java
b/core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerLocationResolver.java
index 7988590..d32408d 100644
--- a/core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerLocationResolver.java
+++ b/core/src/main/java/org/apache/brooklyn/core/location/access/PortForwardManagerLocationResolver.java
@@ -47,6 +47,8 @@ public class PortForwardManagerLocationResolver extends AbstractLocationResolver
     private static final Logger LOG = LoggerFactory.getLogger(PortForwardManagerLocationResolver.class);
 
     public static final String PREFIX = "portForwardManager";
+    
+    public static final String PFM_GLOBAL_SPEC = "portForwardManager(scope=global)";
 
     @Override
     public String getPrefix() {
@@ -74,7 +76,7 @@ public class PortForwardManagerLocationResolver extends AbstractLocationResolver
 
     @Override
     protected SpecParser getSpecParser() {
-        return new AbstractLocationResolver.SpecParser(getPrefix()).setExampleUsage("\"portForwardManager\"
or \"portForwardManager(scope=global)\"");
+        return new AbstractLocationResolver.SpecParser(getPrefix()).setExampleUsage("\"portForwardManager\"
or \""+PFM_GLOBAL_SPEC+"\"");
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/core/src/main/java/org/apache/brooklyn/core/location/access/PublicNetworkFaceEnricher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/location/access/PublicNetworkFaceEnricher.java
b/core/src/main/java/org/apache/brooklyn/core/location/access/PublicNetworkFaceEnricher.java
index 3e4c321..92de796 100644
--- a/core/src/main/java/org/apache/brooklyn/core/location/access/PublicNetworkFaceEnricher.java
+++ b/core/src/main/java/org/apache/brooklyn/core/location/access/PublicNetworkFaceEnricher.java
@@ -344,7 +344,7 @@ public class PublicNetworkFaceEnricher extends AbstractEnricher {
     protected PortForwardManager getPortForwardManager() {
         PortForwardManager portForwardManager = config().get(PORT_FORWARD_MANAGER);
         if (portForwardManager == null) {
-            portForwardManager = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+            portForwardManager = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
         }
         return portForwardManager;
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java b/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
index b2cf64c..7ca672b 100644
--- a/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
+++ b/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
@@ -68,6 +68,7 @@ import org.apache.brooklyn.core.location.LocationConfigUtils;
 import org.apache.brooklyn.core.location.LocationConfigUtils.OsCredential;
 import org.apache.brooklyn.core.location.PortRanges;
 import org.apache.brooklyn.core.location.access.PortForwardManager;
+import org.apache.brooklyn.core.location.access.PortForwardManagerLocationResolver;
 import org.apache.brooklyn.core.mgmt.BrooklynTaskTags;
 import org.apache.brooklyn.core.mgmt.internal.LocalLocationManager;
 import org.apache.brooklyn.util.collections.MutableMap;
@@ -301,7 +302,7 @@ public class SshMachineLocation extends AbstractLocation implements MachineLocat
         // Register any pre-existing port-mappings with the PortForwardManager
         Map<Integer, String> tcpPortMappings = getConfig(TCP_PORT_MAPPINGS);
         if (tcpPortMappings != null) {
-            PortForwardManager pfm = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+            PortForwardManager pfm = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
             for (Map.Entry<Integer, String> entry : tcpPortMappings.entrySet()) {
                 int targetPort = entry.getKey();
                 HostAndPort publicEndpoint = HostAndPort.fromString(entry.getValue());

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/core/src/test/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtilsTest.java
b/core/src/test/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtilsTest.java
index dcd853a..a174e81 100644
--- a/core/src/test/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtilsTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtilsTest.java
@@ -52,7 +52,7 @@ public class BrooklynAccessUtilsTest extends BrooklynAppUnitTestSupport
{
     public void setUp() throws Exception {
         super.setUp();
         
-        pfm = (PortForwardManager) mgmt.getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+        pfm = (PortForwardManager) mgmt.getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
     }
     
     @Test

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerLocationResolverTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerLocationResolverTest.java
b/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerLocationResolverTest.java
index eb518f7..2ffb773 100644
--- a/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerLocationResolverTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerLocationResolverTest.java
@@ -46,7 +46,7 @@ public class PortForwardManagerLocationResolverTest {
     public void testReturnsSameInstanceBasedOnScope() {
         Location global1 = resolve("portForwardManager()"); // defaults to global
         Location global2 = resolve("portForwardManager()");
-        Location global3 = resolve("portForwardManager(scope=global)");
+        Location global3 = resolve(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
         assertSame(global1, global2);
         assertSame(global1, global3);
         

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerRebindTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerRebindTest.java
b/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerRebindTest.java
index 3693162..798f591 100644
--- a/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerRebindTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerRebindTest.java
@@ -186,7 +186,7 @@ public class PortForwardManagerRebindTest extends RebindTestFixtureWithApp
{
             super.init();
             
             if (getConfig(PORT_FORWARD_MANAGER) == null) {
-                PortForwardManager pfm = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+                PortForwardManager pfm = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
                 sensors().set(PORT_FORWARD_MANAGER_LIVE, pfm);
                 config().set(PORT_FORWARD_MANAGER, pfm);
             }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerTest.java
b/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerTest.java
index 11ef2f9..aef2d41 100644
--- a/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/location/access/PortForwardManagerTest.java
@@ -55,7 +55,7 @@ public class PortForwardManagerTest extends BrooklynAppUnitTestSupport {
     public void setUp() throws Exception {
         super.setUp();
 
-        pfm = (PortForwardManager) mgmt.getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+        pfm = (PortForwardManager) mgmt.getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
 
         machine1 = mgmt.getLocationManager().createLocation(LocationSpec.create(SshMachineLocation.class)
                 .configure("address", Networking.getInetAddressWithFixedName("1.2.3.4"))
@@ -104,7 +104,7 @@ public class PortForwardManagerTest extends BrooklynAppUnitTestSupport
{
         props.put(PortForwardManager.PORT_FORWARD_MANAGER_STARTING_PORT, 1234);
         LocalManagementContextForTests mgmt2 = new LocalManagementContextForTests(props);
         try {
-            PortForwardManager pfm2 = (PortForwardManager) mgmt2.getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+            PortForwardManager pfm2 = (PortForwardManager) mgmt2.getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
             int port = pfm2.acquirePublicPort("myipid");
             assertEquals(port, 1234);
         } finally {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/core/src/test/java/org/apache/brooklyn/core/location/access/PublicNetworkFaceEnricherTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/location/access/PublicNetworkFaceEnricherTest.java
b/core/src/test/java/org/apache/brooklyn/core/location/access/PublicNetworkFaceEnricherTest.java
index 3d89518..503d949 100644
--- a/core/src/test/java/org/apache/brooklyn/core/location/access/PublicNetworkFaceEnricherTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/location/access/PublicNetworkFaceEnricherTest.java
@@ -54,7 +54,7 @@ public class PublicNetworkFaceEnricherTest extends BrooklynAppUnitTestSupport
{
         super.setUp();
         entity = app.createAndManageChild(EntitySpec.create(TestEntity.class));
         machine = app.newLocalhostProvisioningLocation().obtain();
-        portForwardManager = (PortForwardManager) mgmt.getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+        portForwardManager = (PortForwardManager) mgmt.getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
     }
     
     @DataProvider(name = "variants")

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
index 7a5c534..8272803 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
@@ -70,6 +70,7 @@ import org.apache.brooklyn.core.location.LocationConfigUtils;
 import org.apache.brooklyn.core.location.LocationConfigUtils.OsCredential;
 import org.apache.brooklyn.core.location.PortRanges;
 import org.apache.brooklyn.core.location.access.PortForwardManager;
+import org.apache.brooklyn.core.location.access.PortForwardManagerLocationResolver;
 import org.apache.brooklyn.core.location.access.PortMapping;
 import org.apache.brooklyn.core.location.cloud.AbstractCloudMachineProvisioningLocation;
 import org.apache.brooklyn.core.location.cloud.AvailabilityZoneExtension;
@@ -829,7 +830,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
             PortForwardManager portForwardManager = setup.get(PORT_FORWARDING_MANAGER);
             if (portForwardManager == null) {
                 LOG.debug("No PortForwardManager, using default");
-                portForwardManager = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+                portForwardManager = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
             }
 
             if (usePortForwarding && sshHostAndPortOverride.isPresent()) {
@@ -2588,7 +2589,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
         PortForwardManager portForwardManager = machine.getConfig(PORT_FORWARDING_MANAGER);
         if (portForwardManager == null) {
             LOG.debug("No PortForwardManager, using default");
-            portForwardManager = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+            portForwardManager = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
         }
 
         if (portForwarder == null) {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationReleasePortForwardingDefaultTest.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationReleasePortForwardingDefaultTest.java
b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationReleasePortForwardingDefaultTest.java
index cbbaf52..5409790 100644
--- a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationReleasePortForwardingDefaultTest.java
+++ b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationReleasePortForwardingDefaultTest.java
@@ -33,6 +33,7 @@ import org.apache.brooklyn.core.effector.EffectorBody;
 import org.apache.brooklyn.core.effector.EffectorTasks.EffectorBodyTaskFactory;
 import org.apache.brooklyn.core.entity.EntityInternal;
 import org.apache.brooklyn.core.location.access.PortForwardManager;
+import org.apache.brooklyn.core.location.access.PortForwardManagerLocationResolver;
 import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport;
 import org.apache.brooklyn.entity.stock.BasicEntity;
 import org.apache.brooklyn.location.jclouds.networking.JcloudsPortForwarderExtension;
@@ -70,7 +71,7 @@ public class JcloudsLocationReleasePortForwardingDefaultTest extends BrooklynApp
     public void setUp() throws Exception {
         super.setUp();
         stopwatch = Stopwatch.createStarted();
-        portForwardManager = (PortForwardManager) mgmt.getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+        portForwardManager = (PortForwardManager) mgmt.getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
         loc = (JcloudsLocation) mgmt.getLocationRegistry().getLocationManaged("jclouds:aws-ec2:us-east-1");
 
         node = Mockito.mock(NodeMetadata.class);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fb067f7f/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
----------------------------------------------------------------------
diff --git a/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
b/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
index 88dc038..7a5b638 100644
--- a/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
+++ b/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
@@ -41,6 +41,7 @@ import org.apache.brooklyn.core.config.Sanitizer;
 import org.apache.brooklyn.core.entity.BrooklynConfigKeys;
 import org.apache.brooklyn.core.location.AbstractLocation;
 import org.apache.brooklyn.core.location.access.PortForwardManager;
+import org.apache.brooklyn.core.location.access.PortForwardManagerLocationResolver;
 import org.apache.brooklyn.util.core.config.ConfigBag;
 import org.apache.brooklyn.util.core.internal.ssh.SshTool;
 import org.apache.brooklyn.util.core.internal.winrm.WinRmTool;
@@ -177,7 +178,7 @@ public class WinRmMachineLocation extends AbstractLocation implements
MachineLoc
         // Register any pre-existing port-mappings with the PortForwardManager
         Map<Integer, String> tcpPortMappings = getConfig(TCP_PORT_MAPPINGS);
         if (tcpPortMappings != null) {
-            PortForwardManager pfm = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
+            PortForwardManager pfm = (PortForwardManager) getManagementContext().getLocationRegistry().getLocationManaged(PortForwardManagerLocationResolver.PFM_GLOBAL_SPEC);
             for (Map.Entry<Integer, String> entry : tcpPortMappings.entrySet()) {
                 int targetPort = entry.getKey();
                 HostAndPort publicEndpoint = HostAndPort.fromString(entry.getValue());


Mime
View raw message