brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grkvlt <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #181: Added a default PortForwardManager
Date Sat, 04 Jun 2016 11:18:32 GMT
Github user grkvlt commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/181#discussion_r65801388
  
    --- Diff: core/src/main/java/org/apache/brooklyn/core/location/access/BrooklynAccessUtils.java
---
    @@ -59,46 +60,52 @@
     
         public static HostAndPort getBrooklynAccessibleAddress(Entity entity, int port) {
             String host;
    -        
    +
    +        EntityInternal entityInternal = (EntityInternal) entity;
    +
             // look up port forwarding
             PortForwardManager pfw = entity.getConfig(PORT_FORWARDING_MANAGER);
    -        if (pfw!=null) {
    -            Collection<Location> ll = entity.getLocations();
    -            
    -            synchronized (BrooklynAccessUtils.class) {
    -                // TODO finer-grained synchronization
    -                
    -                for (MachineLocation machine : Iterables.filter(ll, MachineLocation.class))
{
    -                    HostAndPort hp = pfw.lookup(machine, port);
    +        if (pfw == null) {
    +            log.debug("No PortForwardManager, using default");
    +            pfw = (PortForwardManager) entityInternal.getManagementContext().getLocationRegistry().getLocationManaged("portForwardManager(scope=global)");
    --- End diff --
    
    Make `"portForwardManager(scope=global)"` a constant in the `PortForwardManager` interface.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message