- 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 AgentContextagentContextprotected intflagsprotected Outlet<? extends V>inputprotected ValueLaneModellaneBindingprotected Inlet<? super V>[]outputsprotected Form<V>valueFormprotected intversion-
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 AgentContextagentContext()voidbindInput(Outlet<? extends V> input)Connects thisInletto anOutletfrom which it will acquire its state.voidbindOutput(Inlet<? super V> output)Adds anoutputto the set ofInlets that depend on the state of thisOutlet.voidclose()ValueLaneModelcreateLaneBinding()ValueLaneView<V>didCommand(DidCommand didCommand)ValueLaneView<V>didEnter(DidEnter didEnter)protected voiddidInvalidate()ValueLaneView<V>didLeave(DidLeave didLeave)protected voiddidReconcile(int version)ValueLaneView<V>didSet(DidSet<V> didSet)ValueLaneView<V>didUplink(DidUplink didUplink)voiddisconnectInputs()Disconnects allInlets dominated by thisInletin the dataflow dependency graph.voiddisconnectOutputs()Disconnects allOutlets dominated by thisInletin the dataflow graph.booleandispatchDidSet(Link link, V newValue, V oldValue, boolean preemptive)Map.Entry<Boolean,V>dispatchWillSet(Link link, V newValue, boolean preemptive)Vget()Returns the current state of thisOutlet.Outlet<? extends V>input()Returns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.voidinvalidate()voidinvalidateInput()voidinvalidateOutput()Marks thisInlet—and theStreamletto which thisInletis attached—as having stale state.booleanisResident()ValueLaneView<V>isResident(boolean isResident)booleanisTransient()ValueLaneView<V>isTransient(boolean isTransient)ValueLaneModellaneBinding()voidlaneDidSet(V newValue, V oldValue)VlaneWillSet(V newValue)ValueLaneView<V>observe(Object observer)protected voidonInvalidate()protected voidonReconcile(int version)Iterator<Inlet<? super V>>outputIterator()Returns anIteratorover the set ofInlets that depend on the state of thisOutlet.voidreconcile(int version)voidreconcileInput(int version)Reconciles the state of thisOutlet, if the version of thisOutlet's state differs from the targetversion.voidreconcileOutput(int version)Reconciles the state of thisInlet, if the version of thisInlet's state differs from the targetversion.Vset(V newValue)voidsetValueForm(Form<V> valueForm)protected ObjecttypesafeObservers(Object observers)voidunbindInput()Disconnects thisInletfrom its inputOutlet, if connected.voidunbindOutput(Inlet<? super V> output)Removes anoutputfrom the set ofInlets that depend on the state of thisOutlet.voidunbindOutputs()Disconnects all outputs from thisOutletby invokingInlet.unbindInput()on eachIneltthat 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 voidwillInvalidate()ValueLaneView<V>willLeave(WillLeave willLeave)protected voidwillReconcile(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:
agentContextin classLaneView
-
laneBinding
public ValueLaneModel laneBinding()
- Specified by:
laneBindingin classLaneView
-
createLaneBinding
public ValueLaneModel createLaneBinding()
- Specified by:
createLaneBindingin classLaneView
-
valueForm
public <V2> ValueLaneView<V2> valueForm(Form<V2> valueForm)
-
valueClass
public <V2> ValueLaneView<V2> valueClass(Class<V2> valueClass)
- Specified by:
valueClassin interfaceValueLane<V>
-
isResident
public final boolean isResident()
- Specified by:
isResidentin interfaceValueLane<V>
-
isResident
public ValueLaneView<V> isResident(boolean isResident)
- Specified by:
isResidentin interfaceValueLane<V>
-
isTransient
public final boolean isTransient()
- Specified by:
isTransientin interfaceValueLane<V>
-
isTransient
public ValueLaneView<V> isTransient(boolean isTransient)
- Specified by:
isTransientin interfaceValueLane<V>
-
close
public void close()
-
observe
public ValueLaneView<V> observe(Object observer)
- Specified by:
observein interfaceLane- Specified by:
observein interfaceObservable<V>- Specified by:
observein interfaceObservableValue<V>- Specified by:
observein interfaceValueLane<V>- Specified by:
observein interfaceWarpLane- Overrides:
observein classWarpLaneView
-
unobserve
public ValueLaneView<V> unobserve(Object observer)
- Specified by:
unobservein interfaceLane- Specified by:
unobservein interfaceObservable<V>- Specified by:
unobservein interfaceObservableValue<V>- Specified by:
unobservein interfaceValueLane<V>- Specified by:
unobservein interfaceWarpLane- Overrides:
unobservein 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:
willCommandin interfaceValueLane<V>- Specified by:
willCommandin interfaceWarpLane- Specified by:
willCommandin classWarpLaneView
-
didCommand
public ValueLaneView<V> didCommand(DidCommand didCommand)
- Specified by:
didCommandin interfaceValueLane<V>- Specified by:
didCommandin interfaceWarpLane- Specified by:
didCommandin classWarpLaneView
-
willUplink
public ValueLaneView<V> willUplink(WillUplink willUplink)
- Specified by:
willUplinkin interfaceValueLane<V>- Specified by:
willUplinkin interfaceWarpLane- Specified by:
willUplinkin 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:OutletReturns the current state of thisOutlet.
-
input
public Outlet<? extends V> input()
Description copied from interface:InletReturns theOutletfrom which thisInletacquires its state; returnsnullif thisInletis disconnected.
-
bindInput
public void bindInput(Outlet<? extends V> input)
Description copied from interface:InletConnects thisInletto anOutletfrom which it will acquire its state. If thisInletis already connected, it will first disconnect from its existing input. Then, after updating itsinputproperty, theInletwill invokeOutlet.bindOutput(Inlet)on its newinput.
-
unbindInput
public void unbindInput()
Description copied from interface:InletDisconnects thisInletfrom its inputOutlet, if connected. After setting itsinputproperty tonull, theInletwill invokeOutlet.unbindOutput(Inlet)on its old input, if defined.- Specified by:
unbindInputin interfaceInlet<V>
-
disconnectInputs
public void disconnectInputs()
Description copied from interface:InletDisconnects allInlets dominated by thisInletin the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisInlet.- Specified by:
disconnectInputsin interfaceInlet<V>- Specified by:
disconnectInputsin interfaceOutlet<V>
-
outputIterator
public Iterator<Inlet<? super V>> outputIterator()
Description copied from interface:OutletReturns anIteratorover the set ofInlets that depend on the state of thisOutlet.- Specified by:
outputIteratorin interfaceOutlet<V>
-
bindOutput
public void bindOutput(Inlet<? super V> output)
Description copied from interface:OutletAdds anoutputto the set ofInlets that depend on the state of thisOutlet. Theoutputwill be invalidated when the state of thisOutletis invalidated, and updated when thisOutletis updated.- Specified by:
bindOutputin interfaceOutlet<V>
-
unbindOutput
public void unbindOutput(Inlet<? super V> output)
Description copied from interface:OutletRemoves anoutputfrom the set ofInlets that depend on the state of thisOutlet.- Specified by:
unbindOutputin interfaceOutlet<V>
-
unbindOutputs
public void unbindOutputs()
Description copied from interface:OutletDisconnects all outputs from thisOutletby invokingInlet.unbindInput()on eachIneltthat depends on the state of thisOutlet.- Specified by:
unbindOutputsin interfaceOutlet<V>
-
disconnectOutputs
public void disconnectOutputs()
Description copied from interface:InletDisconnects allOutlets dominated by thisInletin the dataflow graph. Used to recursively clean up chains of combinators passing through thisInlet.- Specified by:
disconnectOutputsin interfaceInlet<V>- Specified by:
disconnectOutputsin interfaceOutlet<V>
-
invalidateOutput
public void invalidateOutput()
Description copied from interface:InletMarks thisInlet—and theStreamletto which thisInletis attached—as having stale state. Invalidating anInletwill recursively invalidate all streamlets that transitively depend on the state of thisInlet. Invalidating anInletdoes not cause its state to be recomputed. A subsequentInlet.reconcileOutput(int)call will reconcile the state of theInlet.- Specified by:
invalidateOutputin interfaceInlet<V>
-
invalidateInput
public void invalidateInput()
Description copied from interface:Outlet- Specified by:
invalidateInputin interfaceOutlet<V>
-
invalidate
public void invalidate()
-
reconcileOutput
public void reconcileOutput(int version)
Description copied from interface:InletReconciles the state of thisInlet, if the version of thisInlet's state differs from the targetversion. To reconcile its state, theInletfirst invokesOutlet.reconcileInput(int)on itsinput, to ensure that its input is up-to-date. It then invokesStreamlet.reconcile(int)on theStreamletto which it's attached, causing theStreamletto reconcile its own state.- Specified by:
reconcileOutputin interfaceInlet<V>
-
reconcileInput
public void reconcileInput(int version)
Description copied from interface:OutletReconciles the state of thisOutlet, if the version of thisOutlet's state differs from the targetversion. To reconcile its state, theOutletfirst invokesStreamlet.reconcile(int)on theStreamletto which it's attached. It then invokesInlet.reconcileOutput(int)on each of its dependentoutputs.- Specified by:
reconcileInputin 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)
-
-