Class ObservableConnectionRequestReceiverImpl<DATA extends Serializable,CON>

java.lang.Object
org.refcodes.io.ext.observer.ObservableConnectionRequestReceiverImpl<DATA,CON>
Type Parameters:
DATA - The type of the datagram to be operated with.
CON - The type of the connection to be used.
All Implemented Interfaces:
org.refcodes.component.Closable, org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.ClosedAccessor, org.refcodes.component.Component, org.refcodes.component.ConnectableComponent, org.refcodes.component.ConnectableComponent.ConnectableAutomaton, org.refcodes.component.ConnectionComponent<CON>, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<CON>, org.refcodes.component.ConnectionOpenable<CON>, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<CON>, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.component.Destroyable, org.refcodes.component.OpenedAccessor, org.refcodes.io.Availability, org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON>, org.refcodes.io.DatagramDestination<DATA>, org.refcodes.io.DatagramReceiver<DATA>, org.refcodes.io.DatagramsDestination<DATA>, org.refcodes.io.DatagramsReceiver<DATA>, ObservableConnectionReceiver.ObservableConnectionRequestReceiver<DATA,CON>, org.refcodes.io.Receivable, org.refcodes.mixin.Loggable, org.refcodes.observer.Observable<org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver>

public class ObservableConnectionRequestReceiverImpl<DATA extends Serializable,CON> extends Object implements ObservableConnectionReceiver.ObservableConnectionRequestReceiver<DATA,CON>, org.refcodes.mixin.Loggable
The ObservableConnectionRequestReceiverImpl implements the ObservableConnectionReceiver for wrapping and extending a ConnectionDatagramsReceiver with observable functionality.
  • Nested Class Summary

    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.ConnectableComponent

    org.refcodes.component.ConnectableComponent.ConnectableAutomaton

    Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionComponent

    org.refcodes.component.ConnectionComponent.ConnectionAutomaton<CON extends Object>, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON extends Object,B extends org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON,B>>

    Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionOpenable

    org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<CON extends Object>, org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON extends Object,B extends org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON,B>>

    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.Destroyable

    org.refcodes.component.Destroyable.DestroyAutomaton

    Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor

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

    Fields inherited from interface org.refcodes.mixin.Loggable

    RUNTIME_LOGGER_CLASS, RUNTIME_LOGGER_FACTORY_CLASS, RUNTIME_LOGGER_FACTORY_METHOD
  • Constructor Summary

    Constructors
    Constructor
    Description
    ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver)
    Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
    ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, Object aSource)
    Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
    ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
    Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
    ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
    Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
    ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, org.refcodes.mixin.EventMetaData aEventMetaData)
    Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
    ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, org.refcodes.mixin.EventMetaData aEventMetaData, Object aSource)
    Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
    ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, org.refcodes.mixin.EventMetaData aEventMetaData, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
    Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
    ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, org.refcodes.mixin.EventMetaData aEventMetaData, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
    Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    void
    void
    org.refcodes.component.ConnectionStatus
    boolean
    hasObserverSubscription(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)
    boolean
    boolean
    boolean
    isOpenable(CON aConnection)
    boolean
    void
    open(CON aConnection)
    boolean
    subscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)
    boolean
    unsubscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.refcodes.io.Availability

    hasAvailable

    Methods inherited from interface org.refcodes.component.Closable

    closeIn, closeQuietly, closeUnchecked

    Methods inherited from interface org.refcodes.component.ConnectionOpenable

    openUnchecked

    Methods inherited from interface org.refcodes.io.DatagramsDestination

    receive

    Methods inherited from interface org.refcodes.io.DatagramsReceiver

    receive, receiveAll

    Methods inherited from interface org.refcodes.mixin.Loggable

    alert, alert, critical, critical, debug, error, info, notice, panic, trace, warn, warn
  • Constructor Details

    • ObservableConnectionRequestReceiverImpl

      public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver)
      Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
      Parameters:
      aConnectionReceiver - The ConnectionDatagramsReceiver to which the connection method calls are to be delegated to.
    • ObservableConnectionRequestReceiverImpl

      public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, Object aSource)
      Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
      Parameters:
      aConnectionReceiver - The ConnectionDatagramsReceiver to which the connection method calls are to be delegated to.
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
    • ObservableConnectionRequestReceiverImpl

      public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, org.refcodes.mixin.EventMetaData aEventMetaData)
      Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
      Parameters:
      aConnectionReceiver - The ConnectionDatagramsReceiver to which the connection method calls are to be delegated to.
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
    • ObservableConnectionRequestReceiverImpl

      public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, org.refcodes.mixin.EventMetaData aEventMetaData, Object aSource)
      Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
      Parameters:
      aConnectionReceiver - The ConnectionDatagramsReceiver to which the connection method calls are to be delegated to.
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
    • ObservableConnectionRequestReceiverImpl

      public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
      Parameters:
      aConnectionReceiver - The ConnectionDatagramsReceiver to which the connection method calls are to be delegated to.
      aExecutorService - The executor service to be used when firing GenericActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing GenericActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
    • ObservableConnectionRequestReceiverImpl

      public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
      Parameters:
      aConnectionReceiver - The ConnectionDatagramsReceiver to which the connection method calls are to be delegated to.
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
      aExecutorService - The executor service to be used when firing GenericActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing GenericActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
    • ObservableConnectionRequestReceiverImpl

      public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, org.refcodes.mixin.EventMetaData aEventMetaData, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
      Parameters:
      aConnectionReceiver - The ConnectionDatagramsReceiver to which the connection method calls are to be delegated to.
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
      aExecutorService - The executor service to be used when firing GenericActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing GenericActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
    • ObservableConnectionRequestReceiverImpl

      public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionDatagramsReceiver<DATA,CON> aConnectionReceiver, org.refcodes.mixin.EventMetaData aEventMetaData, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
      Constructs a ObservableConnectionRequestReceiverImpl with the given attributes.
      Parameters:
      aConnectionReceiver - The ConnectionDatagramsReceiver to which the connection method calls are to be delegated to.
      aEventMetaData - The EventMetaData to be used when firing events in case the EventMetaData is to be different from the auto-generated EventMetaData.
      aSource - The source instance to be used when firing events in case the source is to be different from this class' instance.
      aExecutorService - The executor service to be used when firing GenericActionEvent instances in multiple threads (if null then a default one is used).
      aExecutionStrategy - The ExecutionStrategy to be used when firing GenericActionEvent instance (if null then the default ExecutionStrategy.SEQUENTIAL is used).
  • Method Details

    • isClosed

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

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

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

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

      public void open(CON aConnection) throws IOException
      Specified by:
      open in interface org.refcodes.component.ConnectionOpenable<DATA extends Serializable>
      Throws:
      IOException
    • receive

      public DATA receive() throws IOException
      Specified by:
      receive in interface org.refcodes.io.DatagramDestination<DATA extends Serializable>
      Specified by:
      receive in interface org.refcodes.io.DatagramsDestination<DATA extends Serializable>
      Throws:
      IOException
    • isClosable

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

      public boolean isOpenable(CON aConnection)
      Specified by:
      isOpenable in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<DATA extends Serializable>
    • available

      public int available() throws IOException
      Specified by:
      available in interface org.refcodes.io.Availability
      Throws:
      IOException
    • hasObserverSubscription

      public boolean hasObserverSubscription(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)
      Specified by:
      hasObserverSubscription in interface org.refcodes.observer.Observable<DATA extends Serializable>
    • subscribeObserver

      public boolean subscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)
      Specified by:
      subscribeObserver in interface org.refcodes.observer.Observable<DATA extends Serializable>
    • unsubscribeObserver

      public boolean unsubscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)
      Specified by:
      unsubscribeObserver in interface org.refcodes.observer.Observable<DATA extends Serializable>
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.refcodes.component.Destroyable