@@ -0,0 +1,2887 @@
+/*%0A * Copyright 2017, Google Inc. All rights reserved.%0A *%0A * Redistribution and use in source and binary forms, with or without%0A * modification, are permitted provided that the following conditions are%0A * met:%0A *%0A *    * Redistributions of source code must retain the above copyright%0A * notice, this list of conditions and the following disclaimer.%0A *    * Redistributions in binary form must reproduce the above%0A * copyright notice, this list of conditions and the following disclaimer%0A * in the documentation and/or other materials provided with the%0A * distribution.%0A *%0A *    * Neither the name of Google Inc. nor the names of its%0A * contributors may be used to endorse or promote products derived from%0A * this software without specific prior written permission.%0A *%0A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A * %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR%0A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT%0A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,%0A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT%0A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,%0A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY%0A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT%0A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE%0A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.%0A */%0A%0Apackage io.grpc.grpclb;%0A%0Aimport io.grpc.ExperimentalApi;%0Aimport io.grpc.LoadBalancer2;%0Aimport io.grpc.PickFirstBalancerFactory2;%0Aimport io.grpc.util.RoundRobinLoadBalancerFactory2;%0A%0A/**%0A * A factory for %7B@link LoadBalancer2%7Ds that uses the GRPCLB protocol.%0A *%0A * %3Cp%3E%3Cstrong%3ETECHNICAL PREVIEW: %3C/strong%3EThe name of this class is temporary. It will be renamed to%0A * %7B@code GrpclbLoadBalancerFactory%7D during %3Ca href=%22https://github.com/grpc/grpc-java/issues/2656%22%3E%0A * transition to LBv2%3C/a%3E. You should use it only if you want to experiment the LBv2 code path.%0A *%0A * %3Cp%3E%3Cb%3EExperimental:%3C/b%3EThis only works with the GRPCLB load-balancer service, which is not%0A * available yet. Right now it's only good for internal testing.%0A */%0A@ExperimentalApi(%22https://github.com/grpc/grpc-java/issues/1782%22)%0Apublic class GrpclbLoadBalancerFactory2 extends LoadBalancer2.Factory %7B%0A%0A  private static final GrpclbLoadBalancerFactory2 instance = new GrpclbLoadBalancerFactory2();%0A%0A  private GrpclbLoadBalancerFactory2() %7B%0A  %7D%0A%0A  public static GrpclbLoadBalancerFactory2 getInstance() %7B%0A    return instance;%0A  %7D%0A%0A  @Override%0A  public LoadBalancer2 newLoadBalancer(LoadBalancer2.Helper helper) %7B%0A    return new GrpclbLoadBalancer2(%0A        helper, PickFirstBalancerFactory2.getInstance(),%0A        RoundRobinLoadBalancerFactory2.getInstance());%0A  %7D%0A%7D%0A

add GrpclbLoadBalancerFactory2