Interface NameResolution
- All Known Subinterfaces:
ADEPT2ClientService,Registry,ServiceAccess
- All Known Implementing Classes:
AbstractRegistry,AbstractRegistry.DefaultNameResolution,BootstrapRegistry,InstanceToInstanceRegistry,LocalServiceRegistry,ModelFactoryRegistry,MultiplexingClientService,PluginRegistry,RegistryWrapper,ServiceRegistry,TwoPhaseBootstrap
public interface NameResolution
This interface provides the means to get and transform service names from
hierarchical to type and instance name and vice versa.
-
Method Summary
Modifier and TypeMethodDescriptiongetComponentType(String instanceName) Returns the name of the component type of the designated component instance as used in configuration files.getFormattedSignature(Class<?>[] parameterTypes) Helper method for getting a string describing the parameter types as method signature for use in log messages and exceptions.getHierarchicalInstanceName(String componentType, String simpleName) Returns a hierarchical instance name containing the component type as well as the instance name.Gets the component type name and the simple instance name of the designated component instance at once.getSimpleInstanceName(String instanceName) Returns the simple name of the designated component instance as used in configuration files.
-
Method Details
-
getHierarchicalInstanceName
Returns a hierarchical instance name containing the component type as well as the instance name. The returned string resembles, for instance,/ProcessManager/PM1.- Parameters:
componentType- The type of the component to create the hierarchical name for.simpleName- The simple name of the component instance as defined in the configuration.- Returns:
- An instance name containing the component type and the simple component instance name.
-
getSimpleInstanceName
Returns the simple name of the designated component instance as used in configuration files.- Parameters:
instanceName- The hierarchical name of a component instance.- Returns:
- The simple name without the prepending type of the component instance.
- Throws:
IllegalArgumentException- If the designated instance name is not a valid hierarchical name, anIllegalArgumentExceptionwill be thrown.
-
getComponentType
Returns the name of the component type of the designated component instance as used in configuration files.- Parameters:
instanceName- The hierarchical name of a component instance.- Returns:
- The name of the component type.
- Throws:
IllegalArgumentException- If the designated instance name is not a valid hierarchical name, anIllegalArgumentExceptionwill be thrown.
-
getNames
Gets the component type name and the simple instance name of the designated component instance at once.- Parameters:
instanceName- The hierarchical name of a component instance.- Returns:
- The name of the component type and the simple name of the designated component instance.
- Throws:
IllegalArgumentException- If the designated instance name is not a valid hierarchical name, anIllegalArgumentExceptionwill be thrown.
-
getFormattedSignature
Helper method for getting a string describing the parameter types as method signature for use in log messages and exceptions.- Parameters:
parameterTypes- All the parameter types of a method as instances ofClass.- Returns:
- A string describing the parameter types as method signature (concatenated and surrounded by parenthesis).
-