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  Options options
           
 
Constructor Summary
AbstractTool()
           
 
Method Summary
 java.util.List<java.io.Closeable> closeOnExit()
           
 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  Option[] getOptions()
          Returns array with all options used by this tool.
 boolean mustWaitForeverAtEnd()
           
 java.util.List<MessageConnector> mustWaitWhileActive()
           
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

options

protected Options options
Constructor Detail

AbstractTool

public AbstractTool()
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 occurred.

getOptions

protected 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.

mustWaitWhileActive

public java.util.List<MessageConnector> mustWaitWhileActive()

mustWaitForeverAtEnd

public boolean mustWaitForeverAtEnd()

closeOnExit

public java.util.List<java.io.Closeable> closeOnExit()