-
- All Superinterfaces:
StreamletScope<O>
- All Known Subinterfaces:
GenericStreamlet<I,O>
- All Known Implementing Classes:
AbstractRecordStreamlet,AbstractStreamlet,DownlinkStreamlet,RecordStreamlet
public interface Streamlet<I,O> extends StreamletScope<O>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbindInput(String key, Outlet<? extends I> input)Connects theInletof thisStreamlet, identified by the givenkey, to theinputfrom which theInletshould acquire its state.voiddecohere()Marks thisStreamlet—and all of its outlets—as having inconsistent state.voiddisconnectInputs()Disconnects allInlets dominated by thisStreamletin the dataflow dependency graph.voiddisconnectOutputs()Disconnects allInletss dominated by thisStreamletin the dataflow graph.Inlet<I>inlet(String key)Returns theInletto thisStreamletidentified by the givenkey; returnsnullif thisStreamlethas no suchInlet.Outlet<O>outlet(String key)Returns theOutletof thisStreamletidentified by the givenkey; returnsnullif thisStreamlethas no suchOutlet.voidrecohere(int version)Updates the state of thisStreamletto make it consistent with the targetversion.voidsetStreamletContext(StreamletContext context)Sets the environment in which thisStreamletoperates.voidsetStreamletScope(StreamletScope<? extends O> scope)Sets the lexically scoped parent of thisStreamlet.StreamletContextstreamletContext()Returns the environment in which thisStreamletoperates.StreamletScope<? extends O>streamletScope()Returns the lexically scoped parent of thisStreamlet.voidunbindInput(String key)Disconnects theInletof thisStreamlet, identified by the givenkey, from itsinputOutlet, if connected.
-
-
-
Method Detail
-
streamletScope
StreamletScope<? extends O> streamletScope()
Returns the lexically scoped parent of thisStreamlet. Returnsnullif thisStreamlethas no lexical parent.- Specified by:
streamletScopein interfaceStreamletScope<I>
-
setStreamletScope
void setStreamletScope(StreamletScope<? extends O> scope)
Sets the lexically scoped parent of thisStreamlet.
-
streamletContext
StreamletContext streamletContext()
Returns the environment in which thisStreamletoperates.- Specified by:
streamletContextin interfaceStreamletScope<I>
-
setStreamletContext
void setStreamletContext(StreamletContext context)
Sets the environment in which thisStreamletoperates.
-
inlet
Inlet<I> inlet(String key)
Returns theInletto thisStreamletidentified by the givenkey; returnsnullif thisStreamlethas no suchInlet.
-
bindInput
void bindInput(String key, Outlet<? extends I> input)
Connects theInletof thisStreamlet, identified by the givenkey, to theinputfrom which theInletshould acquire its state. Delegates toInlet.bindInput(Outlet)on the identifiedInlet.- Throws:
IllegalArgumentException- if thisStreamlethas noInletwith the givenkey.
-
unbindInput
void unbindInput(String key)
Disconnects theInletof thisStreamlet, identified by the givenkey, from itsinputOutlet, if connected. Delegates toInlet.unbindInput()on the identifiedInlet.- Throws:
IllegalArgumentException- if thisStreamlethas noInletwith the givenkey.
-
outlet
Outlet<O> outlet(String key)
Returns theOutletof thisStreamletidentified by the givenkey; returnsnullif thisStreamlethas no suchOutlet.- Specified by:
outletin interfaceStreamletScope<I>
-
disconnectInputs
void disconnectInputs()
Disconnects allInlets dominated by thisStreamletin the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisStreamlet.
-
disconnectOutputs
void disconnectOutputs()
Disconnects allInletss dominated by thisStreamletin the dataflow graph. Used to recursively clean up chains of combinators originating from thisStreamlet.
-
decohere
void decohere()
Marks thisStreamlet—and all of its outlets—as having inconsistent state. Decohering aStreamletwill recursively decohere all streamlets that transitively depend on the state of thisStreamlet. Decohering aStreamletdoes not cause its state to be recomputed. A subsequentrecohere(int)call will eventually make the state of theStreamletcoherent again.
-
recohere
void recohere(int version)
Updates the state of thisStreamletto make it consistent with the targetversion. TheStreamletonly needs to update if its currentversiondiffers from the targetversion. To update its state, theStreamletfirst invokesInlet.recohereOutput(int)on each of its inlets, to ensure that its input states are coherent. It then recomputes its own state in an implementation defined manner. Finally, it invokesOutlet.recohereInput(int)on its outlets, causing all transitively dependent streamlets to make their own states coherent again.
-
-