com.devexperts.qd.tools
Class AbstractTool

java.lang.Object
  extended by com.devexperts.qd.tools.AbstractTool
Direct Known Subclasses:
Compare, Connect, Dump, Feed, GCTimeTransformer, Help, Instruments, Invoke, Multiplexor, NetTest, Post, SchemeDump, SubscriptionBinParser, TDP, Time

public abstract class AbstractTool
extends java.lang.Object

Base class for all QDS tools.


Field Summary
protected  com.devexperts.qd.tools.Options options
           
protected  boolean useScheme
           
 
Constructor Summary
protected AbstractTool(boolean useScheme, boolean waitForeverAtEnd)
          Constructor
 
Method Summary
 void execute(java.lang.String[] args)
          Executes this tool.
protected abstract  void executeImpl(java.lang.String[] args)
          Executes this concrete tool.
protected  java.lang.String generateHelpSummary(int screenWidth)
          Generates basic help on this tool.
protected abstract  com.devexperts.qd.tools.Option[] getOptions()
          Returns array with all options used by this tool.
 boolean mustWaitForeverAtEnd()
           
protected static void noArguments()
           
protected static void wrongNumberOfArguments()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useScheme

protected final boolean useScheme

options

protected com.devexperts.qd.tools.Options options
Constructor Detail

AbstractTool

protected AbstractTool(boolean useScheme,
                       boolean waitForeverAtEnd)
Constructor

Parameters:
useScheme - indicates whether this tool must use scheme.
waitForeverAtEnd - indicates whether this tool must sleep forever after initialization.
Method Detail

execute

public void execute(java.lang.String[] args)
             throws BadToolParametersException,
                    ToolInitializationException
Executes this tool.

Parameters:
args - arguments and options.
Throws:
BadToolParametersException - if couldn't parse tool arguments or options.
ToolInitializationException - if couldn't initialize the tool.

wrongNumberOfArguments

protected static void wrongNumberOfArguments()

noArguments

protected static void noArguments()

executeImpl

protected abstract void executeImpl(java.lang.String[] args)
                             throws BadToolParametersException,
                                    ToolInitializationException
Executes this concrete tool.

Parameters:
args - arguments
Throws:
BadToolParametersException - if arguments are invalid.
ToolInitializationException - if some error occured.

getOptions

protected abstract com.devexperts.qd.tools.Option[] getOptions()
Returns array with all options used by this tool.

Returns:
array with all options used by this tool.

generateHelpSummary

protected java.lang.String generateHelpSummary(int screenWidth)
Generates basic help on this tool.

Parameters:
screenWidth - width of generated info (in characters).
Returns:
String with generated help message.

mustWaitForeverAtEnd

public boolean mustWaitForeverAtEnd()