protected <T> T create(Class<T> type, Map<String, String> config) {
        try {
            Constructor<T> constructor = type.getConstructor(Map.class);
            return constructor.newInstance(config);
        } catch (NoSuchMethodException e) {
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        try {
            return type.newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
Add a component that may have been instantiated elsewhere.
@param klazz component class
@param component instantiated component of same class
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ConfigDrivenComponentRegistry.java