api: When forwarding from Listener onAddresses to Listener2 continue … · grpc/grpc-java@dae078c

File tree

1 file changed

lines changed

  • api/src/main/java/io/grpc

1 file changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -219,13 +219,15 @@ public abstract static class Listener2 implements Listener {

219219

@Override

220220

@Deprecated

221221

@InlineMe(

222-

replacement = "this.onResult2(ResolutionResult.newBuilder().setAddressesOrError("

222+

replacement = "this.onResult(ResolutionResult.newBuilder().setAddressesOrError("

223223

+ "StatusOr.fromValue(servers)).setAttributes(attributes).build())",

224224

imports = {"io.grpc.NameResolver.ResolutionResult", "io.grpc.StatusOr"})

225225

public final void onAddresses(

226226

List<EquivalentAddressGroup> servers, @ResolutionResultAttr Attributes attributes) {

227227

// TODO(jihuncho) need to promote Listener2 if we want to use ConfigOrError

228-

onResult2(

228+

// Calling onResult and not onResult2 because onResult2 can only be called from a

229+

// synchronization context.

230+

onResult(

229231

ResolutionResult.newBuilder().setAddressesOrError(

230232

StatusOr.fromValue(servers)).setAttributes(attributes).build());

231233

}