Package cloud.commandframework
Class LockableCommandManager<C>
- java.lang.Object
-
- cloud.commandframework.CommandManager<C>
-
- cloud.commandframework.LockableCommandManager<C>
-
- Type Parameters:
C
- Command sender type
@Deprecated public abstract class LockableCommandManager<C> extends CommandManager<C>
Deprecated.Use a normalCommandManager
's registration state insteadCommandManager
implementation that allows you to lock command registrations. This should be used when the platform limits command registration to a certain point in time.To lock writes, use
lockWrites()
. To check if writing is allowed, useCommandManager.isCommandRegistrationAllowed()
. IfCommandManager.isCommandRegistrationAllowed()
isfalse
thenCommandManager.command(Command)
will throwIllegalStateException
.- Since:
- 1.1.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class cloud.commandframework.CommandManager
CommandManager.ManagerSettings, CommandManager.RegistrationState
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LockableCommandManager(@NonNull java.util.function.Function<@NonNull CommandTree<C>,@NonNull CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull CommandRegistrationHandler commandRegistrationHandler)
Deprecated.Create a new command manager instance
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
lockWrites()
Deprecated.Lock writing.-
Methods inherited from class cloud.commandframework.CommandManager
argumentBuilder, command, command, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, commandBuilder, createDefaultCommandMeta, executeCommand, flagBuilder, getCaptionRegistry, getCommandHelpHandler, getCommandHelpHandler, getCommandRegistrationHandler, getCommands, getCommandSuggestionProcessor, getCommandSyntaxFormatter, getCommandTree, getExceptionHandler, getParserRegistry, getRegistrationState, getSetting, handleException, hasPermission, hasPermission, isCommandRegistrationAllowed, lockRegistration, parameterInjectorRegistry, postprocessContext, preprocessContext, registerCommandPostProcessor, registerCommandPreProcessor, registerDefaultCaptions, registerExceptionHandler, requireState, setCaptionRegistry, setCommandRegistrationHandler, setCommandSuggestionProcessor, setCommandSyntaxFormatter, setSetting, suggest, transitionIfPossible, transitionOrThrow
-
-
-
-
Constructor Detail
-
LockableCommandManager
protected LockableCommandManager(@NonNull java.util.function.Function<@NonNull CommandTree<C>,@NonNull CommandExecutionCoordinator<C>> commandExecutionCoordinator, @NonNull CommandRegistrationHandler commandRegistrationHandler)
Deprecated.Create a new command manager instance- Parameters:
commandExecutionCoordinator
- Execution coordinator instance. The coordinator is in charge of executing incoming commands. Some considerations must be made when picking a suitable execution coordinator for your platform. For example, an entirely asynchronous coordinator is not suitable when the parsers used in that particular platform are not thread safe. If you have commands that perform blocking operations, however, it might not be a good idea to use a synchronous execution coordinator. In most cases you will want to pick betweenCommandExecutionCoordinator.simpleCoordinator()
andAsynchronousCommandExecutionCoordinator
commandRegistrationHandler
- Command registration handler. This will get called every time a new command is registered to the command manager. This may be used to forward command registration
-
-
Method Detail
-
lockWrites
protected final void lockWrites()
Deprecated.Lock writing. After this,CommandManager.isCommandRegistrationAllowed()
will returnfalse
-
-