Creates components, but allows a {@link #vertx} instance to be passed in.

@param type component type
@param apimanConfig configuration (if necessary).
@return instance of Class<T>
488792
@Override
    protected <T> T create(Class<T> type, Map<String, String> mapConfig) {
        try {
            Constructor<T> constructor = type.getConstructor(Vertx.class, VertxEngineConfig.class, Map.class);
            return constructor.newInstance(vertx, engineConfig, mapConfig);
        } catch (Exception e) {
        }
        try {
            Constructor<T> constructor = type.getConstructor(Map.class);
            return constructor.newInstance(mapConfig);
        } catch (Exception e) {
        }
        try {
            return type.newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
1071874
protected <T> T create(Class<T> type, Map<String, String> config) {
        // Use #doInstantiate so inheriting classes can override it, as #instantiate is static final.
        T instance = doInstantiate(type, config);

        if (instance instanceof AsyncInitialize) {
            asyncInitializeAwaiting.incrementAndGet();
            ((AsyncInitialize) instance).initialize(initResult -> {
                asyncInitializeAwaiting.decrementAndGet();
                if (initResult.isError()) {
                    if (!failed) { // Not already failed before
                        failed = true;
                        if (handler != null)
                            handler.handle(initResult);
                    } else {
                        System.err.println("Failure occurred, but error handler was already invoked: " + initResult.getError().getCause()); //$NON-NLS-1$
                    }
                } else {
                    checkLoadingStatus();
                }
            });
        }

        checkLoadingStatus();
        return instance;
    }
969251
function createComponentType(config) {
    // config is already normalized

    let ret;

    const propsAdjuster = createPropsAdjuster(config);

    if (config.render) {
        ret = props => config.render(propsAdjuster(props, config));
        ret.displayName = config.displayName;
    } else {
        ret = deriveReactComponent(config);
    }

    return ret;
}
885711
@Override
  public <T> ServiceBuilder service(Class<T> type)
  {
    Key<?> key = Key.of(type, ServiceImpl.class);

    return service(key, type);
  }
749450
@Override
    public MetaRuleset createMetaRuleset(Class type)
    {
        MetaRuleset ruleset = new MetaRulesetImpl(_delegate.getTag(), type);
        ruleset.ignore("binding");
        ruleset.ignore("event");
        return ruleset;
    }
1033463
@FFDCIgnore(value = { Throwable.class })
    // Liberty Change for CXF End
    protected static Object createProvider(String className, Bus bus) {

        try {
            Class<?> cls = ClassLoaderUtils.loadClass(className, ProviderFactory.class);
            for (Constructor<?> c : cls.getConstructors()) {
                if (c.getParameterTypes().length == 1 && c.getParameterTypes()[0] == Bus.class) {
                    return c.newInstance(bus);
                }
            }
            return cls.newInstance();
        } catch (Throwable ex) {
            String message = "Problem with creating the default provider " + className;
            if (ex.getMessage() != null) {
                message += ": " + ex.getMessage();
            } else {
                message += ", exception class : " + ex.getClass().getName();
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, message);
            }
        }
        return null;
    }
613393
private static <T> T createCustomComponent(Class<T> componentType, String componentSpec,
            Map<String, String> configProperties, IPluginRegistry pluginRegistry, T defaultComponent) throws Exception {
        if (componentSpec == null && defaultComponent == null) {
            throw new IllegalArgumentException("Null component type."); //$NON-NLS-1$
        }
        if (componentSpec == null && defaultComponent != null) {
            return defaultComponent;
        }

        if (componentSpec.startsWith("class:")) { //$NON-NLS-1$
            Class<?> c = ReflectionUtils.loadClass(componentSpec.substring("class:".length())); //$NON-NLS-1$
            return createCustomComponent(componentType, c, configProperties);
        } else if (componentSpec.startsWith("plugin:")) { //$NON-NLS-1$
            PluginCoordinates coordinates = PluginCoordinates.fromPolicySpec(componentSpec);
            if (coordinates == null) {
                throw new IllegalArgumentException("Invalid plugin component spec: " + componentSpec); //$NON-NLS-1$
            }
            int ssidx = componentSpec.indexOf('/');
            if (ssidx == -1) {
                throw new IllegalArgumentException("Invalid plugin component spec: " + componentSpec); //$NON-NLS-1$
            }
            String classname = componentSpec.substring(ssidx + 1);
            Plugin plugin = pluginRegistry.loadPlugin(coordinates);
            PluginClassLoader classLoader = plugin.getLoader();
            Class<?> class1 = classLoader.loadClass(classname);
            return createCustomComponent(componentType, class1, configProperties);
        } else {
            Class<?> c = ReflectionUtils.loadClass(componentSpec);
            return createCustomComponent(componentType, c, configProperties);
        }
    }
933419
@SuppressWarnings("unchecked")
	<T extends Component> T getComponent (ComponentType componentType) {
		int componentTypeIndex = componentType.getIndex();

		if (componentTypeIndex < components.getCapacity()) {
			return (T)components.get(componentType.getIndex());
		} else {
			return null;
		}
	}
30626
public synchronized static Index createIndex(Class<?> type) {
        Index index = indices.get(type);
        if (index == null) {
            try {
                Indexer indexer = new Indexer();
                Class<?> currentType = type;
                while ( currentType != null ) {
                    String className = currentType.getName().replace(".", "/") + ".class";
                    InputStream stream = type.getClassLoader()
                            .getResourceAsStream(className);
                    indexer.index(stream);
                    currentType = currentType.getSuperclass();
                }
                index = indexer.complete();
                indices.put(type, index);
            } catch (IOException e) {
                throw new RuntimeException("Failed to initialize Indexer", e);
            }
        }
        return index;
    }
206808
public FacesConfigComponentType<WebFacesConfigDescriptor> getOrCreateComponent()
   {
      List<Node> nodeList = model.get("component");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigComponentTypeImpl<WebFacesConfigDescriptor>(this, "component", model, nodeList.get(0));
      }
      return createComponent();
   }
139123
public static UserExecutorConfiguration of(ExecutorType type) {
        ArgumentUtils.check("type", type).notNull();
        UserExecutorConfiguration configuration = new UserExecutorConfiguration();
        configuration.type = type;
        return configuration;
    }
1150805
public <C> C mapTo(Class<C> type) {
    DataFormatMapper mapper = dataFormat.getMapper();
    return mapper.mapInternalToJava(jsonNode, type);
  }
1046403
@Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
        for (Class<?> t = type.getRawType(); (t != Object.class) && (t.getSuperclass() != null); t = t.getSuperclass()) {
            for (Method m : t.getDeclaredMethods()) {
                if (m.isAnnotationPresent(PostConstruct.class)) {
                    m.setAccessible(true);
                    TypeAdapter<T> delegate = gson.getDelegateAdapter(this, type);
                    return new PostConstructAdapter<T>(delegate, m);
                }
            }
        }
        return null;
    }
