org.crsh.shell.impl.command
Class PipeLine

java.lang.Object
  extended by org.crsh.shell.impl.command.PipeLine
All Implemented Interfaces:
Closeable, Flushable, CommandInvoker<Void,Chunk>, Consumer<Void>, Filter<Void,Chunk,CommandContext<Chunk>>, Producer<Chunk,CommandContext<Chunk>>

 class PipeLine
extends Object
implements CommandInvoker<Void,Chunk>


Field Summary
private  Pipe current
          .
private  CommandInvoker[] invokers
          .
 
Constructor Summary
PipeLine(CommandInvoker[] invokers)
           
 
Method Summary
 void close()
          Close the producer.
 void flush()
           
 Class<Void> getConsumedType()
          Returns the class of the element generic type.
 Class<Chunk> getProducedType()
          Returns the class of the produced type.
 void open(CommandContext<Chunk> consumer)
          Open the producer with the specified consumer.
private  CommandContext open(int index, CommandContext last)
           
 void provide(Void element)
          Provide an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

invokers

private final CommandInvoker[] invokers
.


current

private Pipe current
.

Constructor Detail

PipeLine

PipeLine(CommandInvoker[] invokers)
Method Detail

getConsumedType

public Class<Void> getConsumedType()
Description copied from interface: Consumer
Returns the class of the element generic type.

Specified by:
getConsumedType in interface Consumer<Void>
Returns:
the consumed type

getProducedType

public Class<Chunk> getProducedType()
Description copied from interface: Producer
Returns the class of the produced type.

Specified by:
getProducedType in interface Producer<Chunk,CommandContext<Chunk>>
Returns:
the produced type

open

public void open(CommandContext<Chunk> consumer)
Description copied from interface: Producer
Open the producer with the specified consumer.

Specified by:
open in interface Producer<Chunk,CommandContext<Chunk>>
Parameters:
consumer - the consumer

open

private CommandContext open(int index,
                            CommandContext last)

provide

public void provide(Void element)
             throws IOException
Description copied from interface: Consumer
Provide an element.

Specified by:
provide in interface Consumer<Void>
Parameters:
element - the provided element
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Throws:
IOException

close

public void close()
           throws IOException
Description copied from interface: Producer
Close the producer.

Specified by:
close in interface Closeable
Specified by:
close in interface Producer<Chunk,CommandContext<Chunk>>
Throws:
IOException


Copyright © 2014 eXo Platform SAS. All Rights Reserved.