DATA
- The type of the datagram to be operated with.CON
- The type of the connection to be used.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
, ObservableConnectionReceiver.ObservableConnectionRequestReceiver<DATA,CON>
, org.refcodes.io.BlockProvider<DATA>
, org.refcodes.io.BlockReceiver<DATA>
, org.refcodes.io.ConnectionReceiver<DATA,CON>
, org.refcodes.io.DatagramProvider<DATA>
, org.refcodes.io.DatagramReceiver<DATA>
, org.refcodes.io.Provider<DATA>
, org.refcodes.io.Receivable
, org.refcodes.io.Receiver<DATA>
, org.refcodes.mixin.Loggable
, org.refcodes.mixin.Releaseable
, 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
ObservableConnectionRequestReceiverImpl
implements the
ObservableConnectionReceiver
for wrapping and extending a
ConnectionReceiver
with observable functionality.
TODO: Test cases are to be created!
org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
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>>
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>>
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
Constructor | Description |
---|---|
ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver) |
Constructs a
ObservableConnectionRequestReceiverImpl with the
given attributes. |
ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver,
Object aSource) |
Constructs a
ObservableConnectionRequestReceiverImpl with the
given attributes. |
ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver,
Object aSource,
ExecutorService aExecutorService,
org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) |
Constructs a
ObservableConnectionRequestReceiverImpl with the
given attributes. |
ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver,
ExecutorService aExecutorService,
org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) |
Constructs a
ObservableConnectionRequestReceiverImpl with the
given attributes. |
ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver,
org.refcodes.observer.EventMetaData aEventMetaData) |
Constructs a
ObservableConnectionRequestReceiverImpl with the
given attributes. |
ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver,
org.refcodes.observer.EventMetaData aEventMetaData,
Object aSource) |
Constructs a
ObservableConnectionRequestReceiverImpl with the
given attributes. |
ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver,
org.refcodes.observer.EventMetaData aEventMetaData,
Object aSource,
ExecutorService aExecutorService,
org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) |
Constructs a
ObservableConnectionRequestReceiverImpl with the
given attributes. |
ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver,
org.refcodes.observer.EventMetaData aEventMetaData,
ExecutorService aExecutorService,
org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) |
Constructs a
ObservableConnectionRequestReceiverImpl with the
given attributes. |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
void |
destroy() |
|
org.refcodes.component.ConnectionStatus |
getConnectionStatus() |
|
boolean |
hasDatagram() |
|
boolean |
hasObserverSubscription(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver) |
|
boolean |
isClosable() |
|
boolean |
isClosed() |
|
boolean |
isOpenable(CON aConnection) |
|
boolean |
isOpened() |
|
void |
open(CON aConnection) |
|
DATA |
readDatagram() |
|
void |
releaseAll() |
|
boolean |
subscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver) |
|
boolean |
unsubscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver) |
closeIn, closeQuietly, closeUnchecked
alert, alert, critical, critical, debug, error, info, notice, panic, trace, warn, warn
public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver)
ObservableConnectionRequestReceiverImpl
with the
given attributes.aConnectionReceiver
- The ConnectionReceiver
to which the
connection method calls are to be delegated to.public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver, Object aSource)
ObservableConnectionRequestReceiverImpl
with the
given attributes.aConnectionReceiver
- The ConnectionReceiver
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.public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver, org.refcodes.observer.EventMetaData aEventMetaData)
ObservableConnectionRequestReceiverImpl
with the
given attributes.aConnectionReceiver
- The ConnectionReceiver
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
.public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver, org.refcodes.observer.EventMetaData aEventMetaData, Object aSource)
ObservableConnectionRequestReceiverImpl
with the
given attributes.aConnectionReceiver
- The ConnectionReceiver
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.public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
ObservableConnectionRequestReceiverImpl
with the
given attributes.aConnectionReceiver
- The ConnectionReceiver
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).public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
ObservableConnectionRequestReceiverImpl
with the
given attributes.aConnectionReceiver
- The ConnectionReceiver
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).public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver, org.refcodes.observer.EventMetaData aEventMetaData, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
ObservableConnectionRequestReceiverImpl
with the
given attributes.aConnectionReceiver
- The ConnectionReceiver
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).public ObservableConnectionRequestReceiverImpl(org.refcodes.io.ConnectionReceiver<DATA,CON> aConnectionReceiver, org.refcodes.observer.EventMetaData aEventMetaData, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
ObservableConnectionRequestReceiverImpl
with the
given attributes.aConnectionReceiver
- The ConnectionReceiver
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).public boolean isClosed()
isClosed
in interface org.refcodes.component.ClosedAccessor
public boolean isOpened()
isOpened
in interface org.refcodes.component.OpenedAccessor
public org.refcodes.component.ConnectionStatus getConnectionStatus()
getConnectionStatus
in interface org.refcodes.component.ConnectionStatusAccessor
public void releaseAll()
releaseAll
in interface org.refcodes.mixin.Releaseable
public void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
org.refcodes.component.CloseException
public void open(CON aConnection) throws org.refcodes.component.OpenException
open
in interface org.refcodes.component.ConnectionOpenable<DATA extends Serializable>
org.refcodes.component.OpenException
public DATA readDatagram() throws org.refcodes.component.OpenException, InterruptedException
readDatagram
in interface org.refcodes.io.DatagramProvider<DATA extends Serializable>
org.refcodes.component.OpenException
InterruptedException
public boolean isClosable()
isClosable
in interface org.refcodes.component.Closable.CloseAutomaton
public boolean isOpenable(CON aConnection)
isOpenable
in interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<DATA extends Serializable>
public boolean hasDatagram() throws org.refcodes.component.OpenException
hasDatagram
in interface org.refcodes.io.Receivable
org.refcodes.component.OpenException
public boolean hasObserverSubscription(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)
hasObserverSubscription
in interface org.refcodes.observer.Observable<DATA extends Serializable>
public boolean subscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)
subscribeObserver
in interface org.refcodes.observer.Observable<DATA extends Serializable>
public boolean unsubscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)
unsubscribeObserver
in interface org.refcodes.observer.Observable<DATA extends Serializable>
public void destroy()
destroy
in interface org.refcodes.component.Destroyable
Copyright © 2018. All rights reserved.