Class ServiceLoaderAutoRegisterHandler
java.lang.Object
de.craftsblock.craftsnet.autoregister.AutoRegisterHandler<ServiceLoader<?>>
de.craftsblock.craftsnet.autoregister.builtin.addons.ServiceLoaderAutoRegisterHandler
A handler for automatically registering
ServiceLoader implementations. This class extends
AutoRegisterHandler and provides a concrete implementation for handling the registration of
ServiceLoader instances into the service manager registry of CraftsNet.- Since:
- 3.2.0-SNAPSHOT
-
Field Summary
Fields inherited from class de.craftsblock.craftsnet.autoregister.AutoRegisterHandler
craftsNet -
Constructor Summary
ConstructorsConstructorDescriptionServiceLoaderAutoRegisterHandler(CraftsNet craftsNet) Constructs a newServiceLoaderAutoRegisterHandler. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanhandle(ServiceLoader<?> serviceLoader, AutoRegisterInfo info, Object... args) Handles the registration of the providedServiceLoader.Methods inherited from class de.craftsblock.craftsnet.autoregister.AutoRegisterHandler
getCraftsNet
-
Constructor Details
-
ServiceLoaderAutoRegisterHandler
Constructs a newServiceLoaderAutoRegisterHandler.- Parameters:
craftsNet- TheCraftsNetinstance used for managing the service manager registry.
-
-
Method Details
-
handle
Handles the registration of the providedServiceLoader.This method attempts to register the given
ServiceLoaderwith theCraftsNet.getServiceManager()of the associatedCraftsNetinstance. If registration is successful, the method returnstrue.- Specified by:
handlein classAutoRegisterHandler<ServiceLoader<?>>- Parameters:
serviceLoader- TheServiceLoaderto be registered.args- Additional arguments (not used in this implementation but provided for extensibility).info- TheAutoRegisterInfowhich holds more information about the object.- Returns:
trueif the registration was successful,falseotherwise.
-