Class ServiceLoader<T>
- Type Parameters:
T- provider's type
Layer, UINode, CustomPackage, ...).
A service can be a well-known interface or class for which zero, one, or many service providers exist (see the
SPI definitions).
Alternatively a service can be a simple POJO annotated with some specific annotations like jakarta.ws.rs.Path,
Filter, Platform.Event or Platform.Substitute.
Service providers are loaded and instantiated lazily, that is, on demand.
A service loader maintains a cache of the providers that have been loaded so
far. Each invocation of the load method returns an Iterable
that first yields all the elements cached from previous iteration, in
instantiation order, and then lazily locates and instantiates any remaining
providers, adding each one to the cache in turn. Caches are cleared via the reload method.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ServiceLoader<UINode> Utility method to get the instance of the service provider responsible to get theUINodeinstancesstatic ServiceLoader<Object> Utility method to get the instance of the Configurable components that are components objects tagged with the @Component.Configurable annotationstatic ServiceLoader<CustomPackage> Utility method to get the instance of the service provider responsible to get theCustomPackageinstancesstatic ServiceLoader<Object> dao()Utility method to get the instance of the service provider responsible to get the handlers of theDAO.static ServiceLoader<Entity> static ServiceLoader<Object> dataSets()Utility method to get the instance of the service provider responsible to get the handler of thePlatform.DataSetstatic ServiceLoader<Object> events()Utility method to get the instance of the service provider responsible to get the handler of thePlatform.Eventstatic ServiceLoader<Filter> filters()Utility method to get the instance of the service provider responsible to get theFilterinstancesstatic ServiceLoader<Grants> grants()Utility method to get the instance of the service provider responsible to get theGrantsinstancesstatic ServiceLoader<Object> jobs()Utility method to get the instance of the service provider responsible to get the handler of the overit.geocall.batch.scheduler.model.static ServiceLoader<Landing> landings()Utility method to get the instance of the service provider responsible to get theLandinginstancesstatic ServiceLoader<LandingTree> Utility method to get the instance of the service provider responsible to get theLandingTreeinstancesstatic ServiceLoader<LangPackage> Utility method to get the instance of the service provider responsible to get theLangPackageinstancesstatic ServiceLoader<Layer> layers()Utility method to get the instance of the service provider responsible to get theLayerinstancesload()Create a new service loader: an iterable instance that allow to iterate among the discovered services.load(ClassLoader loader) Create a new service loader: an iterable instance that allow to iterate among the discovered services.static ServiceLoader<Permissions> Utility method to get the instance of the service provider responsible to get thePermissionsinstancesstatic ServiceLoader<Object> pipes()Utility method to get the instance of the service provider responsible to get the handlers of thePlatform.Pipe.final voidreload()Clear this loader's provider cache so that all providers will be reloaded.final voidreload(ClassLoader loader) Clear this loader's provider cache so that all providers will be reloaded.static ServiceLoader<Object> Utility method to get the instance of the service provider responsible to get the JAX-RS providersstatic ServiceLoader<Object> Utility method to get the instance of the service provider responsible to get the JAX-RS resourcesstatic ServiceLoader<ScriptPackage> Utility method to get the instance of the service provider responsible to get theScriptPackageinstancesstatic ServiceLoader<Servlet> servlets()Utility method to get the instance of the service provider responsible to get theServletinstancesstatic ServiceLoader<Object> spins()Utility method to get the instance of the service provider responsible to get the handler of the overit.geocall.event.consumer.static ServiceLoader<Spout> spouts()Utility method to get the instance of the service provider responsible to get the handler of thePlatform.Eventstatic ServiceLoader<Object> Utility method to get the instance of the service provider responsible to get the classes substitutionsstatic ServiceLoader<ThemePackage> Utility method to get the instance of the service provider responsible to get theThemePackageinstancesstatic ServiceLoader<Tool> tools()Utility method to get the instance of the service provider responsible to get the handler of theCustomizableannotated typesstatic ServiceLoader<EventListener> Utility method to get the instance of the service provider responsible to get theEventListenerinstances
-
Field Details
-
PIPES
- See Also:
-
-
Method Details
-
layers
Utility method to get the instance of the service provider responsible to get theLayerinstances- Returns:
- the service provider to get the
Layerinstances
-
components
Utility method to get the instance of the service provider responsible to get theUINodeinstances- Returns:
- the service provider to get the
UINodeinstances
-
customPackages
Utility method to get the instance of the service provider responsible to get theCustomPackageinstances- Returns:
- the service provider to get the
CustomPackageinstances
-
scriptPackages
Utility method to get the instance of the service provider responsible to get theScriptPackageinstances- Returns:
- the service provider to get the
ScriptPackageinstances
-
themePackages
Utility method to get the instance of the service provider responsible to get theThemePackageinstances- Returns:
- the service provider to get the
ThemePackageinstances
-
langPackages
Utility method to get the instance of the service provider responsible to get theLangPackageinstances- Returns:
- the service provider to get the
LangPackageinstances
-
permissions
Utility method to get the instance of the service provider responsible to get thePermissionsinstances- Returns:
- the service provider to get the
Permissionsinstances
-
grants
Utility method to get the instance of the service provider responsible to get theGrantsinstances- Returns:
- the service provider to get the
Grantsinstances
-
landings
Utility method to get the instance of the service provider responsible to get theLandinginstances- Returns:
- the service provider to get the
Landinginstances
-
landingTrees
Utility method to get the instance of the service provider responsible to get theLandingTreeinstances- Returns:
- the service provider to get the
LandingTreeinstances
-
servlets
Utility method to get the instance of the service provider responsible to get theServletinstances- Returns:
- the service provider to get the
Servletinstances
-
filters
Utility method to get the instance of the service provider responsible to get theFilterinstances- Returns:
- the service provider to get the
Filterinstances
-
webListeners
Utility method to get the instance of the service provider responsible to get theEventListenerinstances- Returns:
- the service provider to get the
EventListenerinstances
-
restServices
Utility method to get the instance of the service provider responsible to get the JAX-RS resources- Returns:
- the service provider to get the JAX-RS resources
-
restProviders
Utility method to get the instance of the service provider responsible to get the JAX-RS providers- Returns:
- the service provider to get the JAX-RS providers
-
substitutions
Utility method to get the instance of the service provider responsible to get the classes substitutions- Returns:
- the service provider to get the substitutions
-
events
Utility method to get the instance of the service provider responsible to get the handler of thePlatform.Event- Returns:
- the service provider to get the event handlers
-
spouts
Utility method to get the instance of the service provider responsible to get the handler of thePlatform.Event- Returns:
- the service provider to get the eventstubs handlers
-
spins
Utility method to get the instance of the service provider responsible to get the handler of the overit.geocall.event.consumer.@EventConsumer- Returns:
- the service provider to get the
Spin
-
dataSets
Utility method to get the instance of the service provider responsible to get the handler of thePlatform.DataSet- Returns:
- the service provider to get the dataset
-
jobs
Utility method to get the instance of the service provider responsible to get the handler of the overit.geocall.batch.scheduler.model.@JobComponent- Returns:
- the service provider to get the overit.geocall.batch.scheduler.model.Job
-
pipes
Utility method to get the instance of the service provider responsible to get the handlers of thePlatform.Pipe.- Returns:
- the service provider to get the pipe request handlers.
-
tools
Utility method to get the instance of the service provider responsible to get the handler of theCustomizableannotated types- Returns:
- the service provider to get the auto discovered beans
-
dao
Utility method to get the instance of the service provider responsible to get the handlers of theDAO.- Returns:
- the service provider to get the
DAOrequest handlers.
-
dataEntities
-
configurableComponents
Utility method to get the instance of the Configurable components that are components objects tagged with the @Component.Configurable annotation- Returns:
- the service provider to get the instance of the Configurable components
-
load
Create a new service loader: an iterable instance that allow to iterate among the discovered services. The iterable returned by this method first yields all the elements of the provider cache, in the order that they were loaded. It then lazily loads and instantiates any remaining service providers, adding each one to the cache in turn. If this loader's provider caches are cleared by invoking thereloadmethod then existing iterators for this service loader should be discarded.- Returns:
- An iterable that lazily loads providers for this loader's service
-
load
Create a new service loader: an iterable instance that allow to iterate among the discovered services. The iterable returned by this method first yields all the elements of the provider cache, in the order that they were loaded. It then lazily loads and instantiates any remaining service providers, adding each one to the cache in turn. If this loader's provider caches are cleared by invoking thereloadmethod then existing iterators for this service loader should be discarded.- Parameters:
loader- the class loader to be used to load provider-configuration files and provider classes, or null if the system class loader (or, failing that, the bootstrap class loader) is to be used- Returns:
- An iterable that lazily loads providers for this loader's service
-
reload
public final void reload()Clear this loader's provider cache so that all providers will be reloaded.After invoking this method, subsequent invocations of the
load()methods will lazily locate providers from scratch, just as is done by a newly-created service loader. -
reload
Clear this loader's provider cache so that all providers will be reloaded.After invoking this method, subsequent invocations of the
load()methods will lazily locate providers from scratch, just as is done by a newly-created service loader.- Parameters:
loader- the class loader to be used to load provider-configuration files and provider classes, or null if the system class loader (or, failing that, the bootstrap class loader) is to be used
-