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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getComponentType(String instanceName)
Returns the name of the component type of the designated component instance as used in configuration files.String
getFormattedSignature(Class<?>[] parameterTypes)
Helper method for getting a string describing the parameter types as method signature for use in log messages and exceptions.String
getHierarchicalInstanceName(String componentType, String simpleName)
Returns a hierarchical instance name containing the component type as well as the instance name.Pair<String,String>
getNames(String instanceName)
Gets the component type name and the simple instance name of the designated component instance at once.String
getSimpleInstanceName(String instanceName)
Returns the simple name of the designated component instance as used in configuration files.
-
-
-
Method Detail
-
getHierarchicalInstanceName
String getHierarchicalInstanceName(String componentType, String simpleName)
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
String getSimpleInstanceName(String instanceName)
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, anIllegalArgumentException
will be thrown.
-
getComponentType
String getComponentType(String instanceName)
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, anIllegalArgumentException
will be thrown.
-
getNames
Pair<String,String> getNames(String instanceName)
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, anIllegalArgumentException
will be thrown.
-
getFormattedSignature
String getFormattedSignature(Class<?>[] parameterTypes)
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).
-
-