Module org.apache.jena.base
Package org.apache.jena.base.module
Class SubsystemRegistryServiceLoader<T extends SubsystemLifecycle>
java.lang.Object
org.apache.jena.base.module.SubsystemRegistryServiceLoader<T>
- All Implemented Interfaces:
SubsystemRegistry<T>
public class SubsystemRegistryServiceLoader<T extends SubsystemLifecycle>
extends Object
implements SubsystemRegistry<T>
Implementation of
SubsystemRegistry that uses ServiceLoader to find sub-systems.
In unnamed modules, the ServiceLoader used to use META-INF/service/interface-name.
With modules, the application module-info.java contains:
module com.example.app {
requires java.sql;
uses java.sql.Driver;
}
and the provider module-info.java contains:
module com.example.jdbc {
requires java.sql;
provides java.sql.Driver
with com.example.jdbc.MyDriver;
}
With classpath, not module path and automatic modules, the application (here, Jena initialization) need not do anything, and the automatic modules implicitly provide an interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd to the collection.booleanisEmpty()booleanisRegistered(T module) check whether registeredvoidload()Load - perform some kinds of search forSubsystemLifecycleimplementations.voidRemove from the collection.intsize()snapshot()Return the registered items in a copied list.
-
Constructor Details
-
SubsystemRegistryServiceLoader
-
-
Method Details
-
load
public void load()Description copied from interface:SubsystemRegistryLoad - perform some kinds of search forSubsystemLifecycleimplementations. This is called once in the initialization process.The registry must load object of class T. If using the
ServiceLoader, the registry implementation will need an object ofClass<T>.- Specified by:
loadin interfaceSubsystemRegistry<T extends SubsystemLifecycle>
-
add
Description copied from interface:SubsystemRegistryAdd to the collection.- Specified by:
addin interfaceSubsystemRegistry<T extends SubsystemLifecycle>
-
isRegistered
Description copied from interface:SubsystemRegistrycheck whether registered- Specified by:
isRegisteredin interfaceSubsystemRegistry<T extends SubsystemLifecycle>
-
remove
Description copied from interface:SubsystemRegistryRemove from the collection.- Specified by:
removein interfaceSubsystemRegistry<T extends SubsystemLifecycle>
-
size
public int size()- Specified by:
sizein interfaceSubsystemRegistry<T extends SubsystemLifecycle>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceSubsystemRegistry<T extends SubsystemLifecycle>
-
snapshot
Description copied from interface:SubsystemRegistryReturn the registered items in a copied list. The list is detached from the registry and the caller can mutate it. There is no specific ordering requirement.- Specified by:
snapshotin interfaceSubsystemRegistry<T extends SubsystemLifecycle>
-