Class StreamOutputNode


  • public class StreamOutputNode
    extends Node
    A Node for making the result Streams available on the client side. Clients have two options for accessing the streams:
    active/synchronous
    The client must retrieve a StreamBundle via the method getStreamBundle() and iterate over its Streams. This is similar to how jadice server works internally.
    passive/asynchronous
    The client must add any number of StreamListeners. Those listeners are notified upon arrival of a new Stream.

    The underlying transport mechanism is made transparent due to this class.

    As this node is a data sink it must not have a successor.

    • Constructor Detail

      • StreamOutputNode

        public StreamOutputNode()
    • Method Detail

      • addStreamResultListener

        public void addStreamResultListener​(StreamListener listener)
        Adds a listener to this node.
        Parameters:
        listener - This listener will be notified if a new Stream is available or if no more will follow.
      • getWorkerClassName

        public String getWorkerClassName()
        Description copied from class: Node
        Return the node's associated com.levigo.jadice.server.core.NodeWorker full qualified class's name. By default, the worker class name is
        • The same as the node name with the trailing "Node" replaced by "Worker" if the node name ends in "Node"
        • The node class name with an appended "Worker" otherwise.
        The package name of the worker class is the name of the Node's package with an appended ".worker".

        This behavior can be overridden in concrete subclasses.

        Overrides:
        getWorkerClassName in class Node
        Returns:
        the full qualified class name of the worker of this node.
      • getOutputCardinality

        public Node.Cardinality getOutputCardinality()
        Description copied from class: Node
        Return the output cardinality of this node, i.e. how many bundles (not streams!) it expects to produce. By default, nodes are "pipe-style", i.e. one input, one output.
        Overrides:
        getOutputCardinality in class Node
        Returns:
        output cardinality