Class ByteBufferIpcMessagesConsumerThread

java.lang.Object
java.lang.Thread
com._1c.g5.v8.dt.internal.pm.ipc.sync.InvalidatableThread
com._1c.g5.v8.dt.internal.pm.connection.mmf.ByteBufferIpcMessagesConsumerThread
All Implemented Interfaces:
Invalidatable, AutoCloseable, Runnable

public class ByteBufferIpcMessagesConsumerThread extends InvalidatableThread
Consumes IpcMessages from messages queue, then puts a message to provided buffer, splitting if necessarry message to packets of Buffer.remaining() size..
  • Constructor Details

    • ByteBufferIpcMessagesConsumerThread

      public ByteBufferIpcMessagesConsumerThread(BlockingQueue<IpcMessage> messagesQueue, ByteBuffer buffer, Lock bufferLock)
      Constructs new instance with given messages queue, ByteBuffer and Lock, which controls access to given buffer.
      Parameters:
      messagesQueue - given messages queue, from which messages are obtained (not null)
      buffer - given buffer, to which part(s) of message put (not null)
      bufferLock - given Lock, under which each part of message is put to given buffer (not null)
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • process

      protected void process(IpcMessage message) throws InterruptedException
      Appends size of message to the start of given message's data, splits it to parts of packet size and puts each part to packet queue.
      Parameters:
      message - given message (not null)
      Throws:
      InterruptedException