Class ExecutorServiceHandler

java.lang.Object
com.loomcache.server.handler.ExecutorServiceHandler

public class ExecutorServiceHandler extends Object
Local protocol handler for executor service operations.

Executes incoming EXECUTOR_* messages against a node-local DistributedExecutorService instance obtained from the DataStructureRegistry. Cluster entry points must only expose these operations when they are modeled safely for Raft replication; otherwise requests must be rejected before reaching this handler.

Message Format

  • mapName — executor service name
  • key — task ID (for cancel/status/result) or routing key (for submitToKey)
  • value — Kryo-serialized Callable (for submit operations) or target member ID (for submitToMember)

Supported Operations

  • EXECUTOR_SUBMIT — submit a task, returns task ID
  • EXECUTOR_SUBMIT_TO_KEY — submit a task routed to a key owner
  • EXECUTOR_SUBMIT_TO_MEMBER — submit a task to a specific member
  • EXECUTOR_SUBMIT_TO_ALL — submit a task to all members (local only)
  • EXECUTOR_CANCEL — cancel a task by ID
  • EXECUTOR_STATUS — query task status
  • EXECUTOR_RESULT — retrieve task result
  • EXECUTOR_SHUTDOWN — shut down a named executor
Since:
2.0
  • Constructor Details

  • Method Details

    • handle

      public @Nullable Message handle(Message msg)
      Handle an executor service operation message.
      Parameters:
      msg - the incoming message (must have an EXECUTOR_* type)
      Returns:
      a response message with the operation result, or null for unhandled types
    • isExecutorOperation

      public static boolean isExecutorOperation(@Nullable MessageType type)
      Check whether the given message type is an executor operation.
      Parameters:
      type - the message type to check
      Returns:
      true if this is an EXECUTOR_* operation