-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add first version of bootstrap config support
- Loading branch information
Showing
30 changed files
with
905 additions
and
108 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
24 changes: 24 additions & 0 deletions
24
...in/java/io/quarkus/deployment/builditem/MainBootstrapConfigBytecodeRecorderBuildItem.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,24 @@ | ||
package io.quarkus.deployment.builditem; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
import io.quarkus.deployment.recording.BytecodeRecorderImpl; | ||
|
||
/** | ||
* This build item will be used to write bytecode that supports the Bootstrap phase of the configuration | ||
* That code essentially uses part of the configuration system to pass configuration data to | ||
* recorders that then use the configuration to create new configuration sources. | ||
* These sources are then used to create the final runtime configuration which then passed on | ||
* to all the other runtime recorders | ||
*/ | ||
public final class MainBootstrapConfigBytecodeRecorderBuildItem extends MultiBuildItem { | ||
|
||
private final BytecodeRecorderImpl bytecodeRecorder; | ||
|
||
public MainBootstrapConfigBytecodeRecorderBuildItem(BytecodeRecorderImpl bytecodeRecorder) { | ||
this.bytecodeRecorder = bytecodeRecorder; | ||
} | ||
|
||
public BytecodeRecorderImpl getBytecodeRecorder() { | ||
return bytecodeRecorder; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...c/main/java/io/quarkus/deployment/builditem/RunTimeConfigurationSourceValueBuildItem.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,29 @@ | ||
package io.quarkus.deployment.builditem; | ||
|
||
import org.eclipse.microprofile.config.spi.ConfigSourceProvider; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
import io.quarkus.runtime.RuntimeValue; | ||
|
||
/** | ||
* This is a special build item that is intended to be used only to support bootstrap configuration in the following manner: | ||
* | ||
* A build step returns this build item (this is a limitation compared to other build items that can also be used with | ||
* BuildProducer) | ||
* containing a {@code RuntimeValue<ConfigSourceProvider>} that is obtained by calling a ({@code RUNTIME_INIT}) recorder. | ||
* The build step can optionally use a configuration object that uses the {@code BOOTSTRAP} config phase and pass this | ||
* configuration | ||
* to the recorder to allow the recorder at runtime to customize its behavior | ||
*/ | ||
public final class RunTimeConfigurationSourceValueBuildItem extends MultiBuildItem { | ||
|
||
private final RuntimeValue<ConfigSourceProvider> configSourcesValue; | ||
|
||
public RunTimeConfigurationSourceValueBuildItem(RuntimeValue<ConfigSourceProvider> configSourcesValue) { | ||
this.configSourcesValue = configSourcesValue; | ||
} | ||
|
||
public RuntimeValue<ConfigSourceProvider> getConfigSourcesValue() { | ||
return configSourcesValue; | ||
} | ||
} |
Oops, something went wrong.