Module org.refcodes.io.ext.observer
Package org.refcodes.io.ext.observer
Class ObservableConnectionTransmitterImpl<DATA extends Serializable,CON>
java.lang.Object
org.refcodes.io.ext.observer.ObservableConnectionTransmitterImpl<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:
Flushable
,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.Flushable
,org.refcodes.component.OpenedAccessor
,org.refcodes.io.ConnectionDatagramsTransmitter<DATA,
,CON> org.refcodes.io.DatagramSource<DATA>
,org.refcodes.io.DatagramsSource<DATA>
,org.refcodes.io.DatagramsTransmitter<DATA>
,org.refcodes.io.DatagramTransmitter<DATA>
,ObservableConnectionTransmitter<DATA,
,CON> org.refcodes.io.Transmittable
,org.refcodes.mixin.Loggable
,org.refcodes.observer.Observable<org.refcodes.component.ext.observer.ConnectionObserver>
public class ObservableConnectionTransmitterImpl<DATA extends Serializable,CON>
extends Object
implements ObservableConnectionTransmitter<DATA,CON>, org.refcodes.mixin.Loggable
The
ObservableConnectionTransmitterImpl
implements the
ObservableConnectionTransmitter
for wrapping and extending a
ConnectionDatagramsTransmitter
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.Flushable
org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
Nested classes/interfaces inherited from interface org.refcodes.io.ext.observer.ObservableConnectionTransmitter
ObservableConnectionTransmitter.ObservableConnectionRequestTransmitter<DATA extends Serializable,
CON> 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
ConstructorDescriptionObservableConnectionTransmitterImpl
(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender) Constructs aObservableConnectionTransmitterImpl
with the given attributes.ObservableConnectionTransmitterImpl
(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, Object aSource) Constructs aObservableConnectionTransmitterImpl
with the given attributes.ObservableConnectionTransmitterImpl
(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) Constructs aObservableConnectionTransmitterImpl
with the given attributes.ObservableConnectionTransmitterImpl
(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) Constructs aObservableConnectionTransmitterImpl
with the given attributes.ObservableConnectionTransmitterImpl
(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, org.refcodes.mixin.EventMetaData aEventMetaData) Constructs aObservableConnectionTransmitterImpl
with the given attributes.ObservableConnectionTransmitterImpl
(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, org.refcodes.mixin.EventMetaData aEventMetaData, Object aSource) Constructs aObservableConnectionTransmitterImpl
with the given attributes.ObservableConnectionTransmitterImpl
(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, org.refcodes.mixin.EventMetaData aEventMetaData, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) Constructs aObservableConnectionTransmitterImpl
with the given attributes.ObservableConnectionTransmitterImpl
(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, org.refcodes.mixin.EventMetaData aEventMetaData, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) Constructs aObservableConnectionTransmitterImpl
with the given attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
destroy()
void
flush()
org.refcodes.component.ConnectionStatus
boolean
hasObserverSubscription
(org.refcodes.component.ext.observer.ConnectionObserver aObserver) boolean
boolean
isClosed()
boolean
isOpenable
(CON aConnection) boolean
isOpened()
void
boolean
subscribeObserver
(org.refcodes.component.ext.observer.ConnectionObserver aObserver) void
boolean
unsubscribeObserver
(org.refcodes.component.ext.observer.ConnectionObserver 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.component.Closable
closeIn, closeQuietly, closeUnchecked
Methods inherited from interface org.refcodes.component.ConnectionOpenable
openUnchecked
Methods inherited from interface org.refcodes.io.DatagramsSource
transmitAll
Methods inherited from interface org.refcodes.io.DatagramsTransmitter
transmit
Methods inherited from interface org.refcodes.component.Flushable
flushUnchecked, isFlushable
Methods inherited from interface org.refcodes.mixin.Loggable
alert, alert, critical, critical, debug, error, info, notice, panic, trace, warn, warn
-
Constructor Details
-
ObservableConnectionTransmitterImpl
public ObservableConnectionTransmitterImpl(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender) Constructs aObservableConnectionTransmitterImpl
with the given attributes.- Parameters:
aConnectionSender
- TheConnectionDatagramsTransmitter
to which the connection method calls are to be delegated to.
-
ObservableConnectionTransmitterImpl
public ObservableConnectionTransmitterImpl(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, Object aSource) Constructs aObservableConnectionTransmitterImpl
with the given attributes.- Parameters:
aConnectionSender
- TheConnectionDatagramsTransmitter
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.
-
ObservableConnectionTransmitterImpl
public ObservableConnectionTransmitterImpl(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, org.refcodes.mixin.EventMetaData aEventMetaData) Constructs aObservableConnectionTransmitterImpl
with the given attributes.- Parameters:
aConnectionSender
- TheConnectionDatagramsTransmitter
to which the connection method calls are to be delegated to.aEventMetaData
- TheEventMetaData
to be used when firing events in case theEventMetaData
is to be different from the auto-generatedEventMetaData
.
-
ObservableConnectionTransmitterImpl
public ObservableConnectionTransmitterImpl(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, org.refcodes.mixin.EventMetaData aEventMetaData, Object aSource) Constructs aObservableConnectionTransmitterImpl
with the given attributes.- Parameters:
aConnectionSender
- TheConnectionDatagramsTransmitter
to which the connection method calls are to be delegated to.aEventMetaData
- TheEventMetaData
to be used when firing events in case theEventMetaData
is to be different from the auto-generatedEventMetaData
.aSource
- The source instance to be used when firing events in case the source is to be different from this class' instance.
-
ObservableConnectionTransmitterImpl
public ObservableConnectionTransmitterImpl(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) Constructs aObservableConnectionTransmitterImpl
with the given attributes.- Parameters:
aConnectionSender
- TheConnectionDatagramsTransmitter
to which the connection method calls are to be delegated to.aExecutorService
- The executor service to be used when firingGenericActionEvent
instances in multiple threads (if null then a default one is used).aExecutionStrategy
- TheExecutionStrategy
to be used when firingGenericActionEvent
instance (if null then the defaultExecutionStrategy.SEQUENTIAL
is used).
-
ObservableConnectionTransmitterImpl
public ObservableConnectionTransmitterImpl(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) Constructs aObservableConnectionTransmitterImpl
with the given attributes.- Parameters:
aConnectionSender
- TheConnectionDatagramsTransmitter
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 firingGenericActionEvent
instances in multiple threads (if null then a default one is used).aExecutionStrategy
- TheExecutionStrategy
to be used when firingGenericActionEvent
instance (if null then the defaultExecutionStrategy.SEQUENTIAL
is used).
-
ObservableConnectionTransmitterImpl
public ObservableConnectionTransmitterImpl(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, org.refcodes.mixin.EventMetaData aEventMetaData, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) Constructs aObservableConnectionTransmitterImpl
with the given attributes.- Parameters:
aConnectionSender
- TheConnectionDatagramsTransmitter
to which the connection method calls are to be delegated to.aEventMetaData
- TheEventMetaData
to be used when firing events in case theEventMetaData
is to be different from the auto-generatedEventMetaData
.aExecutorService
- The executor service to be used when firingGenericActionEvent
instances in multiple threads (if null then a default one is used).aExecutionStrategy
- TheExecutionStrategy
to be used when firingGenericActionEvent
instance (if null then the defaultExecutionStrategy.SEQUENTIAL
is used).
-
ObservableConnectionTransmitterImpl
public ObservableConnectionTransmitterImpl(org.refcodes.io.ConnectionDatagramsTransmitter<DATA, CON> aConnectionSender, org.refcodes.mixin.EventMetaData aEventMetaData, Object aSource, ExecutorService aExecutorService, org.refcodes.controlflow.ExecutionStrategy aExecutionStrategy) Constructs aObservableConnectionTransmitterImpl
with the given attributes.- Parameters:
aConnectionSender
- TheConnectionDatagramsTransmitter
to which the connection method calls are to be delegated to.aEventMetaData
- TheEventMetaData
to be used when firing events in case theEventMetaData
is to be different from the auto-generatedEventMetaData
.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 firingGenericActionEvent
instances in multiple threads (if null then a default one is used).aExecutionStrategy
- TheExecutionStrategy
to be used when firingGenericActionEvent
instance (if null then the defaultExecutionStrategy.SEQUENTIAL
is used).
-
-
Method Details
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceorg.refcodes.component.ClosedAccessor
-
isOpened
public boolean isOpened()- Specified by:
isOpened
in interfaceorg.refcodes.component.ConnectionStatusAccessor
- Specified by:
isOpened
in interfaceorg.refcodes.component.OpenedAccessor
-
getConnectionStatus
public org.refcodes.component.ConnectionStatus getConnectionStatus()- Specified by:
getConnectionStatus
in interfaceorg.refcodes.component.ConnectionStatusAccessor
-
flush
- Specified by:
flush
in interfaceorg.refcodes.io.DatagramTransmitter<DATA extends Serializable>
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in interfaceorg.refcodes.component.Flushable
- Throws:
IOException
-
close
- Specified by:
close
in interfaceorg.refcodes.component.Closable
- Throws:
IOException
-
open
- Specified by:
open
in interfaceorg.refcodes.component.ConnectionOpenable<DATA extends Serializable>
- Throws:
IOException
-
transmit
- Specified by:
transmit
in interfaceorg.refcodes.io.DatagramSource<DATA extends Serializable>
- Specified by:
transmit
in interfaceorg.refcodes.io.DatagramsSource<DATA extends Serializable>
- Throws:
IOException
-
isClosable
public boolean isClosable()- Specified by:
isClosable
in interfaceorg.refcodes.component.Closable.CloseAutomaton
-
isOpenable
- Specified by:
isOpenable
in interfaceorg.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<DATA extends Serializable>
-
hasObserverSubscription
public boolean hasObserverSubscription(org.refcodes.component.ext.observer.ConnectionObserver aObserver) - Specified by:
hasObserverSubscription
in interfaceorg.refcodes.observer.Observable<DATA extends Serializable>
-
subscribeObserver
public boolean subscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver aObserver) - Specified by:
subscribeObserver
in interfaceorg.refcodes.observer.Observable<DATA extends Serializable>
-
unsubscribeObserver
public boolean unsubscribeObserver(org.refcodes.component.ext.observer.ConnectionObserver aObserver) - Specified by:
unsubscribeObserver
in interfaceorg.refcodes.observer.Observable<DATA extends Serializable>
-
destroy
public void destroy()- Specified by:
destroy
in interfaceorg.refcodes.component.Destroyable
-