/** * Creates a new instance of a class specified in a configuration property. * * @param conf * configuration containing property * @param property * property specifying class name * @param base * base class of type * @param defaultInstance * instance to use if creation fails * @return new class instance, or default instance if creation failed * @see AccumuloVFSClassLoader */ public static <T> T createInstanceFromPropertyName(AccumuloConfiguration conf, Property property, Class<T> base, T defaultInstance) { String clazzName = conf.get(property); return createInstance(null, clazzName, base, defaultInstance); }
/** * Creates a new instance of a class specified in a configuration property. The table classpath * context is used if set. * * @param conf * configuration containing property * @param property * property specifying class name * @param base * base class of type * @param defaultInstance * instance to use if creation fails * @return new class instance, or default instance if creation failed * @see AccumuloVFSClassLoader */ public static <T> T createTableInstanceFromPropertyName(AccumuloConfiguration conf, Property property, Class<T> base, T defaultInstance) { String clazzName = conf.get(property); String context = conf.get(TABLE_CLASSPATH); return createInstance(context, clazzName, base, defaultInstance); }