org.overlord.sramp.shell
Class StdInShellCommandReader

java.lang.Object
  extended by org.overlord.sramp.shell.AbstractShellCommandReader
      extended by org.overlord.sramp.shell.StdInShellCommandReader
All Implemented Interfaces:
ShellCommandReader

public class StdInShellCommandReader
extends AbstractShellCommandReader

An implementation of the ShellCommandReader that uses standard input to read commands typed in by the user.

Author:
eric.wittmann@redhat.com

Constructor Summary
StdInShellCommandReader(ShellCommandFactory factory, ShellContextImpl context)
          Constructor.
 
Method Summary
 void close()
          Called by the shell when exiting.
 void open()
          Called to open the shell command reader.
protected  String readLine()
          Reads a single line from the input source (e.g.
 
Methods inherited from class org.overlord.sramp.shell.AbstractShellCommandReader
getCommandOutput, getContext, getFactory, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdInShellCommandReader

public StdInShellCommandReader(ShellCommandFactory factory,
                               ShellContextImpl context)
Constructor.

Parameters:
factory -
context -
Method Detail

open

public void open()
          throws IOException
Description copied from interface: ShellCommandReader
Called to open the shell command reader.

Specified by:
open in interface ShellCommandReader
Specified by:
open in class AbstractShellCommandReader
Throws:
IOException
See Also:
org.overlord.sramp.common.shell.AbstractShellCommandReader#open()

readLine

protected String readLine()
                   throws IOException
Description copied from class: AbstractShellCommandReader
Reads a single line from the input source (e.g. user input) and returns it.

Specified by:
readLine in class AbstractShellCommandReader
Throws:
IOException
See Also:
org.overlord.sramp.common.shell.AbstractShellCommandReader#readLine()

close

public void close()
           throws IOException
Description copied from interface: ShellCommandReader
Called by the shell when exiting.

Specified by:
close in interface ShellCommandReader
Overrides:
close in class AbstractShellCommandReader
Throws:
IOException
See Also:
org.overlord.sramp.common.shell.ShellCommandReader#close()


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.