Class LockableCommandManager<C>

java.lang.Object
cloud.commandframework.CommandManager<C>
cloud.commandframework.LockableCommandManager<C>
Type Parameters:
C - Command sender type

@Deprecated @API(status=DEPRECATED, since="1.2.0") public abstract class LockableCommandManager<C> extends CommandManager<C>
Deprecated.
Use a normal CommandManager's registration state instead
CommandManager 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, use CommandManager.isCommandRegistrationAllowed(). If CommandManager.isCommandRegistrationAllowed() is false then CommandManager.command(Command) will throw IllegalStateException.

Since:
1.1.0
  • Constructor Details

    • LockableCommandManager

      protected LockableCommandManager(@NonNull 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 between CommandExecutionCoordinator.simpleCoordinator() and AsynchronousCommandExecutionCoordinator
      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 Details