Interface CommandExecutorPool.CommandHandler

Enclosing class:
CommandExecutorPool
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface CommandExecutorPool.CommandHandler
Functional interface for command execution.

The handler receives a CommandContext and must: 1. Execute the message via appropriate handler 2. Write the response via connection.send() if response is non-null 3. Handle exceptions gracefully (don't rethrow unless truly unrecoverable)

Exceptions thrown by the handler are caught and logged; command execution continues.

Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Execute a single command.
  • Method Details

    • execute

      void execute(CommandContext ctx) throws Exception
      Execute a single command.
      Parameters:
      ctx - the command context (non-null)
      Throws:
      Exception - if execution fails (will be caught and logged)