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 StringgetComponentType(String instanceName)Returns the name of the component type of the designated component instance as used in configuration files.StringgetFormattedSignature(Class<?>[] parameterTypes)Helper method for getting a string describing the parameter types as method signature for use in log messages and exceptions.StringgetHierarchicalInstanceName(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.StringgetSimpleInstanceName(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:NameResolutionReturns a hierarchical instance name containing the component type as well as the instance name. The returned string resembles, for instance,/ProcessManager/PM1.- Specified by:
getHierarchicalInstanceNamein 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:NameResolutionReturns the simple name of the designated component instance as used in configuration files.- Specified by:
getSimpleInstanceNamein 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:NameResolutionReturns the name of the component type of the designated component instance as used in configuration files.- Specified by:
getComponentTypein 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:NameResolutionGets the component type name and the simple instance name of the designated component instance at once.- Specified by:
getNamesin 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:NameResolutionHelper method for getting a string describing the parameter types as method signature for use in log messages and exceptions.- Specified by:
getFormattedSignaturein 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).
-
-