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
[WFLY-18016] Refactoring - eliminating usage of deprecated CapabilityServiceBuilder.addCapabilityRequirement() methods #16840
[WFLY-18016] Refactoring - eliminating usage of deprecated CapabilityServiceBuilder.addCapabilityRequirement() methods #16840
Conversation
@@ -27,6 +27,7 @@ | |||
import io.agroal.api.transaction.TransactionIntegration; | |||
import io.agroal.narayana.NarayanaTransactionIntegration; | |||
import org.ietf.jgss.GSSException; | |||
import org.jboss.as.server.deployment.DelegatingSupplier; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer not to use the server module as a utility lib.
Extensions can use the deployment package in DUPs, but this isn't a DUP. (At some point we should factor out that package into its own module.)
AIUI using this just eliminates the need for some null checks Optional.isPresent checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed @bstansberry . There was introduced a new DelegatingSupplier class in EE subsystem and AGROAL subsystem was rewritten to don't use DelegatingSupplier at all.
We're using DelegatingSupplier not because of Optional.isPresent() checks but because there are some places where supplier injection happens later than at the service installation time.
5a657f6
to
4cbb095
Compare
4cbb095
to
db58774
Compare
import org.wildfly.security.credential.source.CredentialSource; | ||
|
||
import java.util.function.Consumer; | ||
import java.util.function.Supplier; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change this unless there is some other change needed, but the imports here are out of order.
The jakarta.transaction one was already out of order due to my sed change from javax to jakarta, which took it out of the "java. and javax. before others" category.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -115,7 +126,7 @@ public void start(StartContext context) throws StartException { | |||
|
|||
if (jta || xa) { | |||
TransactionManager transactionManager = ContextTransactionManager.getInstance(); | |||
TransactionSynchronizationRegistry transactionSynchronizationRegistry = transactionSynchronizationRegistryInjector.getValue(); | |||
TransactionSynchronizationRegistry transactionSynchronizationRegistry = transactionSynchronizationRegistrySupplier.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think transactionSynchronizationRegistrySupplier can be null if jta is false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct - thanks for spotting this out ! It is fixed now.
…deprecated CapabilityServiceBuilder.addCapabilityRequirement() methods
… deprecated CapabilityServiceBuilder.addCapabilityRequirement() methods
db58774
to
a02bbee
Compare
… of deprecated CapabilityServiceBuilder.addCapabilityRequirement() methods
a02bbee
to
2feaab5
Compare
/retest |
Thanks @ropalka |
https://issues.redhat.com/browse/WFLY-18016