org.crsh.command
Interface CommandContext<C,P>


public interface CommandContext<C,P>

The command context provided to a command during the execution phase. The command context provides the various interactions that a command can perform with its context during its execution.

Version:
$Revision$
Author:
Julien Viet

Method Summary
 Iterable<C> consume()
          Returns an iterator over the stream of consumed items.
 Map<String,Object> getAttributes()
           
 ShellPrinter getWriter()
           
 boolean isPiped()
          Returns true if the command is involved in a pipe operation and receives a stream.
 void produce(P product)
           
 String readLine(String msg, boolean echo)
           
 

Method Detail

getAttributes

Map<String,Object> getAttributes()

readLine

String readLine(String msg,
                boolean echo)

getWriter

ShellPrinter getWriter()

isPiped

boolean isPiped()
Returns true if the command is involved in a pipe operation and receives a stream.

Returns:
true if the command is involved in a pipe

consume

Iterable<C> consume()
                    throws IllegalStateException
Returns an iterator over the stream of consumed items.

Returns:
the consumed items
Throws:
IllegalStateException - if the command is not involved in a pipe operation

produce

void produce(P product)


Copyright © 2010 eXo Platform SAS. All Rights Reserved.