1package com.bumptech.glide.load.model; 2 3import android.content.Context; 4 5/** 6 * An interface for creating a {@link ModelLoader} for a given model type. Will be retained statically so should not 7 * retain {@link Context} or any other objects that cannot be retained for the life of the application. ModelLoaders 8 * will not be retained statically so it is safe for any ModelLoader built by this factory to retain a reference to a 9 * {@link Context}. 10 */ 11public interface ModelLoaderFactory<T, Y> { 12 13 /** 14 * Build a concrete ModelLoader for this model type. 15 * 16 * @param context A context that cannot be retained by the factory but can be retained by the {@link ModelLoader} 17 * @param factories A map of classes to factories that can be used to construct additional {@link ModelLoader}s that 18 * this factory's {@link ModelLoader} may depend on 19 * @return A new {@link ModelLoader} 20 */ 21 public ModelLoader<T, Y> build(Context context, GenericLoaderFactory factories); 22 23 /** 24 * A lifecycle method that will be called when this factory is about to replaced 25 */ 26 public void teardown(); 27} 28