-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provider support in builders (#7365)
* Support for services from service loader that have a single or optional instance. * Support Config config(), and Optional<Config> config() methods in blueprints
- Loading branch information
1 parent
5519bb0
commit e253a3f
Showing
19 changed files
with
761 additions
and
29 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
31 changes: 31 additions & 0 deletions
31
...sts/builder/src/main/java/io/helidon/builder/test/testsubjects/ConfigMethodBlueprint.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,31 @@ | ||
/* | ||
* Copyright (c) 2023 Oracle and/or its affiliates. | ||
* | ||
* 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.helidon.builder.test.testsubjects; | ||
|
||
import io.helidon.builder.api.Prototype; | ||
import io.helidon.common.config.Config; | ||
import io.helidon.config.metadata.Configured; | ||
import io.helidon.config.metadata.ConfiguredOption; | ||
|
||
@Prototype.Blueprint | ||
@Configured | ||
interface ConfigMethodBlueprint { | ||
@ConfiguredOption("default-value") | ||
String key(); | ||
|
||
Config config(); | ||
} |
33 changes: 33 additions & 0 deletions
33
...der/src/main/java/io/helidon/builder/test/testsubjects/ConfigOptionalMethodBlueprint.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,33 @@ | ||
/* | ||
* Copyright (c) 2023 Oracle and/or its affiliates. | ||
* | ||
* 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.helidon.builder.test.testsubjects; | ||
|
||
import java.util.Optional; | ||
|
||
import io.helidon.builder.api.Prototype; | ||
import io.helidon.common.config.Config; | ||
import io.helidon.config.metadata.Configured; | ||
import io.helidon.config.metadata.ConfiguredOption; | ||
|
||
@Prototype.Blueprint | ||
@Configured | ||
interface ConfigOptionalMethodBlueprint { | ||
@ConfiguredOption("default-value") | ||
String key(); | ||
|
||
Optional<Config> config(); | ||
} |
26 changes: 26 additions & 0 deletions
26
...der/tests/builder/src/main/java/io/helidon/builder/test/testsubjects/ProviderNoImpls.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,26 @@ | ||
/* | ||
* Copyright (c) 2023 Oracle and/or its affiliates. | ||
* | ||
* 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.helidon.builder.test.testsubjects; | ||
|
||
import io.helidon.common.config.ConfiguredProvider; | ||
import io.helidon.common.config.NamedService; | ||
|
||
public interface ProviderNoImpls extends ConfiguredProvider<ProviderNoImpls.SomeService> { | ||
interface SomeService extends NamedService { | ||
String prop(); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
builder/tests/builder/src/main/java/io/helidon/builder/test/testsubjects/SomeProvider.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,27 @@ | ||
/* | ||
* Copyright (c) 2023 Oracle and/or its affiliates. | ||
* | ||
* 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.helidon.builder.test.testsubjects; | ||
|
||
import io.helidon.common.config.ConfiguredProvider; | ||
import io.helidon.common.config.NamedService; | ||
|
||
public interface SomeProvider extends ConfiguredProvider<SomeProvider.SomeService> { | ||
|
||
interface SomeService extends NamedService { | ||
String prop(); | ||
} | ||
} |
Oops, something went wrong.