- java.lang.Object
-
- swim.runtime.AbstractWarpRef
-
- swim.runtime.AbstractTierBinding
-
- swim.runtime.LaneView
-
- swim.runtime.warp.WarpLaneView
-
- swim.runtime.lane.ValueLaneView<V>
-
- All Implemented Interfaces:
DownlinkFactory,Lane,ValueLane<V>,WarpRef,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
All Methods Instance Methods Concrete Methods 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()voiddecohere()voiddecohereInput()Marks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.voiddecohereOutput()Marks thisInlet—and theStreamletto which thisInletis attached—as having decoherent state.ValueLaneView<V>didCommand(DidCommand didCommand)protected voiddidDecohere()ValueLaneView<V>didEnter(DidEnter didEnter)ValueLaneView<V>didLeave(DidLeave didLeave)protected voiddidRecohere(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.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 voidonDecohere()protected voidonRecohere(int version)Iterator<Inlet<? super V>>outputIterator()Returns anIteratorover the set ofInlets that depend on the state of thisOutlet.voidrecohere(int version)voidrecohereInput(int version)Updates the state of thisOutletto make it consistent with the targetversion.voidrecohereOutput(int version)Updates the state of thisInletto make it consistent with thetargetversion.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)protected voidwillDecohere()ValueLaneView<V>willEnter(WillEnter willEnter)ValueLaneView<V>willLeave(WillLeave willLeave)protected voidwillRecohere(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, 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.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.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:
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 decohered when the state of thisOutletis decohered, and recohered when thisOutletis recohered.- 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>
-
decohereOutput
public void decohereOutput()
Description copied from interface:InletMarks thisInlet—and theStreamletto which thisInletis attached—as having decoherent state. Decohering anInletwill recursively decohere all streamlets that transitively depend on the state of thisInlet. Decohering anInletdoes not cause its state to be recomputed. A subsequentInlet.recohereOutput(int)call will eventually make the state of theInletcoherent again.- Specified by:
decohereOutputin interfaceInlet<V>
-
decohereInput
public void decohereInput()
Description copied from interface:OutletMarks thisOutlet—and alloutputsthat depend on the state of thisOutlet—as having decoherent state.- Specified by:
decohereInputin interfaceOutlet<V>
-
decohere
public void decohere()
-
recohereOutput
public void recohereOutput(int version)
Description copied from interface:InletUpdates the state of thisInletto make it consistent with thetargetversion. TheInletonly needs to update if its currentversiondiffers from the targetversion. To update its state, theInletfirst invokesOutlet.recohereInput(int)on itsinput, to ensure that its input is coherent. It then invokesStreamlet.recohere(int)on theStreamletto which it's attached, causing theStreamletto make its own state coherent again.- Specified by:
recohereOutputin interfaceInlet<V>
-
recohereInput
public void recohereInput(int version)
Description copied from interface:OutletUpdates the state of thisOutletto make it consistent with the targetversion. TheOutletonly needs to update if its currentversiondiffers from the targetversion. To update its state, theOutletfirst invokesStreamlet.recohere(int)on theStreamletto which it's attached. It then invokesInlet.recohereOutput(int)on each of its dependentoutputs.- Specified by:
recohereInputin 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)
-
-