if (configuration.isReadThrough()) configuration.setCacheLoaderFactory(new FactoryBuilder.ClassFactory<CacheLoader<PageKey, Page>>(properties.getProperty("cache-loader-factory"))); configuration.setCacheWriterFactory(new FactoryBuilder.ClassFactory<CacheWriter<? super PageKey, ? super Page>>(properties.getProperty("cache-writer-factory"))); configuration.setExpiryPolicyFactory(new FactoryBuilder.ClassFactory<ExpiryPolicy>(expirtyPolicy));
public static <T> Factory<T> factoryOf(Class<T> clazz) { return new ClassFactory<T>(clazz); }
public static <T> Factory<T> factoryOf(String className) { return new ClassFactory<T>(className); }
/** * Constructs a {@link Factory} that will produce factory instances of the * specified class. * <p> * The specified class must have a no-args constructor. * * @param clazz the class of instances to be produced by the returned * {@link Factory} * @param <T> the type of the instances produced by the {@link Factory} * @return a {@link Factory} for the specified clazz */ public static <T> Factory<T> factoryOf(Class<T> clazz) { return new ClassFactory<T>(clazz); }
/** * Constructs a {@link Factory} that will produce factory instances of the * specified class. * <p> * The specified class must have a no-args constructor. * * @param className the class of instances to be produced by the returned * {@link Factory} * @param <T> the type of the instances produced by the {@link Factory} * @return a {@link Factory} for the specified clazz */ public static <T> Factory<T> factoryOf(String className) { return new ClassFactory<T>(className); }
/** * Constructs a {@link Factory} that will produce factory instances of the * specified class. * <p> * The specified class must have a no-args constructor. * * @param clazz the class of instances to be produced by the returned * {@link Factory} * @param <T> the type of the instances produced by the {@link Factory} * @return a {@link Factory} for the specified clazz */ public static <T> Factory<T> factoryOf(Class<T> clazz) { return new ClassFactory<T>(clazz); }
/** * Constructs a {@link Factory} that will produce factory instances of the * specified class. * <p> * The specified class must have a no-args constructor. * * @param className the class of instances to be produced by the returned * {@link Factory} * @param <T> the type of the instances produced by the {@link Factory} * @return a {@link Factory} for the specified clazz */ public static <T> Factory<T> factoryOf(String className) { return new ClassFactory<T>(className); }