Package ej.service.loader
Class MetaInfServiceLoader
- java.lang.Object
-
- ej.service.loader.SimpleServiceLoader
-
- ej.service.loader.DependencyInjectionServiceLoader
-
- ej.service.loader.MetaInfServiceLoader
-
- All Implemented Interfaces:
ServiceLoader
public class MetaInfServiceLoader extends DependencyInjectionServiceLoader
Service loader that retrieves services implementations following standard Java service definition.Services are defined in files located in "/META-INF/services/" folder:
- the file is named after the implemented service (fully qualified name),
- the content of the file is the fully qualified name of the implementation class.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSERVICES_FOLDERFolder where the services are defined.-
Fields inherited from class ej.service.loader.SimpleServiceLoader
services
-
-
Constructor Summary
Constructors Constructor Description MetaInfServiceLoader()Creates a new META-INF properties service loader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetImplementationName(String key)Gets the implementation class name for the given service name.-
Methods inherited from class ej.service.loader.DependencyInjectionServiceLoader
createAlternativeImplementation
-
Methods inherited from class ej.service.loader.SimpleServiceLoader
checkServicePermission, getService, putService
-
-
-
-
Field Detail
-
SERVICES_FOLDER
public static final String SERVICES_FOLDER
Folder where the services are defined.- See Also:
- Constant Field Values
-
-
Method Detail
-
getImplementationName
@Nullable protected String getImplementationName(String key)
Description copied from class:DependencyInjectionServiceLoaderGets the implementation class name for the given service name.- Specified by:
getImplementationNamein classDependencyInjectionServiceLoader- Parameters:
key- the service name.- Returns:
- the implementation class name, or
nullif none.
-
-