DATA
- The type of the datagram to be operated with.INPUT
- the generic typeOUTPUT
- the generic typepublic class ObservableBidirectionalRequestTransceiverImpl<DATA extends Serializable,INPUT,OUTPUT> extends Object implements ObservableBidirectionalTransceiver.ObservableBidirectionalRequestTransceiver<DATA,INPUT,OUTPUT>
ObservableBidirectionalRequestTransceiverImpl
implements the
ObservableBidirectionalTransceiver
for wrapping and extending a
BidirectionalConnectionTransceiver
with observable functionality.
TODO: Test cases are to be created!
org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
org.refcodes.component.ConnectableComponent.ConnectableAutomaton
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
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.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
org.refcodes.component.BidirectionalConnectionComponent.BidirectionalConnectionAutomaton<INPUT,OUTPUT>
Modifier and Type | Field and Description |
---|---|
protected static org.refcodes.logger.RuntimeLogger |
LOGGER |
Constructor and Description |
---|
ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver)
Constructs a
ObservableBidirectionalRequestTransceiverImpl with
the given attributes. |
ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver,
org.refcodes.observer.EventMetaData aEventMetaData)
Constructs a
ObservableBidirectionalRequestTransceiverImpl with
the given attributes. |
ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver,
org.refcodes.observer.EventMetaData aEventMetaData,
ExecutorService aExecutorService,
org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
Constructs a
ObservableBidirectionalRequestTransceiverImpl with
the given attributes. |
ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver,
org.refcodes.observer.EventMetaData aEventMetaData,
Object aSource)
Constructs a
ObservableBidirectionalRequestTransceiverImpl with
the given attributes. |
ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver,
org.refcodes.observer.EventMetaData aEventMetaData,
Object aSource,
ExecutorService aExecutorService,
org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
Constructs a
ObservableBidirectionalRequestTransceiverImpl with
the given attributes. |
ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver,
ExecutorService aExecutorService,
org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
Constructs a
ObservableBidirectionalRequestTransceiverImpl with
the given attributes. |
ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver,
Object aSource)
Constructs a
ObservableBidirectionalRequestTransceiverImpl with
the given attributes. |
ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver,
Object aSource,
ExecutorService aExecutorService,
org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
Constructs a
ObservableBidirectionalRequestTransceiverImpl with
the given attributes. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
destroy() |
void |
flush() |
org.refcodes.component.ConnectionStatus |
getConnectionStatus() |
boolean |
hasDatagram() |
boolean |
hasObserverSubscription(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver) |
boolean |
isClosable() |
boolean |
isClosed() |
boolean |
isOpenable(INPUT aInputConnection,
OUTPUT aOutputConnection) |
boolean |
isOpened() |
void |
open(INPUT aInputConnection,
OUTPUT aOutputConnection) |
DATA |
readDatagram() |
void |
releaseAll() |
boolean |
subscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver) |
boolean |
unsubscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver) |
void |
writeDatagram(DATA aDatagram) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver)
ObservableBidirectionalRequestTransceiverImpl
with
the given attributes.aInputOutputTransceiver
- The
BidirectionalConnectionTransceiver
to which the connection
method calls are to be delegated to.public ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver, Object aSource)
ObservableBidirectionalRequestTransceiverImpl
with
the given attributes.aInputOutputTransceiver
- The
BidirectionalConnectionTransceiver
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 ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver, org.refcodes.observer.EventMetaData aEventMetaData)
ObservableBidirectionalRequestTransceiverImpl
with
the given attributes.aInputOutputTransceiver
- The
BidirectionalConnectionTransceiver
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 ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver, org.refcodes.observer.EventMetaData aEventMetaData, Object aSource)
ObservableBidirectionalRequestTransceiverImpl
with
the given attributes.aInputOutputTransceiver
- The
BidirectionalConnectionTransceiver
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 ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
ObservableBidirectionalRequestTransceiverImpl
with
the given attributes.aInputOutputTransceiver
- The
BidirectionalConnectionTransceiver
to which the connection
method calls are to be delegated to.aExecutorService
- The executor service to be used when firing
ActionEvent
instances in multiple threads (if null then a
default one is used).aExecutionStrategy
- The ExecutionStrategy
to be used when
firing ActionEvent
instance (if null then the default
ExecutionStrategy.SEQUENTIAL
is used).public ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
ObservableBidirectionalRequestTransceiverImpl
with
the given attributes.aInputOutputTransceiver
- The
BidirectionalConnectionTransceiver
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
ActionEvent
instances in multiple threads (if null then a
default one is used).aExecutionStrategy
- The ExecutionStrategy
to be used when
firing ActionEvent
instance (if null then the default
ExecutionStrategy.SEQUENTIAL
is used).public ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver, org.refcodes.observer.EventMetaData aEventMetaData, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
ObservableBidirectionalRequestTransceiverImpl
with
the given attributes.aInputOutputTransceiver
- The
BidirectionalConnectionTransceiver
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
ActionEvent
instances in multiple threads (if null then a
default one is used).aExecutionStrategy
- The ExecutionStrategy
to be used when
firing ActionEvent
instance (if null then the default
ExecutionStrategy.SEQUENTIAL
is used).public ObservableBidirectionalRequestTransceiverImpl(org.refcodes.io.BidirectionalConnectionTransceiver<DATA,INPUT,OUTPUT> aInputOutputTransceiver, org.refcodes.observer.EventMetaData aEventMetaData, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy)
ObservableBidirectionalRequestTransceiverImpl
with
the given attributes.aInputOutputTransceiver
- The
BidirectionalConnectionTransceiver
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
ActionEvent
instances in multiple threads (if null then a
default one is used).aExecutionStrategy
- The ExecutionStrategy
to be used when
firing ActionEvent
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 flush() throws org.refcodes.component.OpenException
flush
in interface Flushable
flush
in interface org.refcodes.io.Sender<DATA extends Serializable>
org.refcodes.component.OpenException
public void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
org.refcodes.component.CloseException
public void open(INPUT aInputConnection, OUTPUT aOutputConnection) throws 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 void writeDatagram(DATA aDatagram) throws org.refcodes.component.OpenException
writeDatagram
in interface org.refcodes.io.Consumer<DATA extends Serializable>
writeDatagram
in interface org.refcodes.io.DatagramConsumer<DATA extends Serializable>
org.refcodes.component.OpenException
public boolean isClosable()
isClosable
in interface org.refcodes.component.Closable.CloseAutomaton
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<org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver>
public boolean subscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)
subscribeObserver
in interface org.refcodes.observer.Observable<org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver>
public boolean unsubscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver aObserver)
unsubscribeObserver
in interface org.refcodes.observer.Observable<org.refcodes.component.ext.observer.ConnectionObserver.ConnectionRequestObserver>
public void destroy()
destroy
in interface org.refcodes.component.Destroyable
Copyright © 2018. All rights reserved.