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

OperationContext.getCapabilityServiceName(String, String...) generates wrong ServiceName if capability is not registered and dynamic part contains a DOT

    XMLWordPrintable

Details

    Description

      Consider the call:

      OperationContext.getCapabilityServiceName("test", "foo.bar");
      

      This method first resolves the qualified capability name as "test.foo.bar". If no capability is registered with that name, the service name is generated using:

      ServiceNameFactory.parseServiceName("test.foo.bar");
      

      This generates a ServiceName with 3 elements.

      However, when this capability is actually created with name of "test" and dynamic part "foo.bar", its service name will contain 2 elements, not 3.
      i.e.

      RuntimeCapability.Builder.of("test", true, ServiceType.class).fromBaseCapability("foo.bar").getCapabilityServiceName();
      

      Interestingly, the correspond method return by the OperationContext.getCapabilityServiceSupport() implementation does this correctly.
      i.e.

      OperationContext.getCapabilityServiceSupport().getCapabilityServiceName("test", "foo.bar");
      

      returns the result of:

      ServiceNameFactory.parseServiceName("test").append("foo.bar");
      

      Attachments

        Issue Links

          Activity

            People

              istudens@redhat.com Ivo Studensky
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: