What is service loader in Java?
Besides, what is service loader?
A service provider (or just provider) is a class that implements or subclasses the well-known interface or class. A ServiceLoader is an object that locates and loads service providers deployed in the run time environment at a time of an application's choosing.
Herein, what is a Java service?
In Java, a service is defined by a set of interfaces and classes. The service contains an interface or an abstract class that defines the functionality provided by the service. There are multiple implementations for a service and they are called as service providers.
Java SPI (Service Provider Interface) is the mechanism to load services dynamically. We can implement Java SPI in our application by following the specific set of rules and load the services using the ServiceLoader class.