Class ModuleHelper
java.lang.Object
eu.cloudnetservice.driver.impl.module.ModuleHelper
Deprecated.
This module helper class provides helper methods for cloudnet modules that also operate as a plugin on the services.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final eu.cloudnetservice.driver.event.EventManagerDeprecated.private static final org.slf4j.LoggerDeprecated.private final eu.cloudnetservice.driver.network.NetworkClientDeprecated.private final eu.cloudnetservice.driver.network.rpc.handler.RPCHandlerRegistryDeprecated.private final eu.cloudnetservice.driver.registry.ServiceRegistryDeprecated. -
Constructor Summary
ConstructorsConstructorDescriptionModuleHelper(@NonNull eu.cloudnetservice.driver.event.EventManager eventManager, @NonNull eu.cloudnetservice.driver.network.NetworkClient networkClient, @NonNull eu.cloudnetservice.driver.registry.ServiceRegistry serviceRegistry, @NonNull eu.cloudnetservice.driver.network.rpc.handler.RPCHandlerRegistry rpcHandlerRegistry) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbooleancopyJarContainingClass(@NonNull Class<?> clazz, @NonNull Path target) Deprecated.Copies the caller class location from the class path to the given target path.voidcopyPluginConfigurationFileForEnvironment(@NonNull Class<?> clazz, @NonNull eu.cloudnetservice.driver.service.ServiceEnvironmentType type, @NonNull Path file) Deprecated.Copies the appropriate plugin configuration file for the given service environment type.voidunregisterAll(@NonNull ClassLoader classLoader) Deprecated.Unregisters all kind of listeners and bindings: Registered events in theEventManagerRegistered services in theServiceRegistryRegistered bindings for theDefaultObjectMapper.DEFAULT_MAPPERRegistered rpc handlers in theRPCHandlerRegistryRegistered packet listeners in thePacketListenerRegistry
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGERDeprecated. -
eventManager
private final eu.cloudnetservice.driver.event.EventManager eventManagerDeprecated. -
networkClient
private final eu.cloudnetservice.driver.network.NetworkClient networkClientDeprecated. -
serviceRegistry
private final eu.cloudnetservice.driver.registry.ServiceRegistry serviceRegistryDeprecated. -
rpcHandlerRegistry
private final eu.cloudnetservice.driver.network.rpc.handler.RPCHandlerRegistry rpcHandlerRegistryDeprecated.
-
-
Constructor Details
-
ModuleHelper
@Inject public ModuleHelper(@NonNull @NonNull eu.cloudnetservice.driver.event.EventManager eventManager, @NonNull @NonNull eu.cloudnetservice.driver.network.NetworkClient networkClient, @NonNull @NonNull eu.cloudnetservice.driver.registry.ServiceRegistry serviceRegistry, @NonNull @NonNull eu.cloudnetservice.driver.network.rpc.handler.RPCHandlerRegistry rpcHandlerRegistry) Deprecated.
-
-
Method Details
-
copyJarContainingClass
public boolean copyJarContainingClass(@NonNull @NonNull Class<?> clazz, @NonNull @NonNull Path target) Deprecated.Copies the caller class location from the class path to the given target path.- Parameters:
clazz- the class of which the associated class path entry should get copied.target- the target file to copy the file into - the file is not required to exist.- Returns:
- true if the entry was copied successfully, false otherwise.
- Throws:
NullPointerException- if clazz or target is null.
-
copyPluginConfigurationFileForEnvironment
public void copyPluginConfigurationFileForEnvironment(@NonNull @NonNull Class<?> clazz, @NonNull @NonNull eu.cloudnetservice.driver.service.ServiceEnvironmentType type, @NonNull @NonNull Path file) Deprecated.Copies the appropriate plugin configuration file for the given service environment type. All the listed files will be copied and renamed to plugin.yml:- plugin.bungee.yml if the given environment is BUNGEECORD.
- plugin.waterdogpe.yml if the given environment is WATERDOG_PE.
- plugin.nukkit.yml if the given environment is NUKKIT.
- plugin.limboloohp.yml if the given environment is LIMBO_LOOHP.
- plugin.bukkit.yml is used as a fallback - if the file does not exist it will not be used.
- Parameters:
clazz- the class of which the associated class path entry should get copied.type- the currentServiceEnvironmentTypeof the service the file gets copied for.file- the target file of the plugin to copy the file for.- Throws:
NullPointerException- if clazz, type or file is null.
-
unregisterAll
Deprecated.Unregisters all kind of listeners and bindings:- Registered events in the
EventManager - Registered services in the
ServiceRegistry - Registered bindings for the
DefaultObjectMapper.DEFAULT_MAPPER - Registered rpc handlers in the
RPCHandlerRegistry - Registered packet listeners in the
PacketListenerRegistry
- Parameters:
classLoader- the class loader that registered all the mentioned listeners and bindings.- Throws:
NullPointerException- if the given class loader is null.
- Registered events in the
-