-
- 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
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.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.voidinvalidate()Marks thisStreamlet—and all of its outlets—as having stale state.Outlet<O>outlet(String key)Returns theOutletof thisStreamletidentified by the givenkey; returnsnullif thisStreamlethas no suchOutlet.voidreconcile(int version)Reconciles the state of thisStreamlet, if the version of thisStreamlet's state differs from 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.
-
invalidate
void invalidate()
Marks thisStreamlet—and all of its outlets—as having stale state. Invalidating aStreamletwill recursively invalidate all streamlets that transitively depend on the state of thisStreamlet. Invalidating aStreamletdoes not cause its state to be recomputed. A subsequentreconcile(int)call will reconcile the state of theStreamlet.
-
reconcile
void reconcile(int version)
Reconciles the state of thisStreamlet, if the version of thisStreamlet's state differs from the targetversion. To reconcile its state, theStreamletfirst invokesInlet.reconcileOutput(int)on each of its inlets, to ensure that its input states are up-to-date. It then recomputes its own state, in an implementation defined manner. Finally, it invokesOutlet.reconcileInput(int)on its outlets, causing all transitively dependent streamlets to reconcile their own state.
-
-