Class Process

java.lang.Object
utils.communication.groupConstitution.Process
All Implemented Interfaces:
ProcessInterface, Closeable, AutoCloseable, AsynchronousChannel, Channel
Direct Known Subclasses:
ProcessStatus

public class Process extends Object implements ProcessInterface
  • Constructor Details

  • Method Details

    • isOther

      public boolean isOther()
      Description copied from interface: ProcessInterface
      Whether this GroupMember represents another process or ourselves.
      Specified by:
      isOther in interface ProcessInterface
      Returns:
      True if it is not the calling process, false otherwise
    • isFaulty

      public boolean isFaulty()
      Description copied from interface: ProcessInterface
      Whether this GroupMember is known/suspected faulty or not.
      Specified by:
      isFaulty in interface ProcessInterface
      Returns:
      True if at least suspected faulty, false otherwise
    • markAsFaulty

      public void markAsFaulty()
      Description copied from interface: ProcessInterface
      Mark a process as being faulty
      Specified by:
      markAsFaulty in interface ProcessInterface
    • markAsFaulty

      public void markAsFaulty(boolean isFaulty)
      Description copied from interface: ProcessInterface
      Change a process's faultiness.
      Specified by:
      markAsFaulty in interface ProcessInterface
      Parameters:
      isFaulty - Whether the process is faulty or not.
    • connect

      public <A> void connect(SocketAddress remote, A attachment, CompletionHandler<Void,? super A> handler)
      Description copied from interface: ProcessInterface
      Asynchronous connect.
      Specified by:
      connect in interface ProcessInterface
      Type Parameters:
      A - Type of attachment
      Parameters:
      remote - Address of the remote entity to connect to.
      attachment - The object to attach to the I/O operation
      handler - The handler for consuming the result
    • safeWrite

      public <A> void safeWrite(ByteBuffer bf, A attachment, CompletionHandler<Integer,? super A> handler)
      Description copied from interface: ProcessInterface
      Asynchronous thread-safe write method. Guarantees no WritePendingException occurs. Does nothing in the case that isOther is false.
      Specified by:
      safeWrite in interface ProcessInterface
      Type Parameters:
      A - Type of attachment
      Parameters:
      bf - The buffer from which bytes are to be transferred
      attachment - The object to attach to the I/O operation
      handler - The handler for consuming the result
    • safeWrite

      public void safeWrite(ByteBuffer bf)
      Description copied from interface: ProcessInterface
      Blocking thread-safe write method. Guarantees no WritePendingException occurs. Does nothing in the case that isOther is false.
      Specified by:
      safeWrite in interface ProcessInterface
      Parameters:
      bf - The buffer from which bytes are to be transferred
    • safeRead

      public <A> void safeRead(ByteBuffer bf, A attachment, CompletionHandler<Integer,? super A> handler)
      Description copied from interface: ProcessInterface
      Asynchronous thread-safe read method. Does nothing in the case that isOther is false.
      Specified by:
      safeRead in interface ProcessInterface
      Type Parameters:
      A - Type of attachment
      Parameters:
      bf - The buffer to which bytes are to be transferred
      attachment - The object to attach to the I/O operation
      handler - The handler for consuming the result
    • close

      public void close() throws IOException
      Specified by:
      close in interface AsynchronousChannel
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Channel
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface Channel
    • isReadable

      public boolean isReadable()
      Description copied from interface: ProcessInterface
      Whether a read operation can be completed successfully.
      Specified by:
      isReadable in interface ProcessInterface
      Returns:
      True is a read operation can be completed, false otherwise.
    • isWriteable

      public boolean isWriteable()
      Description copied from interface: ProcessInterface
      Whether a write operation can be completed successfully.
      Specified by:
      isWriteable in interface ProcessInterface
      Returns:
      True is a write operation can be completed, false otherwise.
    • getRemoteAddress

      public InetSocketAddress getRemoteAddress()
      Specified by:
      getRemoteAddress in interface ProcessInterface
    • shallowClone

      public Process shallowClone()