Service provider (Implementation) module

Now, create a service provider module com.packt.service.impl to implement NotificationService service API, and for that we should define a "provides ... with" clause in the module-info.java file. The provides keyword is used to mention the service interface name and the with keyword is used to mention which implementation we want to load. In the event that the module doesn’t have the provides statement in the module descriptor file, the service loader will not load that module. The syntax of the 'provides...with' statement is as follows:

provides <service-interface> with <service-implementation>

To send an SMS message to a recipient we are creating two implementation classes, SMSServiceImpl.java 

Get Java 9 Dependency Injection now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.