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:
- The first four forms send a text message to the trace file:
- The first form sends the specified text message to the
trace file.
- The second form sends the message with the specified message
number (msgNum) from the ODA message file.
- The third form also sends the message with the specified
message number (msgNum) from the ODA message file. It also
provides the ability to send up to three String message
parameters (msgParameters) to be inserted in the message
before sending the message to the trace destination.
- The fourth form also sends a message from the ODA message file
and provides message parameters. However, with this form you can
send the message parameters as elements in a Java Vector,
paramArray.
For information on ODA message files, see Message files. For information on
message parameters, see Using
parameter values.
- The fifth form sends a dump of a business object definition to
the trace file. This dump is formatted in the format of the
repos_copy utility and has the following basic format:
[BusinessObjectDefinition]
Name=busObjName
AppSpecificInfo=business-object-level application-specific information
[Attribute]
Name=attribute1
Type=attribute type
Cardinality=n or 1
AppSpecificInfo=attribute-level application-specific information
other attribute properties
[End]
...
- The sixth form sends a dump of the specified agent
properties to the trace file. This dump. The forward
argument provides introductory text that clarifies the
message.
See also
getMsg()
