GShell

GShell is a command-line processor for creating command-line applications for administering the Geronimo server. GShell supports command editing, command history, I/O redirection, and so on. Geronimo administration commands such as startup, shutdown, and deploy are implemented by using GShell. In this section, we will see how GShell can be used to administer a Geronimo server.

Starting and exiting GShell

GShell can be started by using the script file gsh provided in the <GERONIMO_HOME>/bin directory. The GShell window is shown below:

The quit or exit command will exit from the GShell environment.

Getting help

Use the help command to get a list of supported commands. To get help on any command, use the --help option with that command. The following screenshot shows help for the geronimo/start-server command:

The first column shows the long and short form of each option, and the second column provides an explanation of the option.

Supported commands

The GShell environment supports the following commands:

  • geronimo/start-server: Starts a Geronimo server. If the --background option is not used, then the server will run in the shell, and you will need to open another shell to interact with the server.

  • geronimo/stop-server: Stops a Geronimo server. Use the --hostname and --port options to specify the RMI host and port of the server to be stopped. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • geronimo/start-client: Starts an application client. Specify the configuration name of the application client and the application client arguments on the command line.

  • geronimo/wait-for-server: Waits for the start of a Geronimo server to complete the startup. Use the --hostname and --port options to specify the RMI host and port of the server to be stopped. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/connect: Connects to a running Geronimo server such that further deploy commands will not require the host, port, username, and password to be specified, until disconnected. Use the --hostname and --port options to specify the RMI host and port of the server to connect to. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/disconnect: Disconnects a Geronimo server that was connected earlier by using deploy/connect.

  • deploy/distribute: Executes the distribute deployer operation. Specify the module and plan files as arguments. Use the --inPlace option to specify in-place deployment. Use the --targets option to specify the deployment target configuration stores. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/restart: Restarts a running configuration and any running child configurations. Specify the configuration ID as an argument. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/install-plugin: Installs a plugin into the Geronimo server. Specify the plugin file as an argument. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/deploy: Deploys the specified module and/or plan file. Specify the module and plan files as arguments. Use the --inPlace option to specify in-place deployment. Use the --targets option to specify the deployment target configuration stores. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/redeploy: Redeploys a specified module and/or plan file. Specify the module file, plan file, and the configuration ID as arguments. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/undeploy: Uninstalls a specified configuration. Specify the configuration ID as an argument. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/list-modules: List the configurations deployed on the server. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/install-library: Installs a specified library file in the repository. Specify the group ID by using the --groupId option. Artifact ID, version, and type will be determined based on the file name. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/list-targets: Lists the available target configuration stores on the server. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/stop: Stops a specified configuration and any child configurations that are running. Specify the configuration ID as an argument. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/start: Starts a specified configuration and any parent configurations that are currently not running. Specify the configuration ID as an argument. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/list-plugins: Lists the available plugins in a plugin repository. Specify the repository URL by using the --repository option. Use the option --refresh-list to refresh the plugin list. Use the option --refresh-repository to refresh the repository. This is an interactive command. If a repository is not specified, then you will be able to select a repository from the plugin repositories that have been added to the server. Once the list of plugins is displayed, you will have the option to install the plugins by providing the number in the displayed list. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/assemble: Assembles a server from the current server with some or all of the configurations on the current server. Specify the group ID, artifact ID, and version by using the --groupId, --artifact, and --version options. Specify an archive format of .zip or tar.gz by using the option --format. Use the --path option to specify the location of the assembly relative to the <GERONIMO_HOME> directory. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. You will be prompted for the username and password if you have not specified the credentials by using the --username and --password options.

  • deploy/login: Saves the username and password for this connection so that further deployment operations to this connection will not require the user credentials to be specified. Use the --hostname and --port options to specify the RMI host and port of the target server. The default values are localhost and 1099. Use the --username option to specify the username and --password option to specify the password.

  • jaxws/wsimport: Generates JAX-WS artifacts from WSDL. Run the command with the --help option to get detailed information on running the command.

  • jaxws/wsgen: Generates JAX-WS artifacts from a class. Run the command with the --help option to get detailed information on running the command.

The following are some general purpose commands supported by GShell:

  • source: Loads a file or URL into the current shell. Use this command to execute a command script that has been saved to a file.

  • set: Sets a variable.

  • unset: Unsets a variable.

  • help: Shows the online help for a command.

  • clear: Clears the terminal screen.

  • ?: Alias for help.

  • echo: Echoes or prints arguments to STDOUT.

  • quit: Alias for exit.

  • exit: Exits the shell.

  • . (dot): Alias for source.

  • print: Alias for echo

These commands can be used to create rich command scripts to administer a Geronimo server.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset