Framework Commands

This document describes the main commands for the mBS framework.

Contents:


Introduction

mBS consumers can execute essential monitoring and configuration operations on the framework from its prompt (console and Telnet). There are default commands for the framework that the Parser Service of the ProSyst Util Bundle maintains. The Console Bundle and the Telnet Bundle map command input and execution results to the local and Telnet consoles, respectively. See "Text Console" for more information about setting up and using the text console.

The commands of the framework are divided in two groups:

Tip: You can add your own groups of commands to the console by registering pluggable commands in the framework so that the Parser Service detects and plugs them into its command set. For more information about implementing commands, refer to the description of the Parser Service.

Prerequisites to Use Framework Commands

To employ the capabilities of the basic framework commands, consider the following requirements:

System Commands

System commands are collected in the system command group. Call these commands to move through command groups, set system properties, receive help about a command, execute a ready script of framework commands, view consumed memory, listen for bundle and service events, and define an alias for fast command invocation.

Tip: You can use these command from any group from the framework console.


System Command Shortcut Description
alias [options] [alias]|[alias=cmd] al Defines an alias for the specified console command.
  • To delete a specified alias, use the -d, -D option.
  • To delete all aliases, use the -d, -D option without parameters

To list all available command aliases, call this command with no parameters and options.

By default, aliases are valid only during the current runtime session. Set the mbs.parser.aliases.store system property to true to persistently store command aliases.

cd <group>|.. - Moves to the specified command group. Use ".." to move to the system group.
cmdlist cmdls Lists all commands of the current group.
[group.]command? - Prints the help message about the specified command in the specified group, if any. See the description of the help command.
[group.]command [parameters]& - Executes the command in a separate thread. Use this variant if the command to have access to the console input right after the command is parsed. This is useful when the command is expected to take quite a lot of time and you do not want to wait until it finishes.
dump - Forwards the System.out stream to the current output that can be the Telnet output, MC remote console, etc. so that runtime information being dumped can be seen at this output. The command should be issued from a console application that remotely uses the Parser Service for executing commands on the framework. Such an application is for example the mConsole remote console.
exec <URL> - Executes a script from the specified URL. The passed URL is attached to the one set with the mbs.exec.base system property - <exec_base_URL><script_URL>.
exit e Exits the mBS framework.
gc - Calls the VM garbage collector that cleans all unused objects.
[group]/ - Moves you to the specified group. If you do not specify a group, you enter the system group.
groups gr Lists all command groups that are currently available.
help [options][<group>[ <group>]] h, ? Prints the help messages about the specified groups. This command has options to specify the type of requested help:

-d Prints the full description of a command group.
-s Prints information about the commands' shortcuts.

If you do not explicitly specify a group, the description of the commands in the current group is printed.

listen [options] - Registers service and/or bundle listeners. The available command options are:

-s, -S Registers a service listener. When a service event occurs, information about the service that originated it is printed.
-b, -B Registers a bundle listener. When a bundle event takes place, information about the bundle that originated it is printed.
-f, -F Registers a framework listener. When a framework event occurs, information about the event is printed (e.g. refereshed bundle package dependencies).

If you do not specify an option, you register a service listener, a bundle listener and a framework listener. To unregister a listener, type listen with the relevant option once again.

meminfo <timeout> mi Starts displaying information about the memory currently used. The memory is scanned every time the specified timeout interval (in seconds) passes. To stop the display of memory usage, type meminfo once again.
platforminfo [options] pi

Prints all information about the service platform including information bout the OS and JVM, the active threads, the system properties, the bundles and their services, etc.

The -f, -F option of the platforminfo command writes the platform information to the specific file. The file location can be relative to the JVM working directory, that is to the directory in which the framework has been started.

set [options] <name> [=<value>] -

Shows or sets the value of the specified system property. This command has the following options:

-c, -C Lists all properties containing the specified name.
-s, -S Lists all properties starting with the specified name.
-e, -E Lists all properties ending with the specified name.
-r, -R Removes the property with the specified name.
-i, -I Ignores the case when filtering system properties. This option must be used together with the -c, -s or -e option.
type <URL> - Types the resource content found at the specified URL.
resetthreadpool rstp Resets the idle threads in the thread pool - all idle threads will exit and new ones will be created only if needed.

FW Group Commands

Through the commands of the fw group you can supervise bundles, retrieve registered services, activate debugging modes, and enable garbage collecting.

FW Group Command Shortcut Description
csg - Clears the uninstalled bundles and unused data from the framework storage (the bin/vms/<vm_name>storage).
debug [<level> [ <level>]
|<options>]
d

Switches on the debug levels:

0 No debug
1 Debug of Framework core
2 Debug of Package Manager
3 Debug of Service Manager
4 Debug of Event Manager
5 Debug of Bundle Manager
6 Debug about class loading in the used Class Provider
7 Debug of Storage
8 Debug about loading the boot INI
9 Debug of available URL Handlers
10 Basic debug of security
11 Intermediate debug of security
12 Full debug of security
13 Debug of Resource Manager
14 Debug of start levels management
15 Debug of Framework Access service
16 Debug of Fault Manager
17 Debug of Certificate Manager