910127
public MultipartBuilder type(MediaType type) {
        if (type == null) {
            throw new NullPointerException("type == null");
        }
        if (!type.type().equals("multipart")) {
            throw new IllegalArgumentException("multipart != " + type);
        }
        this.type = type;
        return this;
    }
370308
public static ElementBuilder[] newBuilders(Class<?> type) {

		List<ElementBuilder> builders = new ArrayList<ElementBuilder>();

		for (ElementBuilderFactory factory : loader) {
			ElementBuilder b = factory.newBuilder(type);
			if (b != null) {
				builders.add(b);
			}
		}
		return builders.toArray(new ElementBuilder[0]);
	}
1102117
@Override
    @SuppressWarnings("nls")
    protected <T> T doInstantiate(Class<T> type, Map<String, String> mapConfig) {
        try {
            Constructor<T> constructor = type.getConstructor(Vertx.class, VertxEngineConfig.class, Map.class);
            return constructor.newInstance(vertx, vxConfig, mapConfig);
        } catch (NoSuchMethodException e) { // If doesn't have constructor, try other method.
        } catch (Exception e ) {
            throw new RuntimeException(e);
        }
        try {
            Constructor<T> constructor = type.getConstructor(Vertx.class, IEngineConfig.class, Map.class);
            return constructor.newInstance(vertx, vxConfig, mapConfig);
        } catch (NoSuchMethodException e) { // If doesn't have constructor, try other method.
        } catch (Exception e ) {
            throw new RuntimeException(e);
        }
        try {
            Constructor<T> constructor = type.getConstructor(Map.class);
            return constructor.newInstance(mapConfig);
        } catch (Exception e) {
        }
        try {
            return type.newInstance();
        } catch (InstantiationException | IllegalAccessException e) {
            throw new RuntimeException(String.format(
                    "Could not instantiate %s. Verify class has valid constructor parameters: %s", type,
                    e.getMessage()), e);
        }
    }
862113
public static BaseType createGenericClass(Class<?> type)
  {
    TypeVariable<?> []typeParam = type.getTypeParameters();
      
    if (typeParam == null || typeParam.length == 0)
      return ClassType.create(type);

    BaseType []args = new BaseType[typeParam.length];

    HashMap<String,BaseType> newParamMap = new HashMap<String,BaseType>();
    String paramDeclName = null;

    for (int i = 0; i < args.length; i++) {
      args[i] = create(typeParam[i], 
                       newParamMap, paramDeclName, 
                       ClassFill.TARGET);

      if (args[i] == null) {
        throw new NullPointerException("unsupported BaseType: " + type);
      }

      newParamMap.put(typeParam[i].getName(), args[i]);
    }
    
    // ioc/07f2

    return new GenericParamType(type, args, newParamMap);
  }