
public interface ServiceLoader
| Modifier and Type | Method and Description |
|---|---|
<T> Collection<T> |
all(Class<T> serviceClass)
Load multiple service implementations.
|
<T> T |
onlyOne(Class<T> serviceClass)
Load a single service implementation.
|
<T> T |
onlyOne(Class<T> serviceClass,
Class<? extends T> defaultServiceClass)
Load a single service implementation.
|
<T> Collection<T> all(Class<T> serviceClass)
T - serviceClass - The service interface to load a implementations forCollection of all instances of serviceClass<T> T onlyOne(Class<T> serviceClass)
IllegalStateException if multiple instances of serviceClass found.T - serviceClass - The service interface to load a implementation forIllegalStateException - if more then one implementation of serviceClass found<T> T onlyOne(Class<T> serviceClass, Class<? extends T> defaultServiceClass)
T - serviceClass - The service interface to load a implementation fordefaultServiceClass - If no other implementations found, create a instance of this classCopyright © 2015 JBoss by Red Hat. All rights reserved.