public interface Lookup
This is similar to the Instantiator class but a Lookup
instance is available even before a VaadinService instance is created
(and as a consequence there is no yet an Instantiator instance).
The Lookup instance and the VaadinContext has one to one
mapping and is available even before a DeploymentConfiguration ( and
VaadinServlet) is created. So this is kind of a singleton for a Web
Application. As a consequence it provides and may return only web app
singleton services.
This is the code which one may use to get the Lookup instance:
VaadinContext context = ...;
Lookup lookup = context.getAttribute(Lookup.class);
This SPI is mostly for internal framework usage since Instantiator
provides all required services for the application developer.
Instantiator| 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. |
<T> T lookup(Class<T> serviceClass)
The serviceClass is usually an interface (though it doesn't have
to be) and the returned value is some implementation of this interface.
T - a service typeserviceClass - a service SPI classserviceClass, may be
null if no services are registered for this SPIlookupAll(Class)<T> Collection<T> lookupAll(Class<T> serviceClass)
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.
T - a service typeserviceClass - a service SPI classserviceClass, if no
services found an empty list is returned (so null is not
returned)Copyright © 2025. All rights reserved.