org.crsh.shell.impl.command.pipeline
Class PipeLine

java.lang.Object
  extended by org.crsh.shell.impl.command.spi.CommandInvoker<Void,Object>
      extended by org.crsh.shell.impl.command.pipeline.PipeLine
All Implemented Interfaces:
Consumer<Void>, Filter<Void,Object,CommandContext<? super Object>>, Producer<Object,CommandContext<? super Object>>

public class PipeLine
extends CommandInvoker<Void,Object>


Field Summary
private  CommandContext<?> current
          .
private  CommandInvoker[] invokers
          .
 
Constructor Summary
PipeLine(CommandInvoker[] invokers)
           
 
Method Summary
 void close()
          Close the producer.
 void flush()
          Flush the stream.
 Class<Void> getConsumedType()
          Returns the class of the element generic type.
 KeyHandler getKeyHandler()
          Return the key handler or null if the invoker cannot handler key events.
 Class<Object> getProducedType()
          Returns the class of the produced type.
 void open(CommandContext<? super Object> 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 org.crsh.shell.impl.command.spi.CommandInvoker
getScreenContext, invoke
 
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 CommandContext<?> current
.

Constructor Detail

PipeLine

public PipeLine(CommandInvoker[] invokers)
Method Detail

getConsumedType

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

Returns:
the consumed type

getProducedType

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

Returns:
the produced type

open

public void open(CommandContext<? super Object> consumer)
          throws IOException,
                 CommandException
Description copied from interface: Producer
Open the producer with the specified consumer.

Specified by:
open in interface Producer<Object,CommandContext<? super Object>>
Specified by:
open in class CommandInvoker<Void,Object>
Parameters:
consumer - the consumer
Throws:
IOException
CommandException

open

private CommandContext open(int index,
                            CommandContext last)
                     throws IOException,
                            CommandException
Throws:
IOException
CommandException

getKeyHandler

public KeyHandler getKeyHandler()
Description copied from class: CommandInvoker
Return the key handler or null if the invoker cannot handler key events.

Overrides:
getKeyHandler in class CommandInvoker<Void,Object>
Returns:
the key handler

provide

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

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

flush

public void flush()
           throws IOException
Description copied from interface: Consumer
Flush the stream.

Specified by:
flush in interface Consumer<Void>
Specified by:
flush in class CommandInvoker<Void,Object>
Throws:
IOException - any io exception

close

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

Specified by:
close in interface Producer<Object,CommandContext<? super Object>>
Specified by:
close in class CommandInvoker<Void,Object>
Throws:
IOException
CommandException


Copyright © 2015 eXo Platform SAS. All Rights Reserved.