Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WFCORE-6663 Introduce AttributeDefinition implementations to wildfly-subsystem that can resolve directly to a ServiceDependency #6123

Merged
merged 9 commits into from
Sep 13, 2024

Conversation

pferraro
Copy link
Contributor

@pferraro pferraro commented Aug 6, 2024

https://issues.redhat.com/browse/WFCORE-6663

e.g.

static CapabilityReferenceAttributeDefinition<Foo> FOO = new CapabilityReferenceAttributeDefinition.Builder("foo", CapabilityReference.builder(CAPABILITY, Foo.SERVICE_DESCRIPTOR).build()).build();

static CapabilityReferenceListAttributeDefinition<Bar> BAR = new CapabilityReferenceListAttributeDefinition.Builder("bar", CapabilityReference.builder(CAPABILITY, Bar.SERVICE_DESCRIPTOR).build()).build();

Within an operation runtime handler, we can use the context of the capability reference to resolve our attribute from the model directly to a ServiceDependency:

ServiceDependency<Foo> foo = FOO.resolve(context, model);

ServiceDependency<List<Bar>> bars = BAR.resolve(context, model);

If FOO is not required, the resulting ServiceDependency will either return a null, or, if the service descriptor provides alternate default resolution, will result to the default value.
Similarly, as a multi-value attribute, BAR resolves to a service dependency providing an empty list if not required.

@github-actions github-actions bot added the deps-ok Dependencies have been checked, and there are no significant changes label Aug 6, 2024
@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@pferraro pferraro force-pushed the WFCORE-6663 branch 3 times, most recently from 751be09 to f0e41e3 Compare August 8, 2024 16:26
@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@pferraro pferraro force-pushed the WFCORE-6663 branch 3 times, most recently from 4b55f09 to e04b533 Compare August 12, 2024 18:56
@wildfly-ci

This comment was marked as off-topic.

@wildfly-ci

This comment was marked as off-topic.

@wildfly-ci

This comment was marked as off-topic.

@pferraro pferraro force-pushed the WFCORE-6663 branch 2 times, most recently from 4917067 to 1c8ab8e Compare August 15, 2024 22:27
@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@wildfly-ci

This comment was marked as outdated.

@pferraro pferraro force-pushed the WFCORE-6663 branch 2 times, most recently from ba6d74d to 469c230 Compare September 11, 2024 15:42
@wildfly-ci

This comment was marked as off-topic.

@bstansberry
Copy link
Contributor

@pferraro This looks fine in general (and I know Yeray reviewed it carefully). I made some minor javadoc comments, and then a somewhat more substantial one about IOSubsystemRegistrar, which, if valid should be simple to correct.

@bstansberry
Copy link
Contributor

SimpleResource should also have javadoc for methods where it throws OSE.

@pferraro
Copy link
Contributor Author

All missing javadocs added.

@wildfly-ci

This comment was marked as off-topic.

@pferraro
Copy link
Contributor Author

Rebased against main.

@yersan yersan added the ready-for-merge This PR is ready to be merged and fulfills all requirements label Sep 13, 2024
@yersan yersan merged commit 66a99f0 into wildfly:main Sep 13, 2024
12 checks passed
@yersan
Copy link
Collaborator

yersan commented Sep 13, 2024

Thanks @pferraro @bstansberry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deps-ok Dependencies have been checked, and there are no significant changes ready-for-merge This PR is ready to be merged and fulfills all requirements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants