#835 Replace injector classes with ones from ch.jalu.injector project
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import ch.jalu.injector.Injector;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
@@ -11,7 +12,6 @@ import fr.xephi.authme.converter.RoyalAuthConverter;
|
||||
import fr.xephi.authme.converter.SqliteToSql;
|
||||
import fr.xephi.authme.converter.vAuthConverter;
|
||||
import fr.xephi.authme.converter.xAuthConverter;
|
||||
import fr.xephi.authme.initialization.AuthMeServiceInitializer;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.util.BukkitService;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -31,7 +31,7 @@ public class ConverterCommand implements ExecutableCommand {
|
||||
private BukkitService bukkitService;
|
||||
|
||||
@Inject
|
||||
private AuthMeServiceInitializer initializer;
|
||||
private Injector injector;
|
||||
|
||||
@Override
|
||||
public void executeCommand(final CommandSender sender, List<String> arguments) {
|
||||
@@ -46,7 +46,7 @@ public class ConverterCommand implements ExecutableCommand {
|
||||
}
|
||||
|
||||
// Get the proper converter instance
|
||||
final Converter converter = initializer.newInstance(jobType.getConverterClass());
|
||||
final Converter converter = injector.newInstance(jobType.getConverterClass());
|
||||
|
||||
// Run the convert job
|
||||
bukkitService.runTaskAsynchronously(new Runnable() {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package fr.xephi.authme.command.executable.authme;
|
||||
|
||||
import ch.jalu.injector.Injector;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.command.CommandService;
|
||||
import fr.xephi.authme.command.ExecutableCommand;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.initialization.AuthMeServiceInitializer;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||
@@ -23,7 +23,7 @@ public class ReloadCommand implements ExecutableCommand {
|
||||
private AuthMe plugin;
|
||||
|
||||
@Inject
|
||||
private AuthMeServiceInitializer initializer;
|
||||
private Injector injector;
|
||||
|
||||
@Inject
|
||||
private NewSetting settings;
|
||||
@@ -44,7 +44,7 @@ public class ReloadCommand implements ExecutableCommand {
|
||||
ConsoleLogger.info("Note: cannot change database type during /authme reload");
|
||||
sender.sendMessage("Note: cannot change database type during /authme reload");
|
||||
}
|
||||
initializer.performReloadOnServices();
|
||||
// FIXME #835: Add replacement for injector.performReloadOnServices();
|
||||
commandService.send(sender, MessageKey.CONFIG_RELOAD_SUCCESS);
|
||||
} catch (Exception e) {
|
||||
sender.sendMessage("Error occurred during reload of AuthMe: aborting");
|
||||
|
||||
Reference in New Issue
Block a user