class ReflectionEngine {

	public MethodInvoker getConstructor(Class<?> clazz, Class<?>[] parameters) {
		MethodDescriptor mDescriptor = new MethodDescriptor(clazz.getName(), clazz, parameters);
		MethodInvoker mInvoker = null;
		List<Constructor<?>> acceptableConstructors = null;
		LRUCache<MethodDescriptor, MethodInvoker> cache = cacheHolder.get();

		mInvoker = cache.get(mDescriptor);

		if (mInvoker == null) {
			acceptableConstructors = getConstructorsByLength(clazz, parameters.length);

			if (acceptableConstructors.size() == 1) {
				mInvoker = MethodInvoker.buildInvoker(acceptableConstructors.get(0), parameters);
			} else {
				mInvoker = getBestConstructor(acceptableConstructors, parameters);
			}

			if (mInvoker != null && mInvoker.getCost() != -1) {
				cache.put(mDescriptor, mInvoker);
			} else {
				String errorMessage = "Constructor " + clazz.getName() + "(" + Arrays.toString(parameters)
						+ ") does not exist";
				logger.log(Level.WARNING, errorMessage);
				throw new Py4JException(errorMessage);
			}
		}

		return mInvoker;
	}

}