brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreaturli <>
Subject [GitHub] brooklyn-server pull request #723: adds a new ComputeServiceRegistry to hand...
Date Wed, 07 Jun 2017 20:45:32 GMT
Github user andreaturli commented on a diff in the pull request:
    --- Diff: locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/
    @@ -0,0 +1,312 @@
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.brooklyn.location.jclouds;
    +import static;
    +import static org.apache.brooklyn.util.JavaGroovyEquivalents.groovyTruth;
    +import static;
    +import static;
    +import java.util.Map;
    +import java.util.Properties;
    +import java.util.concurrent.ConcurrentHashMap;
    +import org.apache.brooklyn.core.config.Sanitizer;
    +import org.apache.brooklyn.core.mgmt.persist.DeserializingJcloudsRenamesProvider;
    +import org.apache.brooklyn.util.collections.MutableMap;
    +import org.apache.brooklyn.util.core.config.ConfigBag;
    +import org.apache.brooklyn.util.text.Strings;
    +import org.apache.brooklyn.util.time.Duration;
    +import org.jclouds.Constants;
    +import org.jclouds.ContextBuilder;
    +import org.jclouds.azurecompute.arm.config.AzureComputeRateLimitModule;
    +import org.jclouds.compute.ComputeService;
    +import org.jclouds.compute.ComputeServiceContext;
    +import org.jclouds.domain.Credentials;
    +import org.jclouds.ec2.reference.EC2Constants;
    +import org.jclouds.encryption.bouncycastle.config.BouncyCastleCryptoModule;
    +import org.jclouds.location.reference.LocationConstants;
    +import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
    +import org.jclouds.sshj.config.SshjSshClientModule;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +public abstract class AbstractComputeServiceRegistry implements ComputeServiceRegistry,
JcloudsLocationConfig {
    +    private static final Logger LOG = LoggerFactory.getLogger(AbstractComputeServiceRegistry.class);
    +    private final Map<Map<?, ?>, ComputeService> cachedComputeServices =
new ConcurrentHashMap<>();
    +    @Override
    +    public ComputeService findComputeService(ConfigBag conf, boolean allowReuse) {
    +        Properties properties = new Properties();
    --- End diff --
    [very minor] also remember you can build the `Properties` just before passing it to jclouds
contextbuilder and use maps if easier. I think something similar to line 80 is more readable
than line 74.

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 or file a JIRA ticket
with INFRA.

View raw message