- java.lang.Object
-
- swim.system.DownlinkView
-
- swim.system.warp.WarpDownlinkView
-
- swim.system.downlink.ValueDownlinkView<V>
-
- All Implemented Interfaces:
Downlink
,ValueDownlink<V>
,Link
,WarpDownlink
,WarpLink
,Observable<Object>
,ObservableValue<V>
,Inlet<V>
,Outlet<V>
,Log
- Direct Known Subclasses:
JoinValueLaneDownlink
public class ValueDownlinkView<V> extends WarpDownlinkView implements ValueDownlink<V>
-
-
Field Summary
Fields Modifier and Type Field Description protected Outlet<? extends V>
input
protected ValueDownlinkModel
model
protected Inlet<? super V>[]
outputs
protected static int
STATEFUL
protected Form<V>
valueForm
protected int
version
-
Fields inherited from class swim.system.warp.WarpDownlinkView
body, flags, hostUri, KEEP_LINKED, KEEP_SYNCED, laneUri, meshUri, nodeUri, prio, rate
-
Fields inherited from class swim.system.DownlinkView
cellContext, observers, stage
-
-
Constructor Summary
Constructors Constructor Description ValueDownlinkView(CellContext cellContext, Stage stage, Uri meshUri, Uri hostUri, Uri nodeUri, Uri laneUri, float prio, float rate, Value body, int flags, Form<V> valueForm, Object observers)
ValueDownlinkView(CellContext cellContext, Stage stage, Uri meshUri, Uri hostUri, Uri nodeUri, Uri laneUri, float prio, float rate, Value body, Form<V> valueForm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bindInput(Outlet<? extends V> input)
Connects thisInlet
to anOutlet
from which it will acquire its state.void
bindOutput(Inlet<? super V> output)
Adds anoutput
to the set ofInlet
s that depend on the state of thisOutlet
.ValueDownlinkView<V>
body(Value body)
void
close()
ValueDownlinkModel
createDownlinkModel()
void
decohere()
void
decohereInput()
Marks thisOutlet
—and alloutputs
that depend on the state of thisOutlet
—as having decoherent state.void
decohereOutput()
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having decoherent state.ValueDownlinkView<V>
didClose(DidClose didClose)
ValueDownlinkView<V>
didConnect(DidConnect didConnect)
protected void
didDecohere()
ValueDownlinkView<V>
didDisconnect(DidDisconnect didDisconnect)
ValueDownlinkView<V>
didFail(DidFail didFail)
ValueDownlinkView<V>
didLink(DidLink didLink)
ValueDownlinkView<V>
didReceive(DidReceive didReceive)
protected void
didRecohere(int version)
ValueDownlinkView<V>
didSet(DidSet<V> didSet)
ValueDownlinkView<V>
didSync(DidSync didSync)
ValueDownlinkView<V>
didUnlink(DidUnlink didUnlink)
void
disconnectInputs()
Disconnects allInlet
s dominated by thisInlet
in the dataflow dependency graph.void
disconnectOutputs()
Disconnects allOutlet
s dominated by thisInlet
in the dataflow graph.boolean
dispatchDidSet(V newValue, V oldValue, boolean preemptive)
Map.Entry<Boolean,V>
dispatchWillSet(V newValue, boolean preemptive)
void
downlinkDidSet(V newValue, V oldValue)
void
downlinkDidSetValue(Value newValue, Value oldValue)
ValueDownlinkModel
downlinkModel()
V
downlinkWillSet(V newValue)
Value
downlinkWillSetValue(Value newValue)
V
get()
Returns the current state of thisOutlet
.ValueDownlinkView<V>
hostUri(String hostUri)
ValueDownlinkView<V>
hostUri(Uri hostUri)
Outlet<? extends V>
input()
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.boolean
isStateful()
ValueDownlinkView<V>
isStateful(boolean isStateful)
ValueDownlinkView<V>
keepLinked(boolean keepLinked)
ValueDownlinkView<V>
keepSynced(boolean keepSynced)
ValueDownlinkView<V>
laneUri(String laneUri)
ValueDownlinkView<V>
laneUri(Uri laneUri)
ValueDownlinkView<V>
nodeUri(String nodeUri)
ValueDownlinkView<V>
nodeUri(Uri nodeUri)
ValueDownlinkView<V>
observe(Object observer)
protected void
onDecohere()
protected void
onRecohere(int version)
ValueDownlinkView<V>
open()
Iterator<Inlet<? super V>>
outputIterator()
Returns anIterator
over the set ofInlet
s that depend on the state of thisOutlet
.ValueDownlinkView<V>
prio(float prio)
ValueDownlinkView<V>
rate(float rate)
void
recohere(int version)
void
recohereInput(int version)
Updates the state of thisOutlet
to make it consistent with the targetversion
.void
recohereOutput(int version)
Updates the state of thisInlet
to make it consistent with thetarget
version.V
set(V newValue)
protected Object
typesafeObservers(Object observers)
void
unbindInput()
Disconnects thisInlet
from its inputOutlet
, if connected.void
unbindOutput(Inlet<? super V> output)
Removes anoutput
from the set ofInlet
s that depend on the state of thisOutlet
.void
unbindOutputs()
Disconnects all outputs from thisOutlet
by invokingInlet.unbindInput()
on eachInelt
that depends on the state of thisOutlet
.ValueDownlinkView<V>
unobserve(Object observer)
<V2> ValueDownlinkView<V2>
valueClass(Class<V2> valueClass)
Form<V>
valueForm()
<V2> ValueDownlinkView<V2>
valueForm(Form<V2> valueForm)
ValueDownlinkView<V>
willCommand(WillCommand willCommand)
protected void
willDecohere()
ValueDownlinkView<V>
willLink(WillLink willLink)
ValueDownlinkView<V>
willReceive(WillReceive willReceive)
protected void
willRecohere(int version)
ValueDownlinkView<V>
willSet(WillSet<V> willSet)
ValueDownlinkView<V>
willSync(WillSync willSync)
ValueDownlinkView<V>
willUnlink(WillUnlink willUnlink)
-
Methods inherited from class swim.system.warp.WarpDownlinkView
body, command, command, command, command, dispatchDidLink, dispatchDidReceive, dispatchDidSync, dispatchDidUnlink, dispatchWillCommand, dispatchWillLink, dispatchWillReceive, dispatchWillSync, dispatchWillUnlink, downlinkDidLink, downlinkDidReceive, downlinkDidSync, downlinkDidUnlink, downlinkWillCommand, downlinkWillLink, downlinkWillReceive, downlinkWillSync, downlinkWillUnlink, hostUri, keepLinked, keepSynced, laneUri, meshUri, nodeUri, prio, rate
-
Methods inherited from class swim.system.DownlinkView
cellContext, cipherSuite, debug, dispatchDidClose, dispatchDidConnect, dispatchDidDisconnect, dispatchDidFail, downlinkDidClose, downlinkDidConnect, downlinkDidDisconnect, downlinkDidFail, error, fail, info, isConnected, isRemote, isSecure, localAddress, localCertificates, localIdentity, localPrincipal, remoteAddress, remoteCertificates, remoteIdentity, remotePrincipal, securityProtocol, stage, trace, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface swim.api.Link
cipherSuite, hostUri, isConnected, isRemote, isSecure, laneUri, localAddress, localCertificates, localIdentity, localPrincipal, nodeUri, remoteAddress, remoteCertificates, remoteIdentity, remotePrincipal, securityProtocol
-
Methods inherited from interface swim.api.warp.WarpDownlink
body, command, command, command, command, keepLinked, keepSynced, prio, rate
-
-
-
-
Field Detail
-
model
protected ValueDownlinkModel model
-
version
protected int version
-
STATEFUL
protected static final int STATEFUL
- See Also:
- Constant Field Values
-
-
Method Detail
-
downlinkModel
public ValueDownlinkModel downlinkModel()
- Specified by:
downlinkModel
in classWarpDownlinkView
-
hostUri
public ValueDownlinkView<V> hostUri(Uri hostUri)
- Specified by:
hostUri
in interfaceValueDownlink<V>
- Specified by:
hostUri
in interfaceWarpDownlink
- Specified by:
hostUri
in classWarpDownlinkView
-
hostUri
public ValueDownlinkView<V> hostUri(String hostUri)
- Specified by:
hostUri
in interfaceValueDownlink<V>
- Specified by:
hostUri
in interfaceWarpDownlink
- Specified by:
hostUri
in classWarpDownlinkView
-
nodeUri
public ValueDownlinkView<V> nodeUri(Uri nodeUri)
- Specified by:
nodeUri
in interfaceValueDownlink<V>
- Specified by:
nodeUri
in interfaceWarpDownlink
- Specified by:
nodeUri
in classWarpDownlinkView
-
nodeUri
public ValueDownlinkView<V> nodeUri(String nodeUri)
- Specified by:
nodeUri
in interfaceValueDownlink<V>
- Specified by:
nodeUri
in interfaceWarpDownlink
- Specified by:
nodeUri
in classWarpDownlinkView
-
laneUri
public ValueDownlinkView<V> laneUri(Uri laneUri)
- Specified by:
laneUri
in interfaceValueDownlink<V>
- Specified by:
laneUri
in interfaceWarpDownlink
- Specified by:
laneUri
in classWarpDownlinkView
-
laneUri
public ValueDownlinkView<V> laneUri(String laneUri)
- Specified by:
laneUri
in interfaceValueDownlink<V>
- Specified by:
laneUri
in interfaceWarpDownlink
- Specified by:
laneUri
in classWarpDownlinkView
-
prio
public ValueDownlinkView<V> prio(float prio)
- Specified by:
prio
in interfaceValueDownlink<V>
- Specified by:
prio
in interfaceWarpDownlink
- Specified by:
prio
in classWarpDownlinkView
-
rate
public ValueDownlinkView<V> rate(float rate)
- Specified by:
rate
in interfaceValueDownlink<V>
- Specified by:
rate
in interfaceWarpDownlink
- Specified by:
rate
in classWarpDownlinkView
-
body
public ValueDownlinkView<V> body(Value body)
- Specified by:
body
in interfaceValueDownlink<V>
- Specified by:
body
in interfaceWarpDownlink
- Specified by:
body
in classWarpDownlinkView
-
keepLinked
public ValueDownlinkView<V> keepLinked(boolean keepLinked)
- Specified by:
keepLinked
in interfaceValueDownlink<V>
- Specified by:
keepLinked
in interfaceWarpDownlink
- Specified by:
keepLinked
in classWarpDownlinkView
-
keepSynced
public ValueDownlinkView<V> keepSynced(boolean keepSynced)
- Specified by:
keepSynced
in interfaceValueDownlink<V>
- Specified by:
keepSynced
in interfaceWarpDownlink
- Specified by:
keepSynced
in classWarpDownlinkView
-
isStateful
public final boolean isStateful()
- Specified by:
isStateful
in interfaceValueDownlink<V>
-
isStateful
public ValueDownlinkView<V> isStateful(boolean isStateful)
- Specified by:
isStateful
in interfaceValueDownlink<V>
-
valueForm
public final Form<V> valueForm()
- Specified by:
valueForm
in interfaceValueDownlink<V>
-
valueForm
public <V2> ValueDownlinkView<V2> valueForm(Form<V2> valueForm)
- Specified by:
valueForm
in interfaceValueDownlink<V>
-
valueClass
public <V2> ValueDownlinkView<V2> valueClass(Class<V2> valueClass)
- Specified by:
valueClass
in interfaceValueDownlink<V>
-
observe
public ValueDownlinkView<V> observe(Object observer)
- Specified by:
observe
in interfaceDownlink
- Specified by:
observe
in interfaceLink
- Specified by:
observe
in interfaceObservable<V>
- Specified by:
observe
in interfaceObservableValue<V>
- Specified by:
observe
in interfaceValueDownlink<V>
- Specified by:
observe
in interfaceWarpDownlink
- Overrides:
observe
in classWarpDownlinkView
-
unobserve
public ValueDownlinkView<V> unobserve(Object observer)
- Specified by:
unobserve
in interfaceDownlink
- Specified by:
unobserve
in interfaceLink
- Specified by:
unobserve
in interfaceObservable<V>
- Specified by:
unobserve
in interfaceObservableValue<V>
- Specified by:
unobserve
in interfaceValueDownlink<V>
- Specified by:
unobserve
in interfaceWarpDownlink
- Overrides:
unobserve
in classWarpDownlinkView
-
willSet
public ValueDownlinkView<V> willSet(WillSet<V> willSet)
- Specified by:
willSet
in interfaceObservableValue<V>
- Specified by:
willSet
in interfaceValueDownlink<V>
-
didSet
public ValueDownlinkView<V> didSet(DidSet<V> didSet)
- Specified by:
didSet
in interfaceObservableValue<V>
- Specified by:
didSet
in interfaceValueDownlink<V>
-
willReceive
public ValueDownlinkView<V> willReceive(WillReceive willReceive)
- Specified by:
willReceive
in interfaceValueDownlink<V>
- Specified by:
willReceive
in interfaceWarpDownlink
- Specified by:
willReceive
in classWarpDownlinkView
-
didReceive
public ValueDownlinkView<V> didReceive(DidReceive didReceive)
- Specified by:
didReceive
in interfaceValueDownlink<V>
- Specified by:
didReceive
in interfaceWarpDownlink
- Specified by:
didReceive
in classWarpDownlinkView
-
willCommand
public ValueDownlinkView<V> willCommand(WillCommand willCommand)
- Specified by:
willCommand
in interfaceValueDownlink<V>
- Specified by:
willCommand
in interfaceWarpDownlink
- Specified by:
willCommand
in classWarpDownlinkView
-
willLink
public ValueDownlinkView<V> willLink(WillLink willLink)
- Specified by:
willLink
in interfaceValueDownlink<V>
- Specified by:
willLink
in interfaceWarpDownlink
- Specified by:
willLink
in classWarpDownlinkView
-
didLink
public ValueDownlinkView<V> didLink(DidLink didLink)
- Specified by:
didLink
in interfaceValueDownlink<V>
- Specified by:
didLink
in interfaceWarpDownlink
- Specified by:
didLink
in classWarpDownlinkView
-
willSync
public ValueDownlinkView<V> willSync(WillSync willSync)
- Specified by:
willSync
in interfaceValueDownlink<V>
- Specified by:
willSync
in interfaceWarpDownlink
- Specified by:
willSync
in classWarpDownlinkView
-
didSync
public ValueDownlinkView<V> didSync(DidSync didSync)
- Specified by:
didSync
in interfaceValueDownlink<V>
- Specified by:
didSync
in interfaceWarpDownlink
- Specified by:
didSync
in classWarpDownlinkView
-
willUnlink
public ValueDownlinkView<V> willUnlink(WillUnlink willUnlink)
- Specified by:
willUnlink
in interfaceValueDownlink<V>
- Specified by:
willUnlink
in interfaceWarpDownlink
- Specified by:
willUnlink
in classWarpDownlinkView
-
didUnlink
public ValueDownlinkView<V> didUnlink(DidUnlink didUnlink)
- Specified by:
didUnlink
in interfaceValueDownlink<V>
- Specified by:
didUnlink
in interfaceWarpDownlink
- Specified by:
didUnlink
in classWarpDownlinkView
-
didConnect
public ValueDownlinkView<V> didConnect(DidConnect didConnect)
- Specified by:
didConnect
in interfaceDownlink
- Specified by:
didConnect
in interfaceValueDownlink<V>
- Specified by:
didConnect
in interfaceWarpDownlink
- Specified by:
didConnect
in classWarpDownlinkView
-
didDisconnect
public ValueDownlinkView<V> didDisconnect(DidDisconnect didDisconnect)
- Specified by:
didDisconnect
in interfaceDownlink
- Specified by:
didDisconnect
in interfaceValueDownlink<V>
- Specified by:
didDisconnect
in interfaceWarpDownlink
- Specified by:
didDisconnect
in classWarpDownlinkView
-
didClose
public ValueDownlinkView<V> didClose(DidClose didClose)
- Specified by:
didClose
in interfaceDownlink
- Specified by:
didClose
in interfaceValueDownlink<V>
- Specified by:
didClose
in interfaceWarpDownlink
- Specified by:
didClose
in classWarpDownlinkView
-
didFail
public ValueDownlinkView<V> didFail(DidFail didFail)
- Specified by:
didFail
in interfaceDownlink
- Specified by:
didFail
in interfaceValueDownlink<V>
- Specified by:
didFail
in interfaceWarpDownlink
- Specified by:
didFail
in classWarpDownlinkView
-
createDownlinkModel
public ValueDownlinkModel createDownlinkModel()
- Specified by:
createDownlinkModel
in classWarpDownlinkView
-
open
public ValueDownlinkView<V> open()
- Specified by:
open
in interfaceDownlink
- Specified by:
open
in interfaceValueDownlink<V>
- Specified by:
open
in interfaceWarpDownlink
- Specified by:
open
in classWarpDownlinkView
-
close
public void close()
- Specified by:
close
in interfaceLink
- Overrides:
close
in classDownlinkView
-
get
public V get()
Description copied from interface:Outlet
Returns the current state of thisOutlet
.- Specified by:
get
in interfaceObservableValue<V>
- Specified by:
get
in interfaceOutlet<V>
- Specified by:
get
in interfaceValueDownlink<V>
-
set
public V set(V newValue)
- Specified by:
set
in interfaceObservableValue<V>
- Specified by:
set
in interfaceValueDownlink<V>
-
input
public Outlet<? extends V> input()
Description copied from interface:Inlet
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.
-
bindInput
public void bindInput(Outlet<? extends V> input)
Description copied from interface:Inlet
Connects thisInlet
to anOutlet
from which it will acquire its state. If thisInlet
is already connected, it will first disconnect from its existing input. Then, after updating itsinput
property, theInlet
will invokeOutlet.bindOutput(Inlet)
on its newinput
.
-
unbindInput
public void unbindInput()
Description copied from interface:Inlet
Disconnects thisInlet
from its inputOutlet
, if connected. After setting itsinput
property tonull
, theInlet
will invokeOutlet.unbindOutput(Inlet)
on its old input, if defined.- Specified by:
unbindInput
in interfaceInlet<V>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:Inlet
Disconnects allInlet
s dominated by thisInlet
in the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisInlet
.- Specified by:
disconnectInputs
in interfaceInlet<V>
- Specified by:
disconnectInputs
in interfaceOutlet<V>
-
outputIterator
public Iterator<Inlet<? super V>> outputIterator()
Description copied from interface:Outlet
Returns anIterator
over the set ofInlet
s that depend on the state of thisOutlet
.- Specified by:
outputIterator
in interfaceOutlet<V>
-
bindOutput
public void bindOutput(Inlet<? super V> output)
Description copied from interface:Outlet
Adds anoutput
to the set ofInlet
s that depend on the state of thisOutlet
. Theoutput
will be decohered when the state of thisOutlet
is decohered, and recohered when thisOutlet
is recohered.- Specified by:
bindOutput
in interfaceOutlet<V>
-
unbindOutput
public void unbindOutput(Inlet<? super V> output)
Description copied from interface:Outlet
Removes anoutput
from the set ofInlet
s that depend on the state of thisOutlet
.- Specified by:
unbindOutput
in interfaceOutlet<V>
-
unbindOutputs
public void unbindOutputs()
Description copied from interface:Outlet
Disconnects all outputs from thisOutlet
by invokingInlet.unbindInput()
on eachInelt
that depends on the state of thisOutlet
.- Specified by:
unbindOutputs
in interfaceOutlet<V>
-
disconnectOutputs
public void disconnectOutputs()
Description copied from interface:Inlet
Disconnects allOutlet
s dominated by thisInlet
in the dataflow graph. Used to recursively clean up chains of combinators passing through thisInlet
.- Specified by:
disconnectOutputs
in interfaceInlet<V>
- Specified by:
disconnectOutputs
in interfaceOutlet<V>
-
decohereOutput
public void decohereOutput()
Description copied from interface:Inlet
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having decoherent state. Decohering anInlet
will recursively decohere all streamlets that transitively depend on the state of thisInlet
. Decohering anInlet
does not cause its state to be recomputed. A subsequentInlet.recohereOutput(int)
call will eventually make the state of theInlet
coherent again.- Specified by:
decohereOutput
in interfaceInlet<V>
-
decohereInput
public void decohereInput()
Description copied from interface:Outlet
Marks thisOutlet
—and alloutputs
that depend on the state of thisOutlet
—as having decoherent state.- Specified by:
decohereInput
in interfaceOutlet<V>
-
decohere
public void decohere()
-
recohereOutput
public void recohereOutput(int version)
Description copied from interface:Inlet
Updates the state of thisInlet
to make it consistent with thetarget
version. TheInlet
only needs to update if its currentversion
differs from the targetversion
. To update its state, theInlet
first invokesOutlet.recohereInput(int)
on itsinput
, to ensure that its input is coherent. It then invokesStreamlet.recohere(int)
on theStreamlet
to which it's attached, causing theStreamlet
to make its own state coherent again.- Specified by:
recohereOutput
in interfaceInlet<V>
-
recohereInput
public void recohereInput(int version)
Description copied from interface:Outlet
Updates the state of thisOutlet
to make it consistent with the targetversion
. TheOutlet
only needs to update if its currentversion
differs from the targetversion
. To update its state, theOutlet
first invokesStreamlet.recohere(int)
on theStreamlet
to which it's attached. It then invokesInlet.recohereOutput(int)
on each of its dependentoutputs
.- Specified by:
recohereInput
in interfaceOutlet<V>
-
recohere
public void recohere(int version)
-
willDecohere
protected void willDecohere()
-
onDecohere
protected void onDecohere()
-
didDecohere
protected void didDecohere()
-
willRecohere
protected void willRecohere(int version)
-
onRecohere
protected void onRecohere(int version)
-
didRecohere
protected void didRecohere(int version)
-
-