protected static class LookupInitializer.LookupImpl extends Object implements Lookup
Lookup.| Modifier and Type | Field and Description |
|---|---|
protected Map<Class<?>,Collection<Object>> |
serviceMap |
| Modifier | Constructor and Description |
|---|---|
protected |
LookupImpl(Map<Class<?>,Collection<Class<?>>> initialServices,
BiFunction<Class<?>,Class<?>,Object> factory)
Creates a new instance of
Lookup with services found in the
application classpath. |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
lookup(Class<T> serviceClass)
Lookup for a service of the given type.
|
<T> Collection<T> |
lookupAll(Class<T> serviceClass)
Lookup for all services by the provided
serviceClass. |
protected final Map<Class<?>,Collection<Object>> serviceMap
protected LookupImpl(Map<Class<?>,Collection<Class<?>>> initialServices, BiFunction<Class<?>,Class<?>,Object> factory)
Lookup with services found in the
application classpath.initialServices - map of initial services with their implementationsfactory - a factory to create a service object instancepublic <T> T lookup(Class<T> serviceClass)
Lookup
The serviceClass is usually an interface (though it doesn't have
to be) and the returned value is some implementation of this interface.
lookup in interface LookupT - a service typeserviceClass - a service SPI classserviceClass, may be
null if no services are registered for this SPILookup.lookupAll(Class)public <T> Collection<T> lookupAll(Class<T> serviceClass)
LookupserviceClass.
The serviceClass is usually an interface class (though it doesn't
have to be) and the returned value is all implementations of this
interface.
Copyright © 2025. All rights reserved.