Running BBj from the Command Line


When invoking BBj, command line options may be used.

bbj {-?} {-a<string>} {-c<configuration file>} {-d} {-n<string>}

{-q} {-t<terminal alias>} {-u<user id>} {-CP<classpath name>}

{-FC} {-LF<look and feel>} {-LO} {-LP<local port number>}

{-MDI<mdiMode>} {-RH<host name>} {-RP<port number>}

{-SC} {-SMN<min seconds>} {-SMX<max seconds>}

{--keystore=<keystore> --keypass=<keystore password>}

{--message="BBjSessionInfo message"}

{-TC} {-WD<working directory>} {-TCPSpreload} {-TCPSto<secs>} {-TCPShb<secs>}

{<program> {- <arglist>}}

Parameter Description

?

Displays a usage statement.

a<string>

Associates the SysConsole settings with a particular application so that the size, font, and position of the SysConsole are saved when the session is closed and recalled when the SysConsole is invoked again with a particular application name. Can be used with the -n<string> parameter to create a two-part name/application key.

c<configuration file>

Name of the configuration file on the remote machine to use.

d

Invokes BBj in debug mode. In this mode, when BBj drops to console, debugging takes place in the BBj WinConsole.

n<string>

Associates the SysConsole settings with a particular name, so that the size, font, and position of the SysConsole are saved when the session is closed and recalled when the SysConsole is invoked again with a particular name. Can be used with the -a<string> parameter to create a two-part name/application key.

q

Suppresses the start-up message and is useful when running PRO/5 in background.

t<terminal alias>

The alias of a terminal specified in the configuration file. FID(0) will return this alias in the Thin Client program.

u<user id>

Specifies the user account to be used for Data Server and AppServer access.

CP<classpath name>

Specifies the session-specific classpath for the session. See Session-Specific Classpath (SSCP).

FC

Runs in Fat Client mode (non-Thin Client).

This option has been obsolete since BBj 5.00.

LF<look and feel>

In BBj 5.0 and higher, this specifies the look and feel the BBj session uses. Valid options are:

default

Use the look and feel of the native operating system. Windows look and feel when running Windows, Mac look and feel running on a Mac, "cross" for cross-platform, etc. For example:

bbj –Lfdefault.

cross

Use the default Java look and feel: "ocean" in JVMs 1.5 and higher, and "metal" in JVMs prior to 1.5.

none Do not attempt to set or change the look and feel in any way. This is intended for use with a launcher program such as skinit, which sets the look and feel before BBj is started.
skinlf:theme (deprecated)

Deprecated in BBj 20.00 and higher.

Use the skinlf.jar look and feel.

You may use a filename or a URL to specify the specific theme, but you must use forward slashes for the path separator regardless of platform. For example, to

  • use a file

  • use a URL

bbj -LFskinlf:themepack.zip

bbj -LFskinlf:http://mydomain.com/themepack.zip

vpro5 Emulates the Visual PRO/5 look and feel on all platforms, regardless of operating system.

LO

Loads but does not run the specified program

LP

Specifies the Port Request Server's (PRS) port. The executable connects to the PRS to get the appropriate port to use to connect to the ThinClientProxyServer. By default, the PRS uses port 2008. The PRS's port may be changed using the Enterprise Manager.

MDI<mdiMode>

In 9.0 and higher, specifies the mdiMode that will be used if this command is being executed within a MDI environment.

RH<host name>

Specifies the machine name or IP address of the server on which the ThinClientServer (TCS) or SecureThinClientServer (STCS) if using the -SC argument) resides. The executable connects to the ThinClientProxyServer (TCPS) on the local machine (refer to -LP<local port number>). The TCPS connects to the TCS (or STCS) on the machine specified by this argument using either the default port or the port specified with the option -RP<remote port number>.

RP<port number>

Specifies the ThinClientServer's (TCS) port on the remote machine. 

The executable connects to the ThinClientProxyServer (TCPS) on the local machine (see -LP<local port number>). The TCPS makes the connection to the remote machine (specified with the -RH<host name> argument) using the remote port number. If no remote port number is specified, the default port, 2003, is used. When using the -SC flag, the TCPS connects to the SecureThinClientServer (STCS). The STCS default port is 2103. The ports used by TCS and STCS can be changed using Enterprise Manager.

SC

Specifies a secure connection between the Thin Client and the Thin Client Server.

SMN<min seconds>

