Package org.apache.phoenix.util
Class InstanceResolver
java.lang.Object
org.apache.phoenix.util.InstanceResolver
Resolves object instances registered using the JDK 6+
ServiceLoader.- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic <T> ListResolves all instances of a specified class and add it to the list of default implementationsstatic <T> TgetSingleton(Class<T> clazz, T defaultInstance) Resolves an instance of the specified class if it has not already been resolved.
-
Method Details
-
getSingleton
Resolves an instance of the specified class if it has not already been resolved.- Parameters:
clazz- The type of instance to resolvedefaultInstance- The instance to use if a custom instance has not been registered- Returns:
- The resolved instance or the default instance provided.
nullif an instance is not registered and a default is not provided.
-
get
Resolves all instances of a specified class and add it to the list of default implementations -
clearSingletons
public static void clearSingletons()
-