1 22 23 package org.objectweb.cjdbc.console.text.commands.dbadmin; 24 25 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate; 26 import org.objectweb.cjdbc.common.jmx.mbeans.VirtualDatabaseMBean; 27 import org.objectweb.cjdbc.console.text.module.VirtualDatabaseAdmin; 28 29 35 public class ShowControllers extends AbstractAdminCommand 36 { 37 38 43 public ShowControllers(VirtualDatabaseAdmin module) 44 { 45 super(module); 46 } 47 48 51 public void parse(String commandText) throws Exception 52 { 53 VirtualDatabaseMBean db = jmxClient.getVirtualDatabaseProxy(dbName, user, 54 password); 55 String [] controllers = db.viewControllerList(); 56 console.println(ConsoleTranslate.get( 57 "admin.command.show.controllers.number", new Object []{dbName, 58 new Integer (controllers.length)})); 59 for (int i = 0; i < controllers.length; i++) 60 { 61 console.println("\t" + controllers[i]); 62 } 63 } 64 65 68 public String getCommandName() 69 { 70 return "show controllers"; 71 } 72 73 76 public String getCommandDescription() 77 { 78 return ConsoleTranslate.get("admin.command.show.controllers.description"); 79 } 80 } | Popular Tags |