Class ConsistencySubsystemHandler

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

public class ConsistencySubsystemHandler extends Object
Handles Consistency Subsystem operations over the network. Routes lock, semaphore, and atomic operations to the ConsistencySubsystem.

Supported Operations:

  • CP_LOCK_ACQUIRE — distributed lock acquisition with fencing
  • CP_LOCK_RELEASE — distributed lock release
  • CP_SEMAPHORE_ACQUIRE — semaphore permit acquisition
  • CP_SEMAPHORE_RELEASE — semaphore permit release
  • CP_SEMAPHORE_AVAILABLE_PERMITS — read current semaphore permits
  • CP_ATOMIC_GET — read atomic long value
  • CP_ATOMIC_SET — write atomic long value
  • CP_ATOMICREF_GET — read atomic reference value
  • CP_ATOMICREF_SET — write atomic reference value
  • CP_ATOMICREF_CAS — compare-and-set atomic reference value
  • CP_LATCH_TRY_SET — initialize/re-arm a countdown latch
  • CP_LATCH_COUNT_DOWN — decrement a countdown latch
  • CP_LATCH_AWAIT — wait for a countdown latch to reach zero
  • CP_LATCH_GET_COUNT — read current latch count

Message Format:

  • mapName — primitive name (lock name, semaphore name, etc.)
  • key — operation parameter (session ID for semaphore, value for atomic set)
  • value — additional parameter (permit count for semaphore)
Since:
1.0
  • Constructor Details

    • ConsistencySubsystemHandler

      public ConsistencySubsystemHandler(ConsistencySubsystem consistencySubsystem, int instanceNumber)
      Create a Consistency Subsystem handler.
      Parameters:
      consistencySubsystem - the Consistency subsystem instance
      instanceNumber - the node instance number (for logging)
  • Method Details

    • handle

      public @Nullable Message handle(Message msg)
      Handle a Consistency operation message.
      Parameters:
      msg - the incoming message
      Returns:
      a response message with the operation result