* @param args array which contains the arguments for the send command
* @param console the console for printing messages for the user
*/
static public void handleSend(String[] args, Console console) {
ItemRegistry registry = (ItemRegistry) ConsoleActivator.itemRegistryTracker.getService();
EventPublisher publisher = (EventPublisher) ConsoleActivator.eventPublisherTracker.getService();
if(publisher!=null) {
if(registry!=null) {
if(args.length>0) {
String itemName = args[0];
try {
Item item = registry.getItemByPattern(itemName);
if(args.length>1) {
String commandName = args[1];
Command command = TypeParser.parseCommand(item.getAcceptedCommandTypes(), commandName);
if(command!=null) {
publisher.sendCommand(itemName, command);
console.println("Command has been sent successfully.");
} else {
console.println("Error: Command '" + commandName +
"' is not valid for item '" + itemName + "'");
console.print("Valid command types are: ( ");