Class CLIENT

java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.raft.CLIENT
All Implemented Interfaces:
Runnable, org.jgroups.Lifecycle

public class CLIENT extends org.jgroups.stack.Protocol implements Runnable
Protocol listening on a socket for client requests. Dispatches them to the leader (via REDIRECT) and sends back the response. Requests and responses are always sent as
     | RequestType (byte) | request-id (int) | length (int) | byte[] buffer |
 
Since:
0.2
Author:
Bela Ban
  • Field Details

    • CLIENT_ID

      protected static final short CLIENT_ID
      See Also:
    • BUF

      protected static final byte[] BUF
    • bind_addr

      protected InetAddress bind_addr
    • port

      protected int port
    • min_threads

      protected int min_threads
    • max_threads

      protected int max_threads
    • idle_time

      protected long idle_time
    • recv_buf_size

      protected int recv_buf_size
    • settable

      protected Settable settable
    • dyn_membership

      protected DynamicMembership dyn_membership
    • sock

      protected ServerSocket sock
    • thread_pool

      protected ExecutorService thread_pool
    • acceptor

      protected Thread acceptor
  • Constructor Details

    • CLIENT

      public CLIENT()
  • Method Details

    • getBindAddress

      public InetAddress getBindAddress()
    • setBindAddress

      public CLIENT setBindAddress(InetAddress b)
    • getPort

      public int getPort()
    • setPort

      public CLIENT setPort(int p)
    • getMinThreads

      public int getMinThreads()
    • setMinThreads

      public CLIENT setMinThreads(int t)
    • getMaxThreads

      public int getMaxThreads()
    • setMaxThreads

      public CLIENT setMaxThreads(int t)
    • getIdleTime

      public long getIdleTime()
    • setIdleTime

      public CLIENT setIdleTime(long t)
    • getReceiveBufferSize

      public int getReceiveBufferSize()
    • setReceiveBufferSize

      public CLIENT setReceiveBufferSize(int s)
    • init

      public void init() throws Exception
      Specified by:
      init in interface org.jgroups.Lifecycle
      Overrides:
      init in class org.jgroups.stack.Protocol
      Throws:
      Exception
    • start

      public void start() throws Exception
      Specified by:
      start in interface org.jgroups.Lifecycle
      Overrides:
      start in class org.jgroups.stack.Protocol
      Throws:
      Exception
    • stop

      public void stop()
      Specified by:
      stop in interface org.jgroups.Lifecycle
      Overrides:
      stop in class org.jgroups.stack.Protocol
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.jgroups.Lifecycle
      Overrides:
      destroy in class org.jgroups.stack.Protocol
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • up

      public void up(org.jgroups.util.MessageBatch batch)
      Overrides:
      up in class org.jgroups.stack.Protocol