public abstract class Service extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Service.ProviderClassItr<P>
Lazy iterator over provider classes.
|
protected static class |
Service.ProviderItr<P>
Lazy iterator over service provider instances.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DIRECTORY
SPI resources directory.
|
| Modifier and Type | Method and Description |
|---|---|
static <P> Iterator<P> |
lookup(Class<P> category)
Searches for service provider classes of the specified category and
returns iterator over their instances.
|
static <P> Iterator<P> |
lookup(Class<P> category,
ClassLoader cl)
Searches for service provider classes of the specified category using
the specified class loader and returns iterator over their instances.
|
static <P> Iterator<Class<? extends P>> |
lookupClasses(Class<P> category)
Searches for service provider classes of the specified category and
returns iterator over them.
|
static <P> Iterator<Class<? extends P>> |
lookupClasses(Class<P> category,
ClassLoader cl)
Searches for service provider classes of the specified category using
the specified class loader and returns iterator over them.
|
static <P> P |
lookupFirst(Class<P> category)
Searches for service provider classes of the specified category and
returns first service provider instance.
|
static <P> P |
lookupFirst(Class<P> category,
ClassLoader cl)
Searches for service provider classes of the specified category using
the specified class loader and returns first service provider instance.
|
public static final String DIRECTORY
public static <P> Iterator<P> lookup(Class<P> category)
category - Service provider category to search.ResourceError - if an error occured when reading SPI resources.lookup(Class, ClassLoader)public static <P> Iterator<P> lookup(Class<P> category, ClassLoader cl)
category - Service provider category to search.cl - Class loader to be used for service provider class loading.ResourceError - if an error occured when reading SPI resources.public static <P> P lookupFirst(Class<P> category)
category - Service provider category to search.null if there
are no service provider classes found.ResourceError - if an error occured when reading SPI resources.lookupFirst(Class, ClassLoader)public static <P> P lookupFirst(Class<P> category, ClassLoader cl)
category - Service provider category to search.cl - Class loader to be used for service provider class loading.null if there
are no service provider classes found.ResourceError - if an error occured when reading SPI resources.public static <P> Iterator<Class<? extends P>> lookupClasses(Class<P> category)
category - Service provider category to search.ResourceError - if an error occured when reading SPI resources.lookupClasses(Class, ClassLoader)public static <P> Iterator<Class<? extends P>> lookupClasses(Class<P> category, ClassLoader cl)
category - Service provider category to search.cl - Class loader to be used for service provider class loading.ResourceError - if an error occured when reading SPI resources.Copyright © 2010-2012 FoxLabs. All Rights Reserved.