- java.lang.Object
-
- org.refcodes.component.ConnectionAutomatonImpl<PM>
-
- org.refcodes.serial.AbstractPort<PortMetrics>
-
- org.refcodes.serial.LoopbackPort
-
- org.refcodes.serial.CrossoverLoopbackPort
-
- All Implemented Interfaces:
Flushable
,Comparable<Port<?>>
,org.refcodes.component.Closable
,org.refcodes.component.Closable.CloseAutomaton
,org.refcodes.component.ClosedAccessor
,org.refcodes.component.ConnectableComponent
,org.refcodes.component.ConnectableComponent.ConnectableAutomaton
,org.refcodes.component.ConnectionComponent<PortMetrics>
,org.refcodes.component.ConnectionComponent.ConnectionAutomaton<PortMetrics>
,org.refcodes.component.ConnectionOpenable<PortMetrics>
,org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<PortMetrics>
,org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<PortMetrics,Port<PortMetrics>>
,org.refcodes.component.ConnectionStatusAccessor
,org.refcodes.component.Flushable
,org.refcodes.component.LinkComponent
,org.refcodes.component.LinkComponent.LinkAutomaton
,org.refcodes.component.Openable
,org.refcodes.component.Openable.OpenAutomaton
,org.refcodes.component.Openable.OpenBuilder<Port<PortMetrics>>
,org.refcodes.component.OpenedAccessor
,org.refcodes.io.Availability
,org.refcodes.io.ByteDestination
,org.refcodes.io.ByteReceiver
,org.refcodes.io.BytesDestination
,org.refcodes.io.ByteSource
,org.refcodes.io.BytesReceiver
,org.refcodes.io.BytesSource
,org.refcodes.io.BytesTransceiver
,org.refcodes.io.BytesTransmitter
,org.refcodes.io.ByteTransceiver
,org.refcodes.io.ByteTransmitter
,org.refcodes.io.Receivable
,org.refcodes.io.Skippable
,org.refcodes.io.TimeoutInputStreamAccessor
,org.refcodes.io.Transmittable
,org.refcodes.mixin.AliasAccessor
,org.refcodes.mixin.InputStreamAccessor
,org.refcodes.mixin.OutputStreamAccessor
,Port<PortMetrics>
,PortMetricsAccessor<PortMetrics>
,SegmentDestination
,SegmentReceiver
,SegmentSource
,SegmentTransceiver
,SegmentTransmitter
,SerialReceiver
,SerialTransceiver
,SerialTransmitter
public class CrossoverLoopbackPort extends LoopbackPort
TheCrossoverLoopbackPort
is an in-memory implementation of aPort
which loops its output directly to the "connected"LoopbackPort
counterpart ("other end of the wire"). This is suitable for cases using a some kind of frequent handshake between a transmitter and a receiver on the same line where we have to simulate a bidirectional in-memory communication between two ports.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor
org.refcodes.mixin.AliasAccessor.AliasBuilder<B extends org.refcodes.mixin.AliasAccessor.AliasBuilder<B>>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty
-
Nested classes/interfaces inherited from interface org.refcodes.io.BytesReceiver
org.refcodes.io.BytesReceiver.ReceiverInputStream
-
Nested classes/interfaces inherited from interface org.refcodes.io.BytesTransmitter
org.refcodes.io.BytesTransmitter.TransmitterOutputStream
-
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.Flushable
org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.InputStreamAccessor
org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<B extends org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<?>>, org.refcodes.mixin.InputStreamAccessor.InputStreamMutator, org.refcodes.mixin.InputStreamAccessor.InputStreamProperty
-
Nested classes/interfaces inherited from interface org.refcodes.component.LinkComponent
org.refcodes.component.LinkComponent.LinkAutomaton, org.refcodes.component.LinkComponent.LinkComponentBuilder<B extends org.refcodes.component.LinkComponent.LinkComponentBuilder<B>>
-
Nested classes/interfaces inherited from interface org.refcodes.component.Openable
org.refcodes.component.Openable.OpenAutomaton, org.refcodes.component.Openable.OpenBuilder<B extends org.refcodes.component.Openable.OpenBuilder<B>>
-
Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor
org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.OutputStreamAccessor
org.refcodes.mixin.OutputStreamAccessor.OutputStreamBuilder<B extends org.refcodes.mixin.OutputStreamAccessor.OutputStreamBuilder<?>>, org.refcodes.mixin.OutputStreamAccessor.OutputStreamMutator, org.refcodes.mixin.OutputStreamAccessor.OutputStreamProperty
-
Nested classes/interfaces inherited from interface org.refcodes.serial.PortMetricsAccessor
PortMetricsAccessor.PortMetricsBuilder<PM extends PortMetrics,B extends PortMetricsAccessor.PortMetricsBuilder<PM,B>>, PortMetricsAccessor.PortMetricsMutator<PM extends PortMetrics>, PortMetricsAccessor.PortMetricsProperty<PM extends PortMetrics>
-
Nested classes/interfaces inherited from interface org.refcodes.io.TimeoutInputStreamAccessor
org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<B extends org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamBuilder<?>>, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamMutator, org.refcodes.io.TimeoutInputStreamAccessor.TimeoutInputStreamProperty
-
-
Field Summary
-
Fields inherited from class org.refcodes.serial.LoopbackPort
_crossoverPort, _transmitSequence
-
Fields inherited from class org.refcodes.serial.AbstractPort
_alias, _executorService, _portMetrics
-
-
Constructor Summary
Constructors Constructor Description CrossoverLoopbackPort(String aAlias, LoopbackPort aCounterpartPort)
Constructs aCrossoverLoopbackPort
.CrossoverLoopbackPort(String aAlias, LoopbackPort aCounterpartPort, ExecutorService aExecutorService)
Constructs aCrossoverLoopbackPort
.CrossoverLoopbackPort(LoopbackPort aCounterpartPort)
Constructs aCrossoverLoopbackPort
.CrossoverLoopbackPort(LoopbackPort aCounterpartPort, ExecutorService aExecutorService)
Constructs aCrossoverLoopbackPort
.
-
Method Summary
-
Methods inherited from class org.refcodes.serial.LoopbackPort
available, close, getAlias, getPortMetrics, open, receiveBytes, setCrossoverPort, toString, transmitSequence, withOpen, withOpen, withOpenUnchecked, withOpenUnchecked
-
Methods inherited from class org.refcodes.serial.AbstractPort
doTransmitSegment, doTransmitSegment, isOpenable, onReceiveSegment, onReceiveSegment, open, receiveSegment
-
Methods inherited from class org.refcodes.component.ConnectionAutomatonImpl
getConnectionStatus, isClosable, isClosed, isOpenable, isOpened
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.refcodes.io.BytesReceiver
getInputStream, getInputStream, receiveAllBytes, receiveBytesWithin, receiveBytesWithin, receiveByteWithin, skip
-
Methods inherited from interface org.refcodes.component.Closable
closeIn, closeQuietly, closeUnchecked
-
Methods inherited from interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton
isOpenable
-
Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor
getConnectionStatus, isOpened
-
Methods inherited from interface org.refcodes.serial.SegmentReceiver
onReceiveSegment, onReceiveSegment
-
Methods inherited from interface org.refcodes.serial.SegmentTransmitter
doTransmitSegment, doTransmitSegment, flush
-
Methods inherited from interface org.refcodes.serial.SerialReceiver
receiveByte, receiveBytes, receiveSegmentWithin, receiveSequence, receiveSequenceWithin
-
Methods inherited from interface org.refcodes.serial.SerialTransceiver
receiveSegment, transmitSegment
-
Methods inherited from interface org.refcodes.serial.SerialTransmitter
flush, transmitAllBytes, transmitBytes, transmitSequence
-
-
-
-
Constructor Detail
-
CrossoverLoopbackPort
public CrossoverLoopbackPort(LoopbackPort aCounterpartPort)
Constructs aCrossoverLoopbackPort
.- Parameters:
aCounterpartPort
- The port's counterpart (other end of the line).
-
CrossoverLoopbackPort
public CrossoverLoopbackPort(String aAlias, LoopbackPort aCounterpartPort)
Constructs aCrossoverLoopbackPort
.- Parameters:
aAlias
- The alias to use for this port.aCounterpartPort
- The port's counterpart (other end of the line).
-
CrossoverLoopbackPort
public CrossoverLoopbackPort(LoopbackPort aCounterpartPort, ExecutorService aExecutorService)
Constructs aCrossoverLoopbackPort
.- Parameters:
aCounterpartPort
- The port's counterpart (other end of the line).aExecutorService
- TheExecutorService
to be used when invoking asynchronously working methods.
-
CrossoverLoopbackPort
public CrossoverLoopbackPort(String aAlias, LoopbackPort aCounterpartPort, ExecutorService aExecutorService)
Constructs aCrossoverLoopbackPort
.- Parameters:
aAlias
- The alias to use for this port.aCounterpartPort
- The port's counterpart (other end of the line).aExecutorService
- TheExecutorService
to be used when invoking asynchronously working methods.
-
-