01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2005-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.factory;
17:
18: // J2SE dependencies
19: import java.util.Iterator;
20:
21: /**
22: * Provides iterators over factories of specified categories. Users shall
23: * {@linkplain Factories#addFactoryIteratorProvider register} an implementation
24: * of this interface when the default lookup mechanism (namely scanning the content of the
25: * <code>META-INF/services/</code><var>category</var> file in every JARs found on the classpath)
26: * can not work. Such need may appear in the context of {@linkplain ClassLoader class loaders}
27: * restricting access to non-package directories as {@code META-INF}. This constraint occurs on
28: * the Eclipse platform for instance.
29: *
30: * @since 2.4
31: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/metadata/src/main/java/org/geotools/factory/FactoryIteratorProvider.java $
32: * @version $Id: FactoryIteratorProvider.java 24765 2007-03-15 03:50:56Z desruisseaux $
33: * @author Martin Desruisseaux
34: *
35: * @see FactoryRegistry#addFactoryIteratorProvider
36: * @see CommonFactory#addFactoryIteratorProvider
37: */
38: public interface FactoryIteratorProvider {
39: /**
40: * Returns an iterator over all {@linkplain Factory factories} of the specified category.
41: * The {@code category} argument should be the interface class to be implemented, not the
42: * actual implementation.
43: *
44: * @param category The category for the factories to be returned.
45: * @return Factories that implement the specified category.
46: */
47: Iterator/*<T>*/iterator(final Class/*<T>*/category);
48: }
|