-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: andreilisa <[email protected]>
- Loading branch information
1 parent
f645b98
commit 4e99be9
Showing
4 changed files
with
68 additions
and
37 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
50 changes: 50 additions & 0 deletions
50
spring-grpc-test/src/main/java/org/springframework/grpc/test/GrpcProperties.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,50 @@ | ||
/* | ||
* Copyright 2024-2024 the original author or 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 | ||
* | ||
* https://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 org.springframework.grpc.test; | ||
|
||
import org.springframework.core.env.Environment; | ||
|
||
/** | ||
* A configuration class that holds the properties related to in-process gRPC | ||
* communication. It reads the `spring.grpc.inprocess.enabled` property from the Spring | ||
* environment and provides access to it via a getter method. | ||
* <p> | ||
* This class is typically used to determine whether the in-process gRPC server should be | ||
* enabled in the application. It supports reading the property from external sources such | ||
* as `application.properties` or `application.yml`. | ||
* <p> | ||
* The default value for the `spring.grpc.inprocess.enabled` property is `true` if not | ||
* explicitly defined. | ||
* | ||
* @author Andrei Lisa | ||
*/ | ||
|
||
class GrpcProperties { | ||
|
||
private static final String PROPERTY_SOURCE_NAME = "spring.grpc.inprocess.enabled"; | ||
|
||
private final boolean inProcessEnabled; | ||
|
||
GrpcProperties(Environment environment) { | ||
this.inProcessEnabled = Boolean.parseBoolean(environment.getProperty(PROPERTY_SOURCE_NAME, "true")); | ||
} | ||
|
||
public boolean isInProcessEnabled() { | ||
return inProcessEnabled; | ||
} | ||
|
||
} |
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
9 changes: 0 additions & 9 deletions
9
spring-grpc-test/src/main/resources/additional-spring-configuration-metadata.json
This file was deleted.
Oops, something went wrong.