Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

ControllerConsole.java

00001 /**
00002  * C-JDBC: Clustered JDBC.
00003  * Copyright (C) 2002-2004 French National Institute For Research In Computer
00004  * Science And Control (INRIA).
00005  * Contact: c-jdbc@objectweb.org
00006  * 
00007  * This library is free software; you can redistribute it and/or modify it
00008  * under the terms of the GNU Lesser General Public License as published by the
00009  * Free Software Foundation; either version 2.1 of the License, or any later
00010  * version.
00011  * 
00012  * This library is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
00015  * for more details.
00016  * 
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with this library; if not, write to the Free Software Foundation,
00019  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00020  *
00021  * Initial developer(s): Nicolas Modrzyk
00022  * Contributor(s): ______________________.
00023  */
00024 
00025 package org.objectweb.cjdbc.console.text.module;
00026 
00027 import org.objectweb.cjdbc.common.i18n.ConsoleTranslate;
00028 import org.objectweb.cjdbc.console.text.Console;
00029 import org.objectweb.cjdbc.console.text.commands.controller.AddDriver;
00030 import org.objectweb.cjdbc.console.text.commands.controller.Admin;
00031 import org.objectweb.cjdbc.console.text.commands.controller.Bind;
00032 import org.objectweb.cjdbc.console.text.commands.controller.Connect;
00033 import org.objectweb.cjdbc.console.text.commands.controller.DropDB;
00034 import org.objectweb.cjdbc.console.text.commands.controller.GetInfo;
00035 import org.objectweb.cjdbc.console.text.commands.controller.GetXml;
00036 import org.objectweb.cjdbc.console.text.commands.controller.ListDatabases;
00037 import org.objectweb.cjdbc.console.text.commands.controller.Load;
00038 import org.objectweb.cjdbc.console.text.commands.controller.Monitor;
00039 import org.objectweb.cjdbc.console.text.commands.controller.RefreshLogs;
00040 import org.objectweb.cjdbc.console.text.commands.controller.Report;
00041 import org.objectweb.cjdbc.console.text.commands.controller.SaveConfiguration;
00042 import org.objectweb.cjdbc.console.text.commands.controller.Shutdown;
00043 
00044 /**
00045  * This class defines a ControllerConsole
00046  * 
00047  * @author <a href="mailto:Nicolas.Modrzyk@inria.fr">Nicolas Modrzyk </a>
00048  * @version 1.0
00049  */
00050 public class ControllerConsole extends AbstractConsoleModule
00051 {
00052 
00053   /**
00054    * Creates a new <code>ControllerConsole.java</code> object
00055    * 
00056    * @param console the controller console is attached to
00057    */
00058   public ControllerConsole(Console console)
00059   {
00060     super(console);
00061   }
00062 
00063   /**
00064    * @see org.objectweb.cjdbc.console.text.module.AbstractConsoleModule#loadCommands()
00065    */
00066   protected void loadCommands()
00067   {
00068     commands.add(new AddDriver(this));
00069     commands.add(new RefreshLogs(this));
00070     commands.add(new Shutdown(this));
00071     commands.add(new GetXml(this));
00072     commands.add(new Report(this));
00073     commands.add(new SaveConfiguration(this));
00074     commands.add(new GetInfo(this));
00075     commands.add(new ListDatabases(this));
00076     commands.add(new Load(this));
00077     commands.add(new Admin(this));
00078     commands.add(new Bind(this));
00079     commands.add(new Connect(this));
00080     commands.add(new Monitor(this));
00081     commands.add(new DropDB(this));
00082   }
00083 
00084   /**
00085    * @see org.objectweb.cjdbc.console.text.module.AbstractConsoleModule#quit()
00086    */
00087   public void quit()
00088   {
00089     quit = true;
00090     console.println("");
00091     console.println(ConsoleTranslate.get("console.byebye"));
00092     //System.exit(0);
00093   }
00094 
00095   /**
00096    * @see org.objectweb.cjdbc.console.text.module.AbstractConsoleModule#getPromptString()
00097    */
00098   public String getPromptString()
00099   {
00100     return console.getJmxClient().getRemoteName();
00101   }
00102 
00103   /**
00104    * @see org.objectweb.cjdbc.console.text.module.AbstractConsoleModule#login(String[])
00105    */
00106   public void login(String[] params)
00107   {
00108     // do nothing
00109   }
00110 
00111   /**
00112    * @see org.objectweb.cjdbc.console.text.module.AbstractConsoleModule#getDescriptionString()
00113    */
00114   public String getDescriptionString()
00115   {
00116     return "Controller";
00117   }
00118 }

Generated on Mon Apr 11 22:01:30 2005 for C-JDBC by  doxygen 1.3.9.1