forked from grpc/grpc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
io.grpc has fewer dependencies than io.grpc.internal. Moving it to a separate artifact lets users use the API without bringing in the deps. If the library has an optional dependency on grpc, that can be quite convenient. We now version-pin both grpc-api and grpc-core, since both contain internal APIs. I had to change a few tests in grpc-api to avoid FakeClock. Moving FakeClock to grpc-api was difficult because it uses io.grpc.internal.TimeProvider, which can't be moved since it is a production class. Having grpc-api's tests depend on grpc-core's test classes would be weird and cause a circular dependincy. Having grpc-api's tests depend on grpc-core is likely possible, but weird and fairly unnecessary at this point. So instead I rewrote the tests to avoid FakeClock. Fixes grpc#1447
- Loading branch information
Showing
157 changed files
with
220 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
java_library( | ||
name = "api", | ||
srcs = glob([ | ||
"src/main/java/**/*.java", | ||
]), | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//context", | ||
"@com_google_code_findbugs_jsr305//jar", | ||
"@com_google_guava_failureaccess//jar", # future transitive dep of Guava. See #5214 | ||
"@com_google_guava_guava//jar", | ||
"@com_google_j2objc_j2objc_annotations//jar", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
description = 'gRPC: API' | ||
|
||
dependencies { | ||
compile project(':grpc-context'), | ||
libraries.errorprone, | ||
libraries.jsr305, | ||
libraries.animalsniffer_annotations | ||
compile (libraries.guava) { | ||
// prefer 2.3.2 from libraries instead of 2.1.3 | ||
exclude group: 'com.google.errorprone', module: 'error_prone_annotations' | ||
// prefer 3.0.2 from libraries instead of 3.0.1 | ||
exclude group: 'com.google.code.findbugs', module: 'jsr305' | ||
// prefer 1.17 from libraries instead of 1.14 | ||
exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' | ||
} | ||
|
||
testCompile project(':grpc-context').sourceSets.test.output, | ||
project(':grpc-testing'), | ||
project(':grpc-grpclb'), | ||
libraries.guava_testlib | ||
|
||
jmh project(':grpc-core') | ||
|
||
signature "org.codehaus.mojo.signature:java17:1.0@signature" | ||
signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature" | ||
} | ||
|
||
javadoc { | ||
// We want io.grpc.Internal, but not io.grpc.Internal* | ||
exclude 'io/grpc/Internal?*.java' | ||
exclude 'io/grpc/internal/**' | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
54 changes: 54 additions & 0 deletions
54
api/src/test/java/io/grpc/ForwardingScheduledExecutorService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2019 The gRPC Authors | ||
* | ||
* Licensed 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.grpc; | ||
|
||
import com.google.common.util.concurrent.ForwardingExecutorService; | ||
import java.util.concurrent.Callable; | ||
import java.util.concurrent.ScheduledExecutorService; | ||
import java.util.concurrent.ScheduledFuture; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
/** | ||
* Forwards all methods to delegate. | ||
*/ | ||
abstract class ForwardingScheduledExecutorService extends ForwardingExecutorService | ||
implements ScheduledExecutorService { | ||
@Override | ||
protected abstract ScheduledExecutorService delegate(); | ||
|
||
@Override | ||
public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { | ||
return delegate().schedule(callable, delay, unit); | ||
} | ||
|
||
@Override | ||
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { | ||
return delegate().schedule(command, delay, unit); | ||
} | ||
|
||
@Override | ||
public ScheduledFuture<?> scheduleAtFixedRate( | ||
Runnable command, long initialDelay, long period, TimeUnit unit) { | ||
return delegate().scheduleAtFixedRate(command, initialDelay, period, unit); | ||
} | ||
|
||
@Override | ||
public ScheduledFuture<?> scheduleWithFixedDelay( | ||
Runnable command, long initialDelay, long delay, TimeUnit unit) { | ||
return delegate().scheduleWithFixedDelay(command, initialDelay, delay, unit); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.