-
Bug
-
Resolution: Done
-
Major
-
None
-
None
The OperationContext.getCapabilityServiceName javadoc is incorrect with respect to the handling of the 'serviceType' param. I believe at this point it can be null, and IAE will not be thrown if it is.
Passing the serviceType basically turns on optional validation that the capability actually exposes a matching type. Passing null means don't bother checking, which is valid and probably preferable.
Perhaps an overloaded variant of this that takes no serviceType would be useful. Here's the kind of heavy boilerplate the current API encourages:
.addDependency(context.getCapabilityServiceName("org.wildfly.transactions.transaction-manager", TransactionManager.class), TransactionManager.class, fileTimerPersistence.getTransactionManager())