Skip to content

Instantly share code, notes, and snippets.

@gastaldi
Last active December 21, 2015 21:28
Show Gist options
  • Select an option

  • Save gastaldi/6368034 to your computer and use it in GitHub Desktop.

Select an option

Save gastaldi/6368034 to your computer and use it in GitHub Desktop.
/**
* A CommandRegistry stores all the available Command objects
*/
public interface CommandRegistry{
/**
* Queries the CommandRegistry for a command
* @param name The command name
* @return Command associated with the name
* @throws CommandNotFoundException if no command can be found for the given name
*/
Command getCommand(String name) throws CommandNotFoundException;
/**
* Returns a read-only Map of this registry.
*/
Map<String, Command> asMap();
}
@gastaldi

Copy link
Copy Markdown
Author

MutableCommandRegistry registry = new MutableCommandRegistry();
registry.add ....
....
AeshConsoleBuilder.commandRegistry(registry);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment