RNI uses data resources stored in the file system in standard locations relative to the Basis root directory (
$BT_ROOT). Accordingly, you must follow a few basic rules when you are assembling an application that includes RNI functionality.
Prior to accessing the RNI API, you must set the Basis root directory.
RNI maintains singleton Environment objects for maintaining read-only shared data. Depending on the operations you perform, you may need to explicitly instantiate an Environment object before you perform these operations and close the Environment object when you are done.
Setting the Basis Root Directory
The API provides two ways of performing this action:
com.basistech.util.Pathnames.setBTRootDirectory (String BT_ROOT).
bt.root system property. You can do this from the command line when you launch the Java virtual machine:
$BT_ROOT is the path to the Basis root directory.
Manipulating the Environment
Before you use Rosette Name Translator (RNT), you must instantiate a
com.basistech.rnt.RNTEnvironment object. For example:
RNTEnvironment rntEnv = new RNTEnvironment();
RNTEnvironment uses data files stored in the file system according to the standard RLP release hierarchy. Accordingly, you must set the Basis root directory prior to instantiating
If your RLP license is not
RNTEnvironment include a
setLicenseXML() method that you can use to provide the license as a String.
When you have finished performing translations, you should close the
RNTEnvironment object to free resources. For example:
When you use Rosette Name Indexer, RNI-RNT instantiates an
RNTEnvironment object as required. If RNI-RNT instantiates an
RNTEnvironment object, it also closes it at the appropriate time.