- java.lang.Object
-
- swim.runtime.AbstractSwimRef
-
- swim.runtime.AbstractTierBinding
-
- swim.runtime.LaneView
-
- swim.runtime.warp.WarpLaneView
-
- swim.runtime.lane.ValueLaneView<V>
-
- All Implemented Interfaces:
DownlinkFactory
,Lane
,ValueLane<V>
,SwimRef
,WarpLane
,Observable<Object>
,ObservableValue<V>
,CellContext
,TierBinding
,Inlet<V>
,Outlet<V>
,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.runtime.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
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()
ValueLaneView<V>
didCommand(DidCommand didCommand)
ValueLaneView<V>
didEnter(DidEnter didEnter)
protected void
didInvalidate()
ValueLaneView<V>
didLeave(DidLeave didLeave)
protected void
didReconcile(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.void
invalidate()
void
invalidateInput()
void
invalidateOutput()
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having stale state.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
onInvalidate()
protected void
onReconcile(int version)
Iterator<Inlet<? super V>>
outputIterator()
Returns anIterator
over the set ofInlet
s that depend on the state of thisOutlet
.void
reconcile(int version)
void
reconcileInput(int version)
Reconciles the state of thisOutlet
, if the version of thisOutlet
's state differs from the targetversion
.void
reconcileOutput(int version)
Reconciles the state of thisInlet
, if the version of thisInlet
's state differs from the targetversion
.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)
ValueLaneView<V>
willEnter(WillEnter willEnter)
protected void
willInvalidate()
ValueLaneView<V>
willLeave(WillLeave willLeave)
protected void
willReconcile(int version)
ValueLaneView<V>
willSet(WillSet<V> willSet)
ValueLaneView<V>
willUplink(WillUplink willUplink)
-
Methods inherited from class swim.runtime.warp.WarpLaneView
dispatchDidCommand, dispatchDidEnter, dispatchDidLeave, dispatchDidUplink, dispatchWillCommand, dispatchWillEnter, dispatchWillLeave, dispatchWillUplink, laneDidCommand, laneDidEnter, laneDidLeave, laneDidUplink, laneWillCommand, laneWillEnter, laneWillLeave, laneWillUplink
-
Methods inherited from class swim.runtime.LaneView
bindDownlink, 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.runtime.AbstractTierBinding
activate, 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.runtime.AbstractSwimRef
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
-
flags
protected int flags
-
laneBinding
protected ValueLaneModel laneBinding
-
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 invalidated when the state of thisOutlet
is invalidated, and updated when thisOutlet
is updated.- 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>
-
invalidateOutput
public void invalidateOutput()
Description copied from interface:Inlet
Marks thisInlet
—and theStreamlet
to which thisInlet
is attached—as having stale state. Invalidating anInlet
will recursively invalidate all streamlets that transitively depend on the state of thisInlet
. Invalidating anInlet
does not cause its state to be recomputed. A subsequentInlet.reconcileOutput(int)
call will reconcile the state of theInlet
.- Specified by:
invalidateOutput
in interfaceInlet<V>
-
invalidateInput
public void invalidateInput()
Description copied from interface:Outlet
- Specified by:
invalidateInput
in interfaceOutlet<V>
-
invalidate
public void invalidate()
-
reconcileOutput
public void reconcileOutput(int version)
Description copied from interface:Inlet
Reconciles the state of thisInlet
, if the version of thisInlet
's state differs from the targetversion
. To reconcile its state, theInlet
first invokesOutlet.reconcileInput(int)
on itsinput
, to ensure that its input is up-to-date. It then invokesStreamlet.reconcile(int)
on theStreamlet
to which it's attached, causing theStreamlet
to reconcile its own state.- Specified by:
reconcileOutput
in interfaceInlet<V>
-
reconcileInput
public void reconcileInput(int version)
Description copied from interface:Outlet
Reconciles the state of thisOutlet
, if the version of thisOutlet
's state differs from the targetversion
. To reconcile its state, theOutlet
first invokesStreamlet.reconcile(int)
on theStreamlet
to which it's attached. It then invokesInlet.reconcileOutput(int)
on each of its dependentoutputs
.- Specified by:
reconcileInput
in interfaceOutlet<V>
-
reconcile
public void reconcile(int version)
-
willInvalidate
protected void willInvalidate()
-
onInvalidate
protected void onInvalidate()
-
didInvalidate
protected void didInvalidate()
-
willReconcile
protected void willReconcile(int version)
-
onReconcile
protected void onReconcile(int version)
-
didReconcile
protected void didReconcile(int version)
-
-