In BBj 19.22 and higher, the splash minimum setting specifies the minimum number of seconds to show the BBj splash window. This setting will not apply if the -q option is specified. The default value is 2 seconds.

The splash window will close if the BBj Interpreter terminates before the splash minimum time has been reached.

SMX<max seconds>

In BBj 19.22 and higher, the splash maximum setting specifies the maximum number of seconds to show the BBj splash window. This setting will not apply if the -q option is specified. The default value is 300 seconds (5 minutes).

The splash window will stop displaying before the maximum splash time in the following cases:

  • A BBj GUI program is run and begins processing events either through a call to PROCESS_EVENTS or READ RECORD.

  • A SysWindow or SysConsole becomes visible.

  • A MsgBox is displayed.

  • A program escape or error occurs.

  • The BBj interpreter exits.

keystore=<keystore>

Specify a keystore to validate the SSL/TLS certificate from the secure Thin Client Server. This is only useful for the SC option if a custom keystore has been configured for the secure Thin Client Server.

keypass=<keystore password>

Specify the password for the keystore specified by the keystore option.

message="<BBjSessionInfo message>" In BBj 23 and higher, this option specifies the fallback message for BBjSessionInfo::getMessage if STBL("!SESSIONINFO") is not set.

TC

Runs the interpreter in Thin Client mode

WD<working directory>

Specifies the server directory in which BBj will start

TCPSpreload

In BBj 17.00 and higher, the BBj.exe/bbjinit executable checks with the PortRequestServer to see if a ThinClientProxyServer for the user/host/display is running. If one is not running, the executable starts up the TCPS.

In either case, whether it starts a TCPS or one is already running, the executable terminates without starting an interpreter.

(Note: no license is checked out since no interpreter is started.)

TCPSto<secs>

In BBj 17.00 and higher, if the TCPS is started by this invocation of the executable, <secs> is passed to the TCPS as the "death wait" timeout.

The "death wait" timeout is how long the TCPS stays up with no clients connected before terminating.

This can be used to keep the TCPS up and running so it is not restarted each time a new BBj session is started.

This overrides the property

         com.basis.bbj.comm.ThinClientProxyServer.waitTime

found in the BBj.properties file. This allows the timeout to be set differently for individual TCPSs.

TCPShb<secs>

In BBj 17.00 and higher, if the TCPS is started by this invocation of the executable, <secs> is passed to the TCPS as the "heartbeat" timeout.

The "heartbeat" timeout is used by the TCPS to check the status of the ProxyManagerServer (PMS). If the PMS goes down, then the TCPS shuts down. Normally, the PMS is started as part of BBjServices, so when  BBjServices is shutdown the PMS is also shutdown.

<program>

Name of the program on the remote machine to run.

<arglist> The arguments to pass to the BBj program.

Exiting BBj

To exit BBj console mode, enter "RELEASE" or "BYE" to return to the host operating system.

NOTE: Never exit BBj or any BBj application by turning off or rebooting your computer. Any files that are still open may be corrupted by this improper procedure.

Examples

bbj -TC -RHfudd -cAcctConfig.bbx accounting.bbj

bbj -TC –SC -RHfudd -cAcctConfig.bbx -tT23 accounting.bbj

bbj -TC -RHfudd -cAcctConfig.bbx -tT23 accounting.bbj

bbj -TC -RH3045 -cAcctConfig.bbx accounting.bbj

bbj -TC accounting.bbj

In the final example below, the bbj executable connects to the PortRequestServer (PRS) on the local machine using port 3010. The executable gets the appropriate ThinClientProxyServer's (TCPS) port from the PRS. Once connected to the TCPS on the local machine, the TCPS connects to the ThinClientServer using port 4003 on the remote host johnny. This example also shows how to pass arguments in BBj, just as in PRO/5.

bbj -LP3010 -RHjohnny -RP4003 - arg1 arg2

If the following invocation would start a ThinClientProxyServer (TCPS), it starts one with a death wait of 1 hour (3600 seconds) and a ProxyManagerServer (PMS) heartbeat of 5 minutes (300 seconds).

bbj -TCPSpreload -TCPSto3600 -TCPShb300

The TCPS started by this invocation would stay up one hour without any clients connected. Once all clients disconnect and the hour has passed without any new clients, the TCPS will shutdown.

Additionally, the TCPS pings the PMS every 5 minutes. If BBjServices shutdowns (which would shutdown the PMS) the TCPS shutdowns after the next heartbeat check (within 5 minutes).

See Also

BBjServices Overview