Returns an implementation of the given class using the system properties as a registry.
555239
private static Object getPluginImplementationViaProperty(Class<?> pluginClass) {
		String className = pluginClass.getCanonicalName();
		if (className == null) {
			throw new IllegalArgumentException("Class " + pluginClass + " does not have a canonical name!");
		}
		// Check system properties for plugin class.
		// This will only happen during system startup thus it's okay to use the synchronized
		// System.getProperties as it will never get called in normal operations.
		String implementingClass = System.getProperty(PROPERTY_PREFIX + className);
		if (implementingClass != null) {
			try {
				Class<?> cls = Class.forName(implementingClass);
				// narrow the scope (cast) to the type we're expecting
				cls = cls.asSubclass(pluginClass);
				return cls.newInstance();
			} catch (ClassCastException e) {
				throw new RuntimeException(className + " implementation is not an instance of " + className + ": " + implementingClass);
			} catch (ClassNotFoundException e) {
				throw new RuntimeException(className + " implementation class not found: " + implementingClass, e);
			} catch (InstantiationException e) {
				throw new RuntimeException(className + " implementation not able to be instantiated: " + implementingClass, e);
			} catch (IllegalAccessException e) {
				throw new RuntimeException(className + " implementation not able to be accessed: " + implementingClass, e);
			}
		} else {
			return null;
		}
	}
521750
public static SystemUtil getInstance() {

    if (instance == null) {
      synchronized (SystemUtilImpl.class) {
        if (instance == null) {
          instance = new SystemUtilImpl();
        }
      }
    }
    return instance;
  }
901831
def get_object_class(object_type, vendor_id=0):
    """"""
    if _debug: get_object_class._debug("get_object_class %r vendor_id=%r", object_type, vendor_id)

    # find the klass as given
    cls = registered_object_types.get((object_type, vendor_id))
    if _debug: get_object_class._debug("    - direct lookup: %s", repr(cls))

    # if the class isn't found and the vendor id is non-zero, try the standard class for the type
    if (not cls) and vendor_id:
        cls = registered_object_types.get((object_type, 0))
        if _debug: get_object_class._debug("    - default lookup: %s", repr(cls))

    return cls
1214387
public Class<?> getClass(final String key) {
    try {
      if (containsKey(key)) {
        return Class.forName(get(key));
      } else {
        throw new UndefinedPropertyException("Missing required property '"
            + key + "'");
      }
    } catch (final ClassNotFoundException e) {
      throw new IllegalArgumentException(e);
    }
  }
646689
static PluginTypeConfiguration getConfiguration(String pluginType) {
        PluginTypeConfiguration conf = registry.get(pluginType);
        if (conf == null)
            throw new IllegalArgumentException("PluginType '"+pluginType+"' not registered!");
        return conf;
    }
232561
@Deprecated
    public <T> Class<T> getPropertyAsClass(String key, Class<T> targetType) {
        Optional<String> property = propertyResolver.getProperty(NameUtils.hyphenate(key), String.class);
        if (property.isPresent()) {
            Optional<Class> aClass = ClassUtils.forName(property.get(), Thread.currentThread().getContextClassLoader());
            if (aClass.isPresent()) {
                //noinspection unchecked
                return aClass.get();
            }
        }
        return null;
    }
781517
def get_std_registry():
    
    from six import itervalues
    reg = Registry()
    for fn in itervalues(builtin_registrars):
        fn(reg)
    return reg
668261
public static ClassLoader getClassLoader(Class<?> clazz) {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        if (loader != null) {
            return loader;
        }
        if (clazz != null) {
            loader = clazz.getClassLoader();
            if (loader != null) {
                return loader;
            }
        }
        return ClassLoader.getSystemClassLoader();
    }
866140
def class_register(cls):
    """"""
    cls.handler_registry = {}
    for method_name in dir(cls):
        method = getattr(cls, method_name)
        if hasattr(method, '_handle'):
            cls.handler_registry.update({method._handle: method_name})
    return cls
1311200
function ModelClassFactory(name, options) {
        if (!isUndef(options)) {
          return config(name, options);
        }
        return registry[name] || undefined;
      }
830098
def _find_adapter(registry, ob):
    """"""
    types = _always_object(inspect.getmro(getattr(ob, '__class__', type(ob))))
    for t in types:
        if t in registry:
            return registry[t]
1263154
def registry():
    """"""
    return Registry(
        types={
            dict: SerDict(),
            tuple: SerSequence(tuple),
            set: SerSequence(set),
            bytes: SerBytes(),
            slice: SerSlice(),
            complex: SerByMembers(complex, ['real', 'imag']),
            Reasonable: SerReasonableObject(Reasonable),
            ArgumentKind: SerEnum(ArgumentKind),
            FunctionNode: SerNode(),
            ArgumentAddress: SerNamedTuple(ArgumentAddress),
            Workflow: SerWorkflow(),
            PromisedObject: SerPromisedObject(),
            Quote: SerReasonableObject(Quote),
            Path: SerPath(),
            Fail: SerReasonableObject(Fail)
        },
        hooks={
            '<method>': SerMethod(),
            '<boundmethod>': SerBoundMethod(),
            '<importable>': SerImportable(),
            '<automagic>': SerAuto(),
            '<unwrapped>': SerUnwrapped()
        },
        hook_fn=_noodles_hook,
        default=SerUnknown(),
    )
1193554
public static <C extends Configurable> C getConfiguration(Class<C> klass, Properties properties) {
        //Initialize configuration object
        C configuration;
        try {
            Constructor<C> constructor = klass.getDeclaredConstructor();
            constructor.setAccessible(true);
            configuration = constructor.newInstance();
        }
        catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException ex) {
            throw new RuntimeException(ex);
        }

        configuration.load(properties);

        return configuration;
    }
1266267
public static Class<?> getPropertyClass(Class<?> clazz, List<String> propertyPath) {
		Class<?> current = clazz;
		for (String propertyName : propertyPath) {
			current = getPropertyClass(current, propertyName);
		}
		return current;
	}
470535
public static <T extends Enum<T>>
    EnumDictionary<T> get( Class<T> clazz ) {
        EnumDictionary<T> dic = registry.get(clazz);
        if(dic==null) {
            boolean sparse = ComEnum.class.isAssignableFrom(clazz);
            if(sparse)
                dic = new Sparse<T>(clazz);
            else
                dic = new Continuous<T>(clazz);
            registry.put(clazz,dic);
        }
        return dic;
    }
199550
def _class(self):
        """"""
        try:
            self._project_name()
        except ValueError:
            return MalformedReq
        if self._is_satisfied():
            return SatisfiedReq
        if not self._expected_hashes():
            return MissingReq
        if self._actual_hash() not in self._expected_hashes():
            return MismatchedReq
        return InstallableReq
150220
public <W extends T> W get(final Class<W> clazz) {
    return get(clazz, Constants.DEFAULT_REGISTRY_GET_TIMEOUT_MS);
  }