org.crsh.shell.impl.command
Class PipeLine

java.lang.Object
  extended by org.crsh.shell.impl.command.PipeLine
All Implemented Interfaces:
Closeable, Flushable, CommandInvoker, Consumer, Pipe, Producer, ProducerConsumer

 class PipeLine
extends Object
implements CommandInvoker


Field Summary
private  Filter[] pipes
          .
private  CRaSHSession session
          .
 
Constructor Summary
PipeLine(CRaSHSession session, Filter[] pipes)
           
 
Method Summary
 void close()
          Close the producer.
 void flush()
           
 Class getConsumedType()
          Returns the class of the consumed type.
 Class getProducedType()
          Returns the class of the produced type.
 void invoke(ProducerContext<?> context)
           
 void open(ProducerContext context)
          Open the producer with the specified context.
 void provide(Object element)
          Provide an element.
 void setPiped(boolean piped)
          Set the pipe status.
 void setSession(SessionContext 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

session

private final CRaSHSession session
.


pipes

private final Filter[] pipes
.

Constructor Detail

PipeLine

PipeLine(CRaSHSession session,
         Filter[] pipes)
Method Detail

invoke

public void invoke(ProducerContext<?> context)
            throws ScriptException,
                   IOException
Throws:
ScriptException
IOException

setSession

public void setSession(SessionContext 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
Parameters:
session - the session

getConsumedType

public Class getConsumedType()
Description copied from interface: Consumer
Returns the class of the consumed type.

Specified by:
getConsumedType in interface Consumer
Returns:
the consumed type

getProducedType

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

Specified by:
getProducedType in interface Producer
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
Parameters:
piped - the piped status

open

public void open(ProducerContext context)
Description copied from interface: Producer
Open the producer with the specified context.

Specified by:
open in interface Producer
Parameters:
context - the context

close

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

Specified by:
close in interface Closeable
Specified by:
close in interface Producer

provide

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

Specified by:
provide in interface Pipe
Parameters:
element - the provided element
Throws:
IOException

flush

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


Copyright © 2012 eXo Platform SAS. All Rights Reserved.