Class ServiceNameFactory

java.lang.Object
org.jboss.as.controller.ServiceNameFactory

public final class ServiceNameFactory extends Object
Provides a factory for creating ServiceName instances from dot-separated strings while trying to mitigate the memory overhead of having multiple copies of elements of the name that have the same simple name.
Author:
Brian Stansberry
  • Constructor Details

    • ServiceNameFactory

      public ServiceNameFactory()
  • Method Details

    • parseServiceName

      public static org.jboss.msc.service.ServiceName parseServiceName(String toParse)
      Parses a string into a ServiceName using the same algorithm as ServiceName.parse(String) but also attempts to ensure that once parsing occurs if any other name that is equal to the parsed name or one of its ancestors has been parsed previously that that previously parsed name is used.
      Parameters:
      toParse - the string form of a service name. Cannot be null
      Returns:
      a ServiceName instance
    • resolveServiceName

      public static org.jboss.msc.service.ServiceName resolveServiceName(NullaryServiceDescriptor<?> descriptor)
      Resolves the specified service descriptor to a ServiceName.
      Parameters:
      descriptor - a service descriptor
      Returns:
      a service name
    • resolveServiceName

      public static org.jboss.msc.service.ServiceName resolveServiceName(UnaryServiceDescriptor<?> descriptor, String name)
      Resolves the specified service descriptor and dynamic name component to a ServiceName.
      Parameters:
      descriptor - a service descriptor
      name - the dynamic name component
      Returns:
      a service name
    • resolveServiceName

      public static org.jboss.msc.service.ServiceName resolveServiceName(BinaryServiceDescriptor<?> descriptor, String parent, String child)
      Resolves the specified service descriptor and dynamic name components to a ServiceName.
      Parameters:
      descriptor - a service descriptor
      parent - the 1st dynamic name component
      child - the 2nd dynamic name component
      Returns:
      a service name
    • resolveServiceName

      public static org.jboss.msc.service.ServiceName resolveServiceName(TernaryServiceDescriptor<?> descriptor, String grandparent, String parent, String child)
      Resolves the specified service descriptor and dynamic name components to a ServiceName.
      Parameters:
      descriptor - a service descriptor
      grandparent - the 1st dynamic name component
      parent - the 2nd dynamic name component
      child - the 3rd dynamic name component
      Returns:
      a service name
    • resolveServiceName

      public static org.jboss.msc.service.ServiceName resolveServiceName(QuaternaryServiceDescriptor<?> descriptor, String ancestor, String grandparent, String parent, String child)
      Resolves the specified service descriptor and dynamic name components to a ServiceName.
      Parameters:
      descriptor - a service descriptor
      ancestor - the 1st dynamic name component
      grandparent - the 2nd dynamic name component
      parent - the 3rd dynamic name component
      child - the 4th dynamic name component
      Returns:
      a service name