-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
382 additions
and
178 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
350 changes: 196 additions & 154 deletions
350
extensions/grpc/runtime/src/main/java/io/quarkus/grpc/runtime/GrpcServerRecorder.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
32 changes: 32 additions & 0 deletions
32
extensions/grpc/runtime/src/main/java/io/quarkus/grpc/runtime/config/Xds.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,32 @@ | ||
package io.quarkus.grpc.runtime.config; | ||
|
||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
/** | ||
* XDS config | ||
* * <a href="https://github.com/grpc/grpc-java/tree/master/examples/example-xds">XDS usage</a> | ||
*/ | ||
@ConfigGroup | ||
public class Xds { | ||
/** | ||
* Explicitly enable use of XDS. | ||
*/ | ||
@ConfigItem(defaultValue = "false") | ||
public boolean enabled; | ||
|
||
/** | ||
* Use secure credentials. | ||
*/ | ||
@ConfigItem(defaultValue = "false") | ||
public boolean secure; | ||
|
||
/** | ||
* Optional explicit target. | ||
*/ | ||
@ConfigItem | ||
public Optional<String> target; | ||
|
||
} |
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
43 changes: 43 additions & 0 deletions
43
extensions/grpc/runtime/src/main/java/io/quarkus/grpc/runtime/devmode/XdsServerReloader.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,43 @@ | ||
package io.quarkus.grpc.runtime.devmode; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import io.grpc.Server; | ||
import io.grpc.ServerInterceptor; | ||
import io.grpc.ServerMethodDefinition; | ||
import io.grpc.ServerServiceDefinition; | ||
|
||
// TODO | ||
public class XdsServerReloader { | ||
private static volatile Server server; | ||
|
||
public static Server getServer() { | ||
return server; | ||
} | ||
|
||
public static void init(Server grpcServer) { | ||
server = grpcServer; | ||
} | ||
|
||
public static void reset() { | ||
shutdown(); | ||
} | ||
|
||
public static void reinitialize(List<ServerServiceDefinition> serviceDefinitions, | ||
Map<String, ServerMethodDefinition<?, ?>> methods, | ||
List<ServerInterceptor> sortedInterceptors) { | ||
server = null; | ||
} | ||
|
||
public static void shutdown() { | ||
shutdown(server); | ||
server = null; | ||
} | ||
|
||
public static void shutdown(Server current) { | ||
if (current != null) { | ||
current.shutdownNow(); | ||
} | ||
} | ||
} |
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