trace()

Writes a message to the trace file.

Syntax

public void trace(int level, int msgType, String message);
 
public void trace(int level, int msgNum, int msgType);
 public void trace(int level, int msgNum, int msgType, msgParameters);
 public void trace(int level, int msgNum, int msgType, Vector paramArray);
 
public void trace(int level, int msgType, BusObjDef boDef);
 
public void trace(int level, int msgType, AgentProperty[] properties,
    String foreword);
 

Parameters

boDef
Is the business object definition to be written to the trace file.
foreword
Is a String that clarifies the message before the properties property array--for example, "These are the properties for the Object Discovery Agent".
level
Is the trace level, specified as one of the following trace-level constants:
ODKConstant.TRACELEVEL0
 
  
 ODKConstant.TRACELEVEL1
 
  
 ODKConstant.TRACELEVEL2
 
  
 ODKConstant.TRACELEVEL3
 
  
 ODKConstant.TRACELEVEL4
 
  
 ODKConstant.TRACELEVEL5
 
 
message
Is the String message to be written to the trace file.
msgNum
Specifies the message number in the message file.
msgParameters
Is an optional list of up to three String parameter values, each corresponding to a parameter in the message list.
msgType
Is the type of message, specified as one of the following message-type constants:
ODKConstant.XRD_FATAL
 
  
 ODKConstant.XRD_ERROR
 
  
 ODKConstant.XRD_URGENTWARNING
 
  
 ODKConstant.XRD_WARNING
 
  
 ODKConstant.XRD_INFO
 
  
 ODKConstant.XRD_TRACE
 
 
paramArray
A vector of parameters to be inserted in the message.
properties
Is an array of agent-property (AgentProperty) objects to be written to the trace file.

Return values

None.

Exceptions

IllegalArgumentException
Thrown if the properties argument is null or the msgType argument is invalid.

Notes

The trace() method sends the specified information to the trace file when the trace level is less than or equal to the system trace level. The system trace level is set through the TraceLevel configuration property, which Business Object Wizard automatically includes in the ODA configuration properties. A trace level of zero (0) activates error logging; that is, trace() sends an error message to the trace file. The non-zero trace levels, shown in Table 106, activate tracing; that is, trace() sends a trace message to the trace file.

Table 106. Trace levels for an ODA

Trace level Description Trace-level constant
0 Log an error message. TRACELEVEL0
1 Trace whenever a method is entered. Usually provides status messages and key information for each business object definition. TRACELEVEL1
2 Trace the agent properties and the values received. TRACELEVEL2
3 Trace the name of the business object definition. Usually provides the business-object properties and the values received. TRACELEVEL3
4 Trace a message whenever a method is entered and exited. Record the spawning of all threads. TRACELEVEL4
5 Indicate the ODA initialization. Provide the values for all agent properties retrieved, a detailed status of each thread that the ODA has spawned, and a dump of the business object definition. TRACELEVEL5

The user establishes the name of the ODA's trace destination through the TraceFileName configuration property, which the ODK automatically includes in the ODA startup properties. Therefore, tracing cannot begin until after the init() method (which receives initialized startup properties) starts.

The trace() method provides the following forms:

See also

getMsg()

Copyright IBM Corp. 1997, 2003