com.vaadin.flow.di.
Class LookupInitializer.LookupImpl
- java.lang.Object
-
- com.vaadin.flow.di.LookupInitializer.LookupImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Class<?>,Collection<Object>>
serviceMap
-
Constructor Summary
Constructors Modifier Constructor 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.
-
Method Summary
All Methods Modifier and Type Method 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
.
-
-
-
Field Detail
-
serviceMap
protected final Map<Class<?>,Collection<Object>> serviceMap
-
-
Constructor Detail
-
LookupImpl
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.Parameters:
initialServices
- map of initial services with their implementationsfactory
- a factory to create a service object instance
-
-
Method Detail
-
lookup
public <T> T lookup(Class<T> serviceClass)
Description copied from interface:
Lookup
Lookup for a service of the given type.
The
serviceClass
is usually an interface (though it doesn't have to be) and the returned value is some implementation of this interface.Specified by:
Type Parameters:
T
- a service typeParameters:
serviceClass
- a service SPI classReturns:
a service which implements the
serviceClass
, may benull
if no services are registered for this SPISee Also:
-
lookupAll
public <T> Collection<T> lookupAll(Class<T> serviceClass)
Description copied from interface:
Lookup
Lookup for all services by the provided
serviceClass
.The
serviceClass
is usually an interface class (though it doesn't have to be) and the returned value is all implementations of this interface.
-
-