org.objectweb.cjdbc.controller.console
Class Console

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.console.Console

public class Console
extends java.lang.Object

This is the C-JDBC controller console that allows remote administration and monitoring of any C-JDBC controller.

Version:
1.0
Author:
Emmanuel Cecchet, Mathieu Peltier

Field Summary
private  VirtualDatabaseAdmin adminModule
          Virtual database administration console.
private static java.lang.String bindName
          Name used to bind the controller in the RMI registry.
static CommandCompletorInterface COMPLETOR
          Command completor to use.
private  VirtualDatabaseConsole consoleModule
          Virtual database console.
private  ConsoleHelperInterface helper
          Interface to the console helper.
private static java.lang.String host
           
private static ControllerJmxClient jmx
           
private static java.lang.String port
           
 
Constructor Summary
Console(ConsoleHelperInterface helper)
          Creates a new Console instance.
 
Method Summary
private  void addDriver(java.lang.String filename)
          Sends a driver JAR file to the controller.
private  void bind()
          Binds a C-JDBC controller.
private static org.apache.commons.cli.Options createOptions()
          Creates Options object that contains all available options that can be used launching C-JDBC console.
private  void echo(java.lang.String echo)
           
private  void getDump()
           
private  void getInfo()
          Gets information from the C-JDBC controller.
 void handlePrompt()
          Main menu prompt handling.
private  void help()
          Displays the help message.
private  void loadXML(java.lang.String filename)
          Sends a XML configuration file to the controller.
static void main(java.lang.String[] args)
          Launchs the C-JDBC console.
private static void printUsage(org.apache.commons.cli.Options options)
          Displays usage message.
private  void refreshLog()
          Forces logging system configuration refresh.
private  void shutdown(java.lang.String level)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPLETOR

public static final CommandCompletorInterface COMPLETOR
Command completor to use.


helper

private ConsoleHelperInterface helper
Interface to the console helper.


bindName

private static java.lang.String bindName
Name used to bind the controller in the RMI registry.


jmx

private static ControllerJmxClient jmx

host

private static java.lang.String host

port

private static java.lang.String port

adminModule

private VirtualDatabaseAdmin adminModule
Virtual database administration console.


consoleModule

private VirtualDatabaseConsole consoleModule
Virtual database console.

Constructor Detail

Console

public Console(ConsoleHelperInterface helper)
Creates a new Console instance.

Parameters:
helper - console helper
Method Detail

bind

private void bind()
           throws java.lang.Exception
Binds a C-JDBC controller.

Throws:
java.lang.Exception - if a error occurs

getInfo

private void getInfo()
              throws java.lang.Exception
Gets information from the C-JDBC controller.

Throws:
java.lang.Exception - if a error occurs

refreshLog

private void refreshLog()
Forces logging system configuration refresh.


getDump

private void getDump()

loadXML

private void loadXML(java.lang.String filename)
              throws java.lang.Exception
Sends a XML configuration file to the controller.

Parameters:
filename - XML configuration file name
Throws:
java.lang.Exception

shutdown

private void shutdown(java.lang.String level)

echo

private void echo(java.lang.String echo)

addDriver

private void addDriver(java.lang.String filename)
Sends a driver JAR file to the controller.

Parameters:
filename - name of the file

help

private void help()
Displays the help message.


handlePrompt

public void handlePrompt()
Main menu prompt handling.


main

public static void main(java.lang.String[] args)
Launchs the C-JDBC console. The available options are:

If no host name, port number or controller name are specified, else the default ControllerConstants.DEFAULT_NAMEhost name, the default org.objectweb.cjdbc.controller.ControllerConstants#DEFAULT_RMI_PORT port value and the default 'ControllerConstants.DEFAULT_NAME' controller name are used.

Parameters:
args - command line arguments (see above)

createOptions

private static org.apache.commons.cli.Options createOptions()
Creates Options object that contains all available options that can be used launching C-JDBC console.

Returns:
an Options instance

printUsage

private static void printUsage(org.apache.commons.cli.Options options)
Displays usage message.

Parameters:
options - available command line options


Copyright © 2002, 2003 - ObjectWeb Consortium - All Rights Reserved.