CORBA 2.6 Programmer's Guide for Java
The trace file information and other configuration data used by the trace facility must be specified in the NonStop
CORBA configuration before the call (see How to Enable Tracing).
Trace Methods
The methods shown below are provided to simplify the task of adding trace statements to your application code.
// trace data method
static void trace(String trace_data);
// trace method
void trace(String trace_data);
These methods open the trace file and write the trace message.
Note:
To specifically close the trace file, you must call Config_Trace.close_trace_file(). If you do
not call this method, the trace facility closes the trace file when the current process exits.
Trace Settings for Application Processes
To enable tracing for an NonStop CORBA client or server process, set one or more environment variables prior to
running the process. For a client process, setting NSDOM_CFG_TRACE_PROXY to TRUE is a useful starting point. If
more detail is needed, enable one or more of the protocol trace variables (depending on the protocols in use by the
client). For a server process, setting NSDOM_CFG_TRACE_POA to 1 is a useful starting point. If more detail is needed,
enable NSDOM_CFG_TRACE_ORB or enable one or more of the protocol trace variables (depending on the protocols in
use by the server).
Simple Tracing Example
The following example shows how to add a trace message to your code using a trace method. In the example, a
message is written to the default ASCII trace file.
import com.tandem.nsdom.Config.Config_Trace;
void {
// Perform trace operation
Config_Trace.trace ("User_routine trace");
...
}
How the Trace Facility Interface Works
As a user of the trace facility, you do not need to know how the actual API calls are done. You should use the trace
methods provided. However, you might find it useful to know how these methods work. All tracing is managed through
the trace interface. When this class is loaded, a default trace object is automatically created. You can obtain the default
trace object by using get_default. The public section of com.tandem.nsdom.Config.Config_Trace
contains six methods as shown in the following example:
//com.tandem.nsdom.Config.Config_Trace Class
public Config_Trace(String pp_file_name) {
public void close_trace_file();
public static Config_trace get_default();