- java.lang.Object
-
- swim.system.AbstractWarpRef
-
- swim.system.AbstractTierBinding
-
- swim.system.LaneView
-
- swim.system.warp.WarpLaneView
-
- swim.system.lane.ValueLaneView<V>
-
- All Implemented Interfaces:
DownlinkFactory
,Lane
,ValueLane<V>
,WarpRef
,WarpLane
,Observable<Object>
,ObservableValue<V>
,Inlet<V>
,Outlet<V>
,CellContext
,TierBinding
,Log
public class ValueLaneView<V> extends WarpLaneView implements ValueLane<V>
-
-
Field Summary
Fields Modifier and Type Field Description protected AgentContext
agentContext
protected int
flags
protected Outlet<? extends V>
input
protected ValueLaneModel
laneBinding
protected Inlet<? super V>[]
outputs
protected Form<V>
valueForm
protected int
version
-
Fields inherited from class swim.system.AbstractTierBinding
CLOSED_PHASE, CLOSED_STATE, CLOSING_STATE, FAILED_STATE, FAILING_STATE, LOADED_PHASE, LOADED_STATE, LOADING_STATE, OPENED_PHASE, OPENED_STATE, OPENING_STATE, PHASE_MASK, PHASE_SHIFT, RECOVERING_STATE, STARTED_PHASE, STARTED_STATE, STARTING_STATE, STATE_MASK, status, STATUS, STOPPING_STATE, UNLOADING_STATE
-
-
Constructor Summary
Constructors Constructor Description ValueLaneView(AgentContext agentContext, Form<V> valueForm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AgentContext
agentContext()
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
.void
close()
ValueLaneModel
createLaneBinding()
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.ValueLaneView<V>
didCommand(DidCommand didCommand)
protected void
didDecohere()
ValueLaneView<V>
didEnter(DidEnter didEnter)
ValueLaneView<V>
didLeave(DidLeave didLeave)
protected void
didRecohere(int version)
ValueLaneView<V>
didSet(DidSet<V> didSet)
ValueLaneView<V>
didUplink(DidUplink didUplink)
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(Link link, V newValue, V oldValue, boolean preemptive)
Map.Entry<Boolean,V>
dispatchWillSet(Link link, V newValue, boolean preemptive)
V
get()
Returns the current state of thisOutlet
.Outlet<? extends V>
input()
Returns theOutlet
from which thisInlet
acquires its state; returnsnull
if thisInlet
is disconnected.boolean
isResident()
ValueLaneView<V>
isResident(boolean isResident)
boolean
isTransient()
ValueLaneView<V>
isTransient(boolean isTransient)
ValueLaneModel
laneBinding()
void
laneDidSet(V newValue, V oldValue)
V
laneWillSet(V newValue)
ValueLaneView<V>
observe(Object observer)
protected void
onDecohere()
protected void
onRecohere(int version)
Iterator<Inlet<? super V>>
outputIterator()
Returns anIterator
over the set ofInlet
s that depend on the state of thisOutlet
.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)
void
setValueForm(Form<V> valueForm)
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
.ValueLaneView<V>
unobserve(Object observer)
<V2> ValueLaneView<V2>
valueClass(Class<V2> valueClass)
Form<V>
valueForm()
<V2> ValueLaneView<V2>
valueForm(Form<V2> valueForm)
ValueLaneView<V>
willCommand(WillCommand willCommand)
protected void
willDecohere()
ValueLaneView<V>
willEnter(WillEnter willEnter)
ValueLaneView<V>
willLeave(WillLeave willLeave)
protected void
willRecohere(int version)
ValueLaneView<V>
willSet(WillSet<V> willSet)
ValueLaneView<V>
willUplink(WillUplink willUplink)
-
Methods inherited from class swim.system.warp.WarpLaneView
dispatchDidCommand, dispatchDidEnter, dispatchDidLeave, dispatchDidUplink, dispatchWillCommand, dispatchWillEnter, dispatchWillLeave, dispatchWillUplink, laneDidCommand, laneDidEnter, laneDidLeave, laneDidUplink, laneWillCommand, laneWillEnter, laneWillLeave, laneWillUplink
-
Methods inherited from class swim.system.LaneView
bindDownlink, bottomLane, cellAddress, closeDownlink, debug, edgeName, error, fail, hostUri, info, laneContext, laneDidFail, laneUri, meshUri, nodeUri, openDownlink, openMetaDownlink, policy, pushDown, reportDown, schedule, stage, store, tierContext, trace, unwrapLane, warn
-
Methods inherited from class swim.system.AbstractTierBinding
activate, awaitStart, didClose, didFail, didLoad, didOpen, didStart, didStop, didUnload, isClosed, isLoaded, isOpened, isStarted, load, open, start, stop, unload, willClose, willLoad, willOpen, willStart, willStop, willUnload
-
Methods inherited from class swim.system.AbstractWarpRef
command, command, command, command, command, command, command, command, command, command, command, command, command, command, command, command, downlink, downlinkHttp, downlinkList, downlinkMap, downlinkValue, downlinkWs, hostRef, hostRef, laneRef, laneRef, laneRef, laneRef, nodeRef, nodeRef, nodeRef, nodeRef
-
-
-
-
Field Detail
-
agentContext
protected final AgentContext agentContext
-
laneBinding
protected ValueLaneModel laneBinding
-
flags
protected int flags
-
version
protected int version
-
-
Constructor Detail
-
ValueLaneView
public ValueLaneView(AgentContext agentContext, Form<V> valueForm)
-
-
Method Detail
-
agentContext
public AgentContext agentContext()
- Specified by:
agentContext
in classLaneView
-
laneBinding
public ValueLaneModel laneBinding()
- Specified by:
laneBinding
in classLaneView
-
createLaneBinding
public ValueLaneModel createLaneBinding()
- Specified by:
createLaneBinding
in classLaneView
-
valueForm
public <V2> ValueLaneView<V2> valueForm(Form<V2> valueForm)
-
valueClass
public <V2> ValueLaneView<V2> valueClass(Class<V2> valueClass)
- Specified by:
valueClass
in interfaceValueLane<V>
-
isResident
public final boolean isResident()
- Specified by:
isResident
in interfaceValueLane<V>
-
isResident
public ValueLaneView<V> isResident(boolean isResident)
- Specified by:
isResident
in interfaceValueLane<V>
-
isTransient
public final boolean isTransient()
- Specified by:
isTransient
in interfaceValueLane<V>
-
isTransient
public ValueLaneView<V> isTransient(boolean isTransient)
- Specified by:
isTransient
in interfaceValueLane<V>
-
close
public void close()
-
observe
public ValueLaneView<V> observe(Object observer)
- Specified by:
observe
in interfaceLane
- Specified by:
observe
in interfaceObservable<V>
- Specified by:
observe
in interfaceObservableValue<V>
- Specified by:
observe
in interfaceValueLane<V>
- Specified by:
observe
in interfaceWarpLane
- Overrides:
observe
in classWarpLaneView
-
unobserve
public ValueLaneView<V> unobserve(Object observer)
- Specified by:
unobserve
in interfaceLane
- Specified by:
unobserve
in interfaceObservable<V>
- Specified by:
unobserve
in interfaceObservableValue<V>
- Specified by:
unobserve
in interfaceValueLane<V>
- Specified by:
unobserve
in interfaceWarpLane
- Overrides:
unobserve
in classWarpLaneView
-
willSet
public ValueLaneView<V> willSet(WillSet<V> willSet)
-
didSet
public ValueLaneView<V> didSet(DidSet<V> didSet)
-
willCommand
public ValueLaneView<V> willCommand(WillCommand willCommand)
- Specified by:
willCommand
in interfaceValueLane<V>
- Specified by:
willCommand
in interfaceWarpLane
- Specified by:
willCommand
in classWarpLaneView
-
didCommand
public ValueLaneView<V> didCommand(DidCommand didCommand)
- Specified by:
didCommand
in interfaceValueLane<V>
- Specified by:
didCommand
in interfaceWarpLane
- Specified by:
didCommand
in classWarpLaneView
-
willUplink
public ValueLaneView<V> willUplink(WillUplink willUplink)
- Specified by:
willUplink
in interfaceValueLane<V>
- Specified by:
willUplink
in interfaceWarpLane
- Specified by:
willUplink
in classWarpLaneView
-
didUplink
public ValueLaneView<V> didUplink(DidUplink didUplink)
-
willEnter
public ValueLaneView<V> willEnter(WillEnter willEnter)
-
didEnter
public ValueLaneView<V> didEnter(DidEnter didEnter)
-
willLeave
public ValueLaneView<V> willLeave(WillLeave willLeave)
-
didLeave
public ValueLaneView<V> didLeave(DidLeave didLeave)
-
dispatchWillSet
public Map.Entry<Boolean,V> dispatchWillSet(Link link, V newValue, boolean preemptive)
-
dispatchDidSet
public boolean dispatchDidSet(Link link, V newValue, V oldValue, boolean preemptive)
-
get
public V get()
Description copied from interface:Outlet
Returns the current state of thisOutlet
.
-
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)
-
-