Java Dynamic Management Kit 3.2 Programming Guide | ||||
---|---|---|---|---|
![]() | ![]() | Appendix B. Environment Variables and System Properties | ![]() | ![]() |
In addition to the information contained in environment variables, certain components of the Java Dynamic Management Kit have parameters which can be set by the user. These include working directories for some of the services and other information such as cipher suites when security is required. These parameters are given a default value which you can override by defining the appropriate system properties on the command line.
Since all parameters have a default value, the components that require them can be used without any configuration. You only need to set the system properties if you wish to initialize these parameters with a different value.
The Java Dynamic Management components which can be configured through a system property are all agent-side services. The only exceptions to this are the cipher suites which configure the HTTP/SSL adaptor for both the agent and the client. Otherwise, only Java Dynamic Management agents can be configured by specifying system properties.
Table B-4 gives the name of each system property specific to the Java Dynamic Management Kit. In addition, it describes the parameter and component that each property affects and the default value in the absence of any property definition. Since most parameters contain a file or directory name, both their default value and any user-specified value are platform-dependent.
Property: Description
| Solaris Default Value |
---|---|
Windows NT Default Value | |
jaw.acl.file: Specifies the ACL (access control list) file used by the SNMP adaptor | installDir/SUNWconn/jaw/etc/conf/acl.file |
installDir\SUNWconn\jaw\etc\conf\acl.file | |
jaw.launcher.path: Specifies the path (possibly more than one directory) where the launcher service will look for the HTML files to be loaded | installDir/SUNWconn/jaw/etc/launch |
installDir\SUNWconn\jaw\etc\launch | |
jaw.mlet.cache.dir: Specifies the directory used for caching by the m-let cache and versioning service | installDir/SUNWconn/jaw/var/mletcache |
installDir\SUNWconn\jaw\var\mletcache | |
jaw.net.library.path: Specifies the path where the native libraries will be stored before the network class and library loader loads them into memory | installDir/SUNWconn/jaw/tmp |
installDir\SUNWconn\jaw\tmp | |
jaw.mlet.library.dir: Specifies the directory where native libraries will be stored before the m-let service loads them into memory | installDir/SUNWconn/jaw/tmp |
installDir\SUNWconn\jaw\tmp | |
jaw.bootstrap.library.dir: Specifies the directory where the native libraries will be stored before the bootstrap service loads them into memory | installDir/SUNWconn/jaw/tmp |
installDir\SUNWconn\jaw\tmp | |
jaw.ssl.cipher.suite.n: Specifies the list of the SSL cipher suites to be enabled by the HTTP/SSL adaptor, where n = 1, 2, 3, ... | implementation-dependent |
implementation-dependent |
Note - In this table, installDir is the directory under which the Java Dynamic Management Kit was installed, including the drive letter on Windows NT platforms. The location of this directory is determined from the contents of the CLASSPATH environment variable, which usually contains its absolute path. When this is not the case, the value of installDir is that of the user's current working directory.
The default values for the cipher suite properties depend upon the SSL implementation you choose for your Java Dynamic Management application. The SSL implementation also determines the possible cipher suite values you may assign to these properties.
Java Dynamic Management Kit components check for system properties to override their default settings only once during their initialization. Thereafter, calling the component's corresponding setter method will permanently override both the default value and any value set by a system property.
If you wish to set a system property, you must specify its new value when launching your Java Dynamic Management application. There are two ways to set the value of a property; they are the same on all platforms:
Set individual properties on the java command line with the -D option
Define all desired properties in a file whose name is then specified on the command line
To set individual properties on the command line you should use the -D option of the Java application launcher. The syntax of this option is the following: -Dproperty=value. This option is available on all platforms, however, the value given to the property will be platform-dependent. For example, to set the cache directory for the m-let service on a Solaris platform, use the following command when launching the default agent:
Example B-1. Setting a property with the -D option
prompt% java -Djaw.mlet.cache.dir=$HOME/mycache com.sun.jaw.impl.base.Main |
You may define any number of properties in this way on the same command line. However, when setting more than one property, it may be more convenient to use a properties file.
To set properties using a properties file, you must first create the file as explained below in The Properties File. Then you specify the full path and name of this file on the command line as the first argument to the application. This mechanism applies to all platforms, however, the name of the properties file is platform-dependent. For example, to specify a properties file on the Windows NT platform, use the following commands when launching the default agent:
Example B-2. Specifying a properties file
C:\> java com.sun.jaw.impl.base.Main C:\myDir\myProperties.txt |
You may set properties with both the -D option and the properties file at the same time. However, if you set the same property in both ways, the value specified in file overrides the one on the command line as well as the default values.
When implementing your own Java Dynamic Management application, you must explicitly load the properties file for its definitions to take effect. See Loading the Properties File below for how to do this. The default base agent contained in the com.sun.jaw.impl.base.Main class includes code to do this and may therefore be configured using a properties file.
The properties file is a plain text file which contains one or more system property definitions. A property definition is made up of a separate line containing a name-value pair in the following format: propertyName=value. Lines beginning with the # character are comments and are not taken into account. The complete syntax of a properties file is defined by the load method of the java.util.Properties class.
An example of a properties file is given on each platform. The name of the file is:
Operating Environment | Example Properties File |
---|---|
Solaris | installDir/SUNWconn/jaw/lib/jaw.properties |
Windows NT | installDir\SUNWconn\jaw\lib\jaw.properties |
This example file contains a definition for each Java Dynamic Management system property, where the sample value for each is the default value it overrides, as given in Table B-4. You may therefore edit and uncomment the definition of those properties that you wish to be different from their default value.
When editing this file, you should be careful not to change the spelling of any of the property names. Should you inadvertantly do so, your definition will not be taken into account, and the corresponding component parameter will keep its default value.
All name-value pairs in this file will be loaded into the system properties when the name of the file is given on the application's command line. You may therefore add your own properties by assigning each a distinct name and pairing them with a value in the same way as the other definitions. Your properties will then be accessible in the same manner as other system properties through the java.lang.System.getProperty methods.
When implementing your own Java Dynamic Management application, your code must explicitly load the properties file for its definitions to take effect. In order to do so, you must call the com.sun.jaw.impl.common.JawProperties.load method at the start of your application. Example B-3 shows how to do this.
Example B-3. Loading the properties file in application code
// one of the first things your application should do: if( args.length > 0 ) { try { com.sun.jaw.impl.common.JawProperties.load( args[0] ); Debug.println("Properties loaded from file " + args[0]); } catch (Exception e) { System.err.println("Error reading properties file. Using default values."); } } |
If you do not load the properties file in your code, your application will not be configurable through the properties file mechanism. However, you will still be able to define system properties using the -D option of the Java application launcher.
![]() | ![]() | ![]() |
Windows NT Environment | ![]() | Java Packages Supplied With the Java Dynamic Management Kit |