Class DefaultDataProviderFactory

java.lang.Object
org.fastnate.data.AbstractDataProviderFactory
org.fastnate.data.DefaultDataProviderFactory
All Implemented Interfaces:
DataProviderFactory

public class DefaultDataProviderFactory extends AbstractDataProviderFactory
Finds and builds all implementations of DataProvider from the class path. Each found non abstract class extending DataProvider is instantiated:
  1. First a constructor with parameters of an allowed type is searched.
  2. Then all fields and setters marked with @Resource are initiated.
  3. At the end all methods marked with @PostConstruct are invoked.
  4. If nothing fails, the new provider is registered.
Allowed types for constructor parameters and resources: The factory will search for the available data providers in the packages defined in the property EntityImporter.PACKAGES_KEY. In addition one can define one or more data providers in the file /META-INF/services/org.fastnate.data.DataProvider.
Author:
Tobias Liefke