Skip to content

Commit

Permalink
Rename InitalizationTaskCompletedBuildItem to `InitTaskCompletedBui…
Browse files Browse the repository at this point in the history
…ldItem`

- Because the original class name has a typo (missing the `i`) and it matches the intent with the existing `InitTaskBuildItem`
  • Loading branch information
gastaldi committed Mar 27, 2023
1 parent 72a7b0f commit a76d222
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import io.quarkus.builder.item.MultiBuildItem;

/**
* Represents an initalization task for the application.
* Represents an initialization task for the application.
* Often extension perform some sort of initialization as part of the application startup.
* There are cases where we we want to externalize the initialization (e.g. in a pipeline).
* There are cases where we want to externalize the initialization (e.g. in a pipeline).
*
* Often the task is run using the same artifact as the application but using a different command or
* arguments. In the later case it might be deseriable to pass additional environment variable to both the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* Similar to {@link ServiceStartBuildItem} but focused on initialization tasks (e.g. db migrations etc) that are run during
* runtime just before the application startups.
* <p>
* The build item is used, so that we can track when all intialization tasks have been completed.
* The build item is used, so that we can track when all initialization tasks have been completed.
*/
public final class InitalizationTaskCompletedBuildItem extends MultiBuildItem {
public final class InitTaskCompletedBuildItem extends MultiBuildItem {

private final String name;

public InitalizationTaskCompletedBuildItem(String name) {
public InitTaskCompletedBuildItem(String name) {
this.name = name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import io.quarkus.deployment.annotations.Consume;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.InitalizationTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.InitTaskCompletedBuildItem;
import io.quarkus.runtime.init.InitializationTaskRecorder;

/**
* A processor that is used to track all {@link InitalizationTaskCompletedBuildItem} in order to exit once they are completed if
* A processor that is used to track all {@link io.quarkus.deployment.builditem.InitTaskCompletedBuildItem} in order to exit
* once they are completed if
* needed.
*/
public class InitializtionTaskProcessor {
Expand All @@ -20,7 +21,7 @@ public class InitializtionTaskProcessor {
@Consume(SyntheticBeansRuntimeInitBuildItem.class)
@Record(ExecutionTime.RUNTIME_INIT)
void startApplicationInitializer(InitializationTaskRecorder recorder,
List<InitalizationTaskCompletedBuildItem> initalizationCompletedBuildItems) {
List<InitTaskCompletedBuildItem> initTaskCompletedBuildItems) {
recorder.exitIfNeeded();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.InitTaskBuildItem;
import io.quarkus.deployment.builditem.InitalizationTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.InitTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
Expand Down Expand Up @@ -208,15 +208,15 @@ void createBeans(FlywayRecorder recorder,
public ServiceStartBuildItem startActions(FlywayRecorder recorder,
FlywayRuntimeConfig config,
BuildProducer<JdbcDataSourceSchemaReadyBuildItem> schemaReadyBuildItem,
BuildProducer<InitalizationTaskCompletedBuildItem> initializationCompleteBuildItem,
BuildProducer<InitTaskCompletedBuildItem> initializationCompleteBuildItem,
MigrationStateBuildItem migrationsBuildItem) {

recorder.doStartActions();

// once we are done running the migrations, we produce a build item indicating that the
// schema is "ready"
schemaReadyBuildItem.produce(new JdbcDataSourceSchemaReadyBuildItem(migrationsBuildItem.hasMigrations));
initializationCompleteBuildItem.produce(new InitalizationTaskCompletedBuildItem("flyway"));
initializationCompleteBuildItem.produce(new InitTaskCompletedBuildItem("flyway"));
return new ServiceStartBuildItem("flyway");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.InitTaskBuildItem;
import io.quarkus.deployment.builditem.InitalizationTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.InitTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.SystemPropertyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
Expand Down Expand Up @@ -246,10 +246,10 @@ void createBeans(LiquibaseMongodbRecorder recorder,
@Record(ExecutionTime.RUNTIME_INIT)
@Consume(SyntheticBeansRuntimeInitBuildItem.class)
ServiceStartBuildItem startLiquibase(LiquibaseMongodbRecorder recorder,
BuildProducer<InitalizationTaskCompletedBuildItem> initializationCompleteBuildItem) {
BuildProducer<InitTaskCompletedBuildItem> initializationCompleteBuildItem) {
// will actually run the actions at runtime
recorder.doStartActions();
initializationCompleteBuildItem.produce(new InitalizationTaskCompletedBuildItem("liquibase-mongodb"));
initializationCompleteBuildItem.produce(new InitTaskCompletedBuildItem("liquibase-mongodb"));
return new ServiceStartBuildItem("liquibase-mongodb");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.InitTaskBuildItem;
import io.quarkus.deployment.builditem.InitalizationTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.InitTaskCompletedBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.SystemPropertyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
Expand Down Expand Up @@ -301,14 +301,14 @@ void createBeans(LiquibaseRecorder recorder,
@Consume(SyntheticBeansRuntimeInitBuildItem.class)
ServiceStartBuildItem startLiquibase(LiquibaseRecorder recorder,
List<JdbcDataSourceBuildItem> jdbcDataSourceBuildItems,
BuildProducer<InitalizationTaskCompletedBuildItem> initializationCompleteBuildItem,
BuildProducer<InitTaskCompletedBuildItem> initializationCompleteBuildItem,
BuildProducer<JdbcDataSourceSchemaReadyBuildItem> schemaReadyBuildItem) {

recorder.doStartActions();
// once we are done running the migrations, we produce a build item indicating that the
// schema is "ready"
schemaReadyBuildItem.produce(new JdbcDataSourceSchemaReadyBuildItem(getDataSourceNames(jdbcDataSourceBuildItems)));
initializationCompleteBuildItem.produce(new InitalizationTaskCompletedBuildItem("liquibase"));
initializationCompleteBuildItem.produce(new InitTaskCompletedBuildItem("liquibase"));

return new ServiceStartBuildItem("liquibase");
}
Expand Down

0 comments on commit a76d222

Please sign in to comment.