org.rhq.enterprise.agent
Class SigarAgentInputReader

java.lang.Object
  extended by org.rhq.enterprise.agent.JavaAgentInputReader
      extended by org.rhq.enterprise.agent.SigarAgentInputReader
All Implemented Interfaces:
AgentInputReader

public class SigarAgentInputReader
extends JavaAgentInputReader

Uses the SIGAR API when appropriate to read in console input. This falls back to the Java-only superclass implementation if the native SIGAR API is not available.

Author:
John Mazzitelli

Constructor Summary
SigarAgentInputReader(AgentMain agent)
           
SigarAgentInputReader(AgentMain agent, FileReader fr)
           
 
Method Summary
 String readLine()
          Reads a line from the input console.
 String readLineNoEcho()
          Read a line of input, but do not echo back to the user what is being typed.
 
Methods inherited from class org.rhq.enterprise.agent.JavaAgentInputReader
close, isConsole
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SigarAgentInputReader

public SigarAgentInputReader(AgentMain agent)
                      throws IOException
Throws:
IOException

SigarAgentInputReader

public SigarAgentInputReader(AgentMain agent,
                             FileReader fr)
                      throws IOException
Throws:
IOException
Method Detail

readLine

public String readLine()
                throws IOException
Description copied from interface: AgentInputReader
Reads a line from the input console.

Specified by:
readLine in interface AgentInputReader
Overrides:
readLine in class JavaAgentInputReader
Returns:
the line
Throws:
IOException

readLineNoEcho

public String readLineNoEcho()
                      throws IOException
Description copied from interface: AgentInputReader
Read a line of input, but do not echo back to the user what is being typed. This is used mainly when asking for things like passwords. If the console implementation does not support no-echo input, the input will be output as the user typed it.

Specified by:
readLineNoEcho in interface AgentInputReader
Overrides:
readLineNoEcho in class JavaAgentInputReader
Returns:
the line typed by the user
Throws:
IOException


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.