Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-4162

Incorrect OperationContext.getCapabilityServiceName javadoc

XMLWordPrintable

      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())

            parsharm Parul Sharma
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: