org.exolab.jmscts.tools
Class MessagingCommand

java.lang.Object
  |
  +--org.exolab.jmscts.tools.MessagingCommand
Direct Known Subclasses:
Main, Main

public abstract class MessagingCommand
extends java.lang.Object

Messaging tool command parser

Version:
$Revision: 1.2 $ $Date: 2004/02/03 21:52:12 $
Author:
Tim Anderson

Field Summary
protected static java.lang.String CONFIG
          The short name for the provider configuration argument
protected static java.lang.String CONFIG_LONG
          The long name for the provider configuration argument
protected static java.lang.String COUNT
          The short name for the count argument
protected static java.lang.String COUNT_LONG
          The long name for the count argument
protected static java.lang.String DESTINATION
          The short name for the destination argument
protected static java.lang.String DESTINATION_LONG
          The long name for the destination argument
protected static java.lang.String FACTORY
          The short name for the factory argument
protected static java.lang.String FACTORY_LONG
          The long name for the factory argument
protected static java.lang.String VERBOSE
          The short name for the verbose argument
protected static java.lang.String VERBOSE_LONG
          The long name for the verbose argument
 
Constructor Summary
MessagingCommand()
          Construct a new MessagingCommand
 
Method Summary
protected abstract  MessagingTool create()
          Create the messaging tool
protected  java.lang.String getHome()
          Returns the value of the jmscts.home system property, defaulting to the value of user.dir if its not set
protected  org.apache.commons.cli.Options getOptions()
          Returns the command line arguments
protected abstract  java.lang.String getUsage()
          Returns the command usage
 void invoke(java.lang.String[] args)
          Invoke the command
protected  void parse(MessagingTool tool, org.apache.commons.cli.CommandLine commands)
          Parse the command line, populating the tool
protected  void usage(org.apache.commons.cli.Options options, java.lang.String message)
          Prints the usage for the command, and exits with an error code
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG

protected static final java.lang.String CONFIG
The short name for the provider configuration argument

CONFIG_LONG

protected static final java.lang.String CONFIG_LONG
The long name for the provider configuration argument

FACTORY

protected static final java.lang.String FACTORY
The short name for the factory argument

FACTORY_LONG

protected static final java.lang.String FACTORY_LONG
The long name for the factory argument

DESTINATION

protected static final java.lang.String DESTINATION
The short name for the destination argument

DESTINATION_LONG

protected static final java.lang.String DESTINATION_LONG
The long name for the destination argument

COUNT

protected static final java.lang.String COUNT
The short name for the count argument

COUNT_LONG

protected static final java.lang.String COUNT_LONG
The long name for the count argument

VERBOSE

protected static final java.lang.String VERBOSE
The short name for the verbose argument

VERBOSE_LONG

protected static final java.lang.String VERBOSE_LONG
The long name for the verbose argument
Constructor Detail

MessagingCommand

public MessagingCommand()
Construct a new MessagingCommand
Method Detail

invoke

public void invoke(java.lang.String[] args)
            throws java.lang.Exception
Invoke the command
Parameters:
args - the command line arguments
Throws:
java.lang.Exception - for any error

create

protected abstract MessagingTool create()
Create the messaging tool
Returns:
the messaging tool

parse

protected void parse(MessagingTool tool,
                     org.apache.commons.cli.CommandLine commands)
              throws org.apache.commons.cli.ParseException
Parse the command line, populating the tool
Parameters:
tool - the messaging tool
commands - the command line
Throws:
org.apache.commons.cli.ParseException - if the command line cannot be parsed

getOptions

protected org.apache.commons.cli.Options getOptions()
Returns the command line arguments
Returns:
the command line arguments

getUsage

protected abstract java.lang.String getUsage()
Returns the command usage
Returns:
the command usage

usage

protected void usage(org.apache.commons.cli.Options options,
                     java.lang.String message)
Prints the usage for the command, and exits with an error code
Parameters:
options - the command line options
message - message to display before the usage. May be null

getHome

protected java.lang.String getHome()
Returns the value of the jmscts.home system property, defaulting to the value of user.dir if its not set
Returns:
the value of the jmscts.home system property


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.