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,InteractionContext<Chunk>>, Producer<Chunk,InteractionContext<Chunk>>

 class PipeLine
extends Object
implements CommandInvoker<Void,Chunk>


Field Summary
private  Pipe.Invoker 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(InteractionContext<Chunk> consumer)
          Open the producer with the specified consumer.
private  InteractionContext open(int index, InteractionContext last)
           
 void provide(Void element)
          Provide an element.
 void setPiped(boolean piped)
          Set the pipe status.
 void setSession(CommandContext session)
          Associate the command invoker with a session, the association should be done before the command is invoked.
 
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.Invoker current
.

Constructor Detail

PipeLine

PipeLine(CommandInvoker[] invokers)
Method Detail

setSession

public void setSession(CommandContext session)
Description copied from interface: CommandInvoker
Associate the command invoker with a session, the association should be done before the command is invoked.

Specified by:
setSession in interface CommandInvoker<Void,Chunk>
Parameters:
session - the session

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,InteractionContext<Chunk>>
Returns:
the produced type

setPiped

public void setPiped(boolean piped)
Description copied from interface: Producer
Set the pipe status.

Specified by:
setPiped in interface Producer<Chunk,InteractionContext<Chunk>>
Parameters:
piped - the piped status

open

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

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

open

private InteractionContext open(int index,
                                InteractionContext 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()
Description copied from interface: Producer
Close the producer.

Specified by:
close in interface Closeable
Specified by:
close in interface Producer<Chunk,InteractionContext<Chunk>>


Copyright © 2013 eXo Platform SAS. All Rights Reserved.