/** * Creates and returns a new instance of the specified view type. * * @param <RESOLVERSYSTEMTYPE> The {@link ResolverSystem} type. * @param clazz The view type * @return A new instance of the specified view type. * @throws IllegalArgumentException * If the type is not specified */ public static <RESOLVERSYSTEMTYPE extends ResolverSystem> RESOLVERSYSTEMTYPE use( final Class<RESOLVERSYSTEMTYPE> clazz) throws IllegalArgumentException { return ResolverSystemFactory.createFromUserView(clazz); }
/** * Returns a factory to create configured {@link ResolverSystem} instances of the specified type. New instances will * be created using the current {@link Thread#getContextClassLoader()}. * * @param <RESOLVERSYSTEMTYPE> The {@link ResolverSystem} type. * @param <CONFIGURABLERESOLVERSYSTEMTYPE> The {@link ConfigurableResolverSystem} type. * @param clazz The type * @return A factory to create configured {@link ResolverSystem} instances of the specified type. * @throws IllegalArgumentException * If the type is not specified */ public static <RESOLVERSYSTEMTYPE extends ResolverSystem, CONFIGURABLERESOLVERSYSTEMTYPE extends ConfigurableResolverSystem<RESOLVERSYSTEMTYPE, CONFIGURABLERESOLVERSYSTEMTYPE>> CONFIGURABLERESOLVERSYSTEMTYPE configure( final Class<CONFIGURABLERESOLVERSYSTEMTYPE> clazz) throws IllegalArgumentException { return ResolverSystemFactory.createFromUserView(clazz); }
/** * Creates and returns a new instance of the specified view type. New instances will be created by using the * specified {@link ClassLoader}. * * @param <RESOLVERSYSTEMTYPE> The {@link ResolverSystem} type. * @param clazz The view type. * @param cl The {@link ClassLoader}. * @return A new instance of the specified view type created by using the specified {@link ClassLoader}. * @throws IllegalArgumentException * If either argument is not supplied */ public static <RESOLVERSYSTEMTYPE extends ResolverSystem> RESOLVERSYSTEMTYPE use( final Class<RESOLVERSYSTEMTYPE> clazz, final ClassLoader cl) throws IllegalArgumentException { return ResolverSystemFactory.createFromUserView(clazz, cl); } }
/** * Returns a factory to create configured {@link ResolverSystem} instances of the specified type. New instances will * be created using the specified {@link ClassLoader}. * * @param <RESOLVERSYSTEMTYPE> The {@link ResolverSystem} type. * @param <CONFIGURABLERESOLVERSYSTEMTYPE> The {@link ConfigurableResolverSystem} type. * @param clazz The type * @param cl The {@link ClassLoader} * @return A factory to create configured {@link ResolverSystem} instances of the specified type. The factory will * be created by using the specified {@link ClassLoader}. * @throws IllegalArgumentException * If the type or {@link ClassLoader} is not specified */ public static <RESOLVERSYSTEMTYPE extends ResolverSystem, CONFIGURABLERESOLVERSYSTEMTYPE extends ConfigurableResolverSystem<RESOLVERSYSTEMTYPE, CONFIGURABLERESOLVERSYSTEMTYPE>> CONFIGURABLERESOLVERSYSTEMTYPE configure( final Class<CONFIGURABLERESOLVERSYSTEMTYPE> clazz, final ClassLoader cl) throws IllegalArgumentException { return ResolverSystemFactory.createFromUserView(clazz, cl); }
/** * Creates a new {@link ResolverSystem} instance of the specified user view type using the {@link Thread} Context * {@link ClassLoader}. Will consult a configuration file visible to the {@link Thread} Context {@link ClassLoader} named * "META-INF/services/$fullyQualfiedClassName" which should contain a key=value format with the key * {@link ResolverSystemFactory#KEY_IMPL_CLASS_NAME}. The implementation class name must have a no-arg constructor. * * @param userViewClass The user view type * @return The new {@link ResolverSystem} instance of the specified user view type created by using the {@link Thread} * Context {@link ClassLoader}. * @throws IllegalArgumentException * If the user view class was not specified */ static <RESOLVERSYSTEMTYPE extends ResolverSystem> RESOLVERSYSTEMTYPE createFromUserView( final Class<RESOLVERSYSTEMTYPE> userViewClass) throws IllegalArgumentException { return createFromUserView(userViewClass, SecurityActions.getThreadContextClassLoader()); }