Class AbstractShortsReceiver

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  AbstractShortsReceiver.ConnectableAutomaton
      The Class ConnectableAutomaton.
      • Nested classes/interfaces inherited from interface org.refcodes.component.Closable

        org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.ClosedAccessor

        org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor

        org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor

        org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractShortsReceiver()
      Constructs a AbstractShortsReceiver with a default sized blocking queue enabling a maximum of AbstractShortsDestination.DATAGRAM_QUEUE_SIZE datagrams. ------------------------------------------------------------------------- Make sure your code fetches the datagrams quick enough to prevent filling up of the queue.
      AbstractShortsReceiver​(int aCapacity)
      Constructs a AbstractShortsReceiver with a custom sized blocking queue enabling a maximum of datagrams as specified by the capacity parameter. ------------------------------------------------------------------------- Make sure your code fetches the datagrams quick enough to prevent filling up of the queue.
    • Constructor Detail

      • AbstractShortsReceiver

        public AbstractShortsReceiver​(int aCapacity)
        Constructs a AbstractShortsReceiver with a custom sized blocking queue enabling a maximum of datagrams as specified by the capacity parameter. ------------------------------------------------------------------------- Make sure your code fetches the datagrams quick enough to prevent filling up of the queue. In case the queue is filled up, adding elements via AbstractShortsDestination.pushDatagram(short) to the queue is blocked until elements are taken from the queue via receiveShort().
        Parameters:
        aCapacity - The capacity of the queue holding the received datagrams.
    • Method Detail

      • close

        public void close()
                   throws IOException
        Specified by:
        close in interface org.refcodes.component.Closable
        Throws:
        IOException
      • isOpened

        public boolean isOpened()
        Specified by:
        isOpened in interface org.refcodes.component.ConnectionStatusAccessor
        Specified by:
        isOpened in interface org.refcodes.component.OpenedAccessor
      • isClosable

        public boolean isClosable()
        Specified by:
        isClosable in interface org.refcodes.component.Closable.CloseAutomaton
      • isClosed

        public boolean isClosed()
        Specified by:
        isClosed in interface org.refcodes.component.ClosedAccessor
      • getConnectionStatus

        public org.refcodes.component.ConnectionStatus getConnectionStatus()
        Specified by:
        getConnectionStatus in interface org.refcodes.component.ConnectionStatusAccessor
      • setConnectionStatus

        protected void setConnectionStatus​(org.refcodes.component.ConnectionStatus aConnectionStatus)
        Sets the connection status.
        Parameters:
        aConnectionStatus - the new connection status
      • isOpenable

        protected boolean isOpenable()
        Checks if is openable.
        Returns:
        true, if is openable