To switch on all debug levels, use the -a, -A option.
To view the current debug mode, use debug with no parameters.
extinfo <ID> ei Prints information about associated fragments for a specified host bundle or about the relevant host for specified fragment bundle.
install [options] <URL>[ <URL>] i Installs a bundle from an URL or JAR file in the local system. The options that this command supports are:

-s Starts the bundle right after it has been installed.
-S Starts the bundle after all other bundles that are in a process of installation, are installed.
-f Installs the bundles "from file" without copying its JAR file in the framework persistent storage area.
-l Starts the bundle taking into account registered lazy services or declared lazy start conditions.
-d <dir_name> Installs the bundle "from file" storing it in the specified destination - the bundle JAR file is placed in a bundles subdirectory and the manifest and data files - in a data directory. It is not necessary to additionally specify the -f option along with this install command option.
list [options] ls

Lists all bundles on the framework displaying their bundle IDs, states and the names of the JAR files. This command supports the following options:

-i, -I Lists bundles by ID (default mode).
-sn, -SN Lists bundles with their symbolic names and versions.
-n, -N Lists bundles by name.
-l, -L Lists bundles with their full locations as passed at installation.
-b, -B Lists bundles in reverse manner. Should be used with one of the first four option.
-s, -S Sorts bundles in conventional manner. Should be used with one of the first four option.
-c, -C Ignores the case of the sorting criterion. Should be used with one of the first four options.
pkginfo [<package>[ <package>]] - Shows the dependencies of the specified package(s). If there are no parameters, you receive information about all packages available in the framework.
manifest <ID>[ <ID>] mf Displays the information in the manifest file(s) of the bundle(s) with the specified bundle ID(s) or URLs.
refreshpackages <ID>[ <ID>] rp Refreshes the packages exported by the bundle(s) with the specified ID(s) or URLs.
required <symbolic_name> rq Shows the required bundles with the specified symbolic name.
resolve <ID>[ <ID>] r Tries to resolve the bundle with the specified ID.
restart [options] <ID>[ <ID>] rs Restarts the bundle(s) with the specified bundle ID(s) or URLs. The options of this command are -o and -O. Both stand for restarting the bundles in the specified order.
services [options] <ID>[ <ID>] serv Lists the services of the specified bundle(s). The services command has the options:

-p, -P Shows information about the service properties defined at registration.
-b, -B Shows the bundles that use the services of the specified bundle.
-u, -U Shows the services used by the specified bundle.
start [options] <ID>[ <ID>] - Starts the bundle(s) with the specified bundle ID(s).

The start command takes the -l option, which starts the bundle(s) by preserving its (their) lazy features if any.

stop <ID>[ <ID>] - Stops the bundle(s) with the specified bundle ID(s).
startlevel [options] <ID> [<level>] sl

Changes the start level of the framework or of the bundle with the specified ID or URL. If no level is entered, then only shows the bundle start level. This command has the following options:

-fwsl [level] Changes the start level of the framework to the specific one. If no level is entered, the command shows the start level of the framework.
-ibsl [level] Changes the initial start level of bundles. If no level is provided, the command prints the current initial bundle start level.
svcinfo <service_class> si Prints extensive information about the service objects implementing the specified class.
sysmode sm Enables or disables operations on the system bundles (they have the system category).
uninstall <ID>[ <ID>] un Uninstalls the bundle(s) with the specified bundle ID(s).
update [options] <ID>[ <ID>] up

Updates the specified bundle(s) without stopping the framework. This command has the following options:

-k, -K Preserves the old bundle data in the storage when the bundle is updated.
-l:<URL> Updates the bundle from the specified URL.
updatemode <mode> um

Changes the update mode. It can be lazy and eager.

In eager mode, when a bundle is updated, the framework restarts all bundles that are dependent on it.

In lazy mode, when a bundle is updated, none of its dependent bundles is restarted. This mode saves resources and memory.

General Rules for Using Framework Commands

  1. To switch to a group, for example to http, type cd http or http/. Using only / takes you to the system group.
  2. To execute a command of a group different from the current one, use the syntax <group>.<command> where <group> stands for the name of desired group and <command> is the name of the command.
  3. To separate command parameters, use spaces.
  4. In the fw command group, you may pass URLs as input parameters besides bundleIDs.
  5. To pass a list of bundleIDs as parameter to a command, use <start_ID>-<end_ID>. For example:
    fw.manifest 1-10
  6. If installing a bundle from the Framework Professional Edition Package and the ../../../bundles value of the mbs.bundles.base system property is preserved, then you may specify only the bundle JAR. For example instead of specifying the full path of the Preferences Bundle:
    fw.install c:/mbserver/bundles/prefs.jar
    you may type:
    fw.install prefs.jar

    Tip: You may set mbs.bundles.base to the directory hosting most of the bundles that you are to use and then only type bundles' JAR names.

  7. To avoid waiting until time-taking command A completes its job in order to issue then command B, you can attach "&" at the end of command A. For example:
    fw.manifest 1-10&
  8. Options of are applied to the command entry that comes after. For example the command
    install prefs.jar -s cuadmin.jar
    will install prefs.jar and will install and start cuadmin.jar.

Getting Help about a Command

This chapter contains useful tips on getting information about supported groups and commands in the framework console.


Getting Started