brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #285: Adding HttpExecutor to be used for interc...
Date Mon, 22 Aug 2016 14:29:58 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/285#discussion_r75687758
  
    --- Diff: core/src/main/java/org/apache/brooklyn/feed/http/HttpFeed.java ---
    @@ -275,7 +293,23 @@ public HttpFeed() {
         protected HttpFeed(Builder builder) {
             setConfig(ONLY_IF_SERVICE_UP, builder.onlyIfServiceUp);
             Map<String,String> baseHeaders = ImmutableMap.copyOf(checkNotNull(builder.headers,
"headers"));
    -        
    +
    +        HttpExecutor httpExecutor = null;
    +        if (builder.httpExecutor != null) {
    +            httpExecutor = builder.httpExecutor;
    +        } else {
    +            HttpExecutorFactory httpExecutorFactory = null;
    +            Collection<Location> locations = builder.entity.getLocations();
    +            Maybe<MachineLocation> location =  Machines.findUniqueMachineLocation(locations,
MachineLocation.class);
    +            if (location.isPresent() && location.get().hasExtension(HttpExecutorFactory.class))
{
    +                httpExecutorFactory = location.get().getExtension(HttpExecutorFactory.class);
    +                Map<String, Object> httpExecutorProps = location.get().getAllConfig(true);
    +                httpExecutor = httpExecutorFactory.getHttpExecutor(httpExecutorProps);
    --- End diff --
    
    Minor, could pass the location and the implementation will then decide whether to do `.getAllConfig(true);`
or somthing simpler.


---
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