net.grinder.util
Class AbstractMainClass

java.lang.Object
  extended by net.grinder.util.AbstractMainClass
Direct Known Subclasses:
Console, Grinder, ProcessRecording, TCPProxy

public abstract class AbstractMainClass
extends Object

Basic functionality for a main class. Crudely extracted for now.

Author:
Philip Aston

Nested Class Summary
protected static class AbstractMainClass.LoggedInitialisationException
          Exception indicating that an error message has already been logged.
 
Constructor Summary
protected AbstractMainClass(org.slf4j.Logger logger, String usage)
          Constructor.
 
Method Summary
protected  AbstractMainClass.LoggedInitialisationException barfError(String message)
          Log an error and return a AbstractMainClass.LoggedInitialisationException that can be thrown.
protected  AbstractMainClass.LoggedInitialisationException barfUsage()
          Log a usage message and return a AbstractMainClass.LoggedInitialisationException that can be thrown.
protected  org.slf4j.Logger getLogger()
          Return our logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMainClass

protected AbstractMainClass(org.slf4j.Logger logger,
                            String usage)
                     throws GrinderException
Constructor.

Parameters:
logger - Logger to which output should be directed.
usage - Usage message.
Throws:
GrinderException - If a problem occurred.
Method Detail

getLogger

protected final org.slf4j.Logger getLogger()
Return our logger.

Returns:
The logger.

barfError

protected final AbstractMainClass.LoggedInitialisationException barfError(String message)
Log an error and return a AbstractMainClass.LoggedInitialisationException that can be thrown.

Parameters:
message - The message to throw.
Returns:
An exception for the caller to throw.

barfUsage

protected final AbstractMainClass.LoggedInitialisationException barfUsage()
Log a usage message and return a AbstractMainClass.LoggedInitialisationException that can be thrown.

Returns:
An exception for the caller to throw.


Copyright © 2000-2013. All Rights Reserved.