Class HandlerAutoRegisterHandler

java.lang.Object
de.craftsblock.craftsnet.autoregister.AutoRegisterHandler<Handler>
de.craftsblock.craftsnet.autoregister.builtin.http.HandlerAutoRegisterHandler

public class HandlerAutoRegisterHandler extends AutoRegisterHandler<Handler>
A handler for automatically registering Handler implementations. This class extends AutoRegisterHandler and provides a concrete implementation for handling the registration of Handler instances into the route registry of CraftsNet.
Since:
3.2.0-SNAPSHOT
  • Constructor Details

  • Method Details

    • handle

      protected boolean handle(Handler handler, AutoRegisterInfo info, Object... args)
      Handles the registration of the provided Handler.

      This method attempts to register the given Handler with the CraftsNet.getRouteRegistry() of the associated CraftsNet instance. If registration is successful, the method returns true.

      Specified by:
      handle in class AutoRegisterHandler<Handler>
      Parameters:
      handler - The Handler to be registered.
      args - Additional arguments (not used in this implementation but provided for extensibility).
      info - The AutoRegisterInfo which holds more information about the object.
      Returns:
      true if the registration was successful, false otherwise.