org.sonatype.gshell.command.registry
Class CommandRegistryImpl

java.lang.Object
  extended by org.sonatype.gshell.command.registry.CommandRegistryImpl
All Implemented Interfaces:
CommandRegistry

@Singleton
public class CommandRegistryImpl
extends Object
implements CommandRegistry

CommandRegistry component.

Since:
2.5
Author:
Jason Dillon

Constructor Summary
CommandRegistryImpl(EventManager events)
           
 
Method Summary
 boolean containsCommand(String name)
           
 CommandAction getCommand(String name)
           
 Collection<String> getCommandNames()
           
 Collection<CommandAction> getCommands()
           
 void registerCommand(String name, CommandAction command)
           
 void removeCommand(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandRegistryImpl

@Inject
public CommandRegistryImpl(EventManager events)
Method Detail

registerCommand

public void registerCommand(String name,
                            CommandAction command)
                     throws DuplicateCommandException
Specified by:
registerCommand in interface CommandRegistry
Throws:
DuplicateCommandException

removeCommand

public void removeCommand(String name)
                   throws NoSuchCommandException
Specified by:
removeCommand in interface CommandRegistry
Throws:
NoSuchCommandException

getCommand

public CommandAction getCommand(String name)
                         throws NoSuchCommandException
Specified by:
getCommand in interface CommandRegistry
Throws:
NoSuchCommandException

containsCommand

public boolean containsCommand(String name)
Specified by:
containsCommand in interface CommandRegistry

getCommandNames

public Collection<String> getCommandNames()
Specified by:
getCommandNames in interface CommandRegistry

getCommands

public Collection<CommandAction> getCommands()
Specified by:
getCommands in interface CommandRegistry


Copyright © 2008-2011 Sonatype. All Rights Reserved.