Class AbstractRegistry.DefaultNameResolution
- java.lang.Object
-
- de.aristaflow.adept2.base.registry.AbstractRegistry.DefaultNameResolution
-
- All Implemented Interfaces:
NameResolution
- Enclosing class:
- AbstractRegistry
public static class AbstractRegistry.DefaultNameResolution extends Object implements NameResolution
Default implementation for resolving service name and component types.
-
-
Constructor Summary
Constructors Constructor Description DefaultNameResolution()
Creates a new default implementation for resolving service name and component types.
-
Method Summary
All Methods Instance Methods Concrete 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
public String getHierarchicalInstanceName(String componentType, String simpleName)
Description copied from interface:NameResolution
Returns a hierarchical instance name containing the component type as well as the instance name. The returned string resembles, for instance,/ProcessManager/PM1
.- Specified by:
getHierarchicalInstanceName
in interfaceNameResolution
- 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
public String getSimpleInstanceName(String instanceName)
Description copied from interface:NameResolution
Returns the simple name of the designated component instance as used in configuration files.- Specified by:
getSimpleInstanceName
in interfaceNameResolution
- Parameters:
instanceName
- The hierarchical name of a component instance.- Returns:
- The simple name without the prepending type of the component instance.
-
getComponentType
public String getComponentType(String instanceName)
Description copied from interface:NameResolution
Returns the name of the component type of the designated component instance as used in configuration files.- Specified by:
getComponentType
in interfaceNameResolution
- Parameters:
instanceName
- The hierarchical name of a component instance.- Returns:
- The name of the component type.
-
getNames
public Pair<String,String> getNames(String instanceName)
Description copied from interface:NameResolution
Gets the component type name and the simple instance name of the designated component instance at once.- Specified by:
getNames
in interfaceNameResolution
- 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.
-
getFormattedSignature
public String getFormattedSignature(Class<?>[] parameterTypes)
Description copied from interface:NameResolution
Helper method for getting a string describing the parameter types as method signature for use in log messages and exceptions.- Specified by:
getFormattedSignature
in interfaceNameResolution
- 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).
-
-