org.crsh.shell.impl.command
Class Pipe.Invoker<C,P>

java.lang.Object
  extended by org.crsh.shell.impl.command.Pipe<C,P>
      extended by org.crsh.shell.impl.command.Pipe.Invoker<C,P>
All Implemented Interfaces:
Closeable, Flushable, Consumer<C>, Filter<C,P,InteractionContext<P>>, Producer<P,InteractionContext<P>>, InteractionContext<C>, ScreenContext<C>
Enclosing class:
Pipe<C,P>

static class Pipe.Invoker<C,P>
extends Pipe<C,P>

A pipe filter that invokes a command through a CommandInvoker.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.crsh.shell.impl.command.Pipe
Pipe.Chunkizer, Pipe.Invoker<C,P>, Pipe.Sink<P>
 
Field Summary
(package private)  Filter<C,P,InteractionContext<P>> command
          .
 
Fields inherited from class org.crsh.shell.impl.command.Pipe
context
 
Constructor Summary
Pipe.Invoker(Filter<C,P,InteractionContext<P>> command)
           
 
Method Summary
 void close()
          Close the producer.
 void flush()
           
 Class<C> getConsumedType()
          Returns the class of the element generic type.
 Class<P> getProducedType()
          Returns the class of the produced type.
 void open(InteractionContext<P> consumer)
          Open the producer with the specified consumer.
 void provide(C element)
          Provide an element.
 void setPiped(boolean piped)
          Set the pipe status.
 
Methods inherited from class org.crsh.shell.impl.command.Pipe
getHeight, getProperty, getWidth, readLine, releaseAlternateBuffer, takeAlternateBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

command

final Filter<C,P,InteractionContext<P>> command
.

Constructor Detail

Pipe.Invoker

Pipe.Invoker(Filter<C,P,InteractionContext<P>> command)
Method Detail

setPiped

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

Parameters:
piped - the piped status

getProducedType

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

Returns:
the produced type

getConsumedType

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

Returns:
the consumed type

open

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

Parameters:
consumer - the consumer

provide

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

Parameters:
element - the provided element
Throws:
IOException

flush

public void flush()
           throws IOException
Throws:
IOException

close

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

Throws:
ScriptException


Copyright © 2013 eXo Platform SAS. All Rights Reserved.