-
- 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 void
bindInput(String key, Outlet<? extends I> input)
Connects theInlet
of thisStreamlet
, identified by the givenkey
, to theinput
from which theInlet
should acquire its state.void
disconnectInputs()
Disconnects allInlet
s dominated by thisStreamlet
in the dataflow dependency graph.void
disconnectOutputs()
Disconnects allInlets
s dominated by thisStreamlet
in the dataflow graph.Inlet<I>
inlet(String key)
Returns theInlet
to thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchInlet
.void
invalidate()
Marks thisStreamlet
—and all of its outlets—as having stale state.Outlet<O>
outlet(String key)
Returns theOutlet
of thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchOutlet
.void
reconcile(int version)
Reconciles the state of thisStreamlet
, if the version of thisStreamlet
's state differs from the targetversion
.void
setStreamletContext(StreamletContext context)
Sets the environment in which thisStreamlet
operates.void
setStreamletScope(StreamletScope<? extends O> scope)
Sets the lexically scoped parent of thisStreamlet
.StreamletContext
streamletContext()
Returns the environment in which thisStreamlet
operates.StreamletScope<? extends O>
streamletScope()
Returns the lexically scoped parent of thisStreamlet
.void
unbindInput(String key)
Disconnects theInlet
of thisStreamlet
, identified by the givenkey
, from itsinput
Outlet
, if connected.
-
-
-
Method Detail
-
streamletScope
StreamletScope<? extends O> streamletScope()
Returns the lexically scoped parent of thisStreamlet
. Returnsnull
if thisStreamlet
has no lexical parent.- Specified by:
streamletScope
in interfaceStreamletScope<I>
-
setStreamletScope
void setStreamletScope(StreamletScope<? extends O> scope)
Sets the lexically scoped parent of thisStreamlet
.
-
streamletContext
StreamletContext streamletContext()
Returns the environment in which thisStreamlet
operates.- Specified by:
streamletContext
in interfaceStreamletScope<I>
-
setStreamletContext
void setStreamletContext(StreamletContext context)
Sets the environment in which thisStreamlet
operates.
-
inlet
Inlet<I> inlet(String key)
Returns theInlet
to thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchInlet
.
-
bindInput
void bindInput(String key, Outlet<? extends I> input)
Connects theInlet
of thisStreamlet
, identified by the givenkey
, to theinput
from which theInlet
should acquire its state. Delegates toInlet.bindInput(Outlet)
on the identifiedInlet
.- Throws:
IllegalArgumentException
- if thisStreamlet
has noInlet
with the givenkey
.
-
unbindInput
void unbindInput(String key)
Disconnects theInlet
of thisStreamlet
, identified by the givenkey
, from itsinput
Outlet
, if connected. Delegates toInlet.unbindInput()
on the identifiedInlet
.- Throws:
IllegalArgumentException
- if thisStreamlet
has noInlet
with the givenkey
.
-
outlet
Outlet<O> outlet(String key)
Returns theOutlet
of thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchOutlet
.- Specified by:
outlet
in interfaceStreamletScope<I>
-
disconnectInputs
void disconnectInputs()
Disconnects allInlet
s dominated by thisStreamlet
in the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisStreamlet
.
-
disconnectOutputs
void disconnectOutputs()
Disconnects allInlets
s dominated by thisStreamlet
in 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 aStreamlet
will recursively invalidate all streamlets that transitively depend on the state of thisStreamlet
. Invalidating aStreamlet
does 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, theStreamlet
first 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.
-
-