nl.toolforge.karma.core.cmd
Class KarmaInitializationCommand

java.lang.Object
  extended bynl.toolforge.karma.core.cmd.KarmaInitializationCommand
All Implemented Interfaces:
Command

public final class KarmaInitializationCommand
extends java.lang.Object
implements Command

Command implementation to initialize a command context. This is implemented as a command to allow for better and more consistent event handling and messaging.

Although not impossible, this command should not be used in a user interface layer.

Version:
$Id: KarmaInitializationCommand.java,v 1.7 2004/11/03 20:54:15 asmedes Exp $
Author:
D.A. Smedes

Constructor Summary
(package private) KarmaInitializationCommand(boolean updateStores)
          Constructs a KarmaInitializationCommand.
 
Method Summary
 void cleanUp()
          Empty implementation.
 void deregisterCommandResponseListener(CommandResponseListener responseListener)
          Deregister the CommandResponseListener.
 void execute()
          Initializes a command context.
 java.lang.String getAlias()
          Returns 'init' as the alias of this command.
 org.apache.commons.cli.CommandLine getCommandLine()
          Returns null
 CommandResponse getCommandResponse()
          Return the specific CommandResponse object that this command uses.
 java.lang.String getDescription()
          Returns the description for this command.
 java.lang.String getHelp()
          Returns the help text for this command.
 java.lang.String getName()
          Returns 'init' as the name of this command.
 void registerCommandResponseListener(CommandResponseListener responseListener)
          Register the given CommandResponseListener as the handler for the command responses.
 void setCommandLine(org.apache.commons.cli.CommandLine commandLine)
          Empty implementation.
 void setContext(CommandContext context)
          Stores a reference to a CommandContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KarmaInitializationCommand

KarmaInitializationCommand(boolean updateStores)
Constructs a KarmaInitializationCommand.

Method Detail

execute

public void execute()
             throws CommandException
Initializes a command context.

Specified by:
execute in interface Command
Throws:
CommandException

getName

public java.lang.String getName()
Returns 'init' as the name of this command.

Specified by:
getName in interface Command
Returns:
'init'

getAlias

public java.lang.String getAlias()
Returns 'init' as the alias of this command.

Specified by:
getAlias in interface Command
Returns:
'init'

getDescription

public java.lang.String getDescription()
Returns the description for this command.

Specified by:
getDescription in interface Command
Returns:
The description for this command.

getHelp

public java.lang.String getHelp()
Returns the help text for this command.

Specified by:
getHelp in interface Command
Returns:
Same as getDescription().
See Also:
{@link #getDescription}

cleanUp

public void cleanUp()
Empty implementation.

Specified by:
cleanUp in interface Command

setContext

public void setContext(CommandContext context)
Description copied from interface: Command
Stores a reference to a CommandContext.

Specified by:
setContext in interface Command
Parameters:
context - An initialized command context.

setCommandLine

public void setCommandLine(org.apache.commons.cli.CommandLine commandLine)
Empty implementation.

Specified by:
setCommandLine in interface Command
Parameters:
commandLine - Unused.

getCommandLine

public org.apache.commons.cli.CommandLine getCommandLine()
Returns null

Specified by:
getCommandLine in interface Command
Returns:
null

registerCommandResponseListener

public final void registerCommandResponseListener(CommandResponseListener responseListener)
Description copied from interface: Command
Register the given CommandResponseListener as the handler for the command responses.

Specified by:
registerCommandResponseListener in interface Command
Parameters:
responseListener -

deregisterCommandResponseListener

public final void deregisterCommandResponseListener(CommandResponseListener responseListener)
Description copied from interface: Command
Deregister the CommandResponseListener.

Specified by:
deregisterCommandResponseListener in interface Command

getCommandResponse

public CommandResponse getCommandResponse()
Description copied from interface: Command
Return the specific CommandResponse object that this command uses.

Specified by:
getCommandResponse in interface Command
Returns:
CommandResponse


Copyright © 2002-2004 Toolforge. All Rights Reserved.