|
Oracle Fusion Middleware Oracle WebLogic Server API Reference 11g Release 1 (10.3.5) Part Number E13941-05 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object weblogic.diagnostics.context.DiagnosticContextHelper
public final class DiagnosticContextHelper
Use this class to provide applications limited access to the
diagnostic context. Applications can access, but not set, the
immutable context ID attribute for a diagnostic context. Each
context is assigned an immutable ID when created. The context also
contains a dye vector (a bit vector). Each bit in the dye vector
indicates the presence of a dye in the diagnostic context.
Dye bits in the dye vector correspond to different properties of
the request for which the diagnostic context is created. For
example, dye USER1 indicates that the request was originated by a
specific user. Applications can inspect dyes in the diagnostic
context. They can also modify a subset of dye flags in the dye
vector for their own use, identified by DYE_0
through
DYE_7
.
Field Summary |
---|
Fields inherited from interface weblogic.diagnostics.context.DiagnosticContextConstants |
---|
ADDR1, ADDR2, ADDR3, ADDR4, CONNECTOR1, CONNECTOR2, CONNECTOR3, CONNECTOR4, COOKIE1, COOKIE2, COOKIE3, COOKIE4, DYE_0, DYE_1, DYE_2, DYE_3, DYE_4, DYE_5, DYE_6, DYE_7, PROTOCOL_HTTP, PROTOCOL_IIOP, PROTOCOL_JRMP, PROTOCOL_RMI, PROTOCOL_SSL, PROTOCOL_T3, THROTTLE, USER1, USER2, USER3, USER4 |
Constructor Summary | |
---|---|
DiagnosticContextHelper()
|
Method Summary | |
---|---|
static String |
getContextId()
The immutable identifier for the current diagnostic context, which is unique within the domain. |
static String[] |
getDyeFlagNames()
An array of valid dye flag names. |
static String |
getPayload()
The user payload inserted in the diagnostic context. |
static boolean |
isDyedWith(byte dye)
Tests whether the diagnostic context is marked with the given dye. |
static long |
parseDyeMask(String mask)
Parses a comma-separated string of dye flag names, and returns the corresponding dye mask. |
static long |
parseDyeMask(String[] maskNames)
Parses an array of dye flag names, and returns the corresponding dye mask. |
static void |
setDye(byte dye,
boolean enable)
Sets an application-available dye flag ( DYE_0
throughDYE_7 ) to be used to mark the diagnostic
context. |
static void |
setPayload(String payload)
Sets the value of the Payload attribute. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DiagnosticContextHelper()
Method Detail |
---|
public static String getContextId()
The immutable identifier for the current diagnostic context, which is unique within the domain.
public static void setDye(byte dye, boolean enable) throws InvalidDyeException
Sets an application-available dye flag (DYE_0
throughDYE_7
) to be used to mark the diagnostic
context.
dye
- The dye whose value is to be setenable
- the value of the dye, true
to dye, false
to undye
InvalidDyeException
- if dye index is out of rangepublic static boolean isDyedWith(byte dye) throws InvalidDyeException
Tests whether the diagnostic context is marked with the given dye. All dye flags [0...63] can be inspected by application code.
dye
- The dye to check
true
if context is dyed with given context; false otherwise.
InvalidDyeException
- if dye index is out of range.public static String getPayload()
The user payload inserted in the diagnostic context. A payload is an arbitrary string which you insert into the context for later retrieval.
public static void setPayload(String payload)
Sets the value of the Payload attribute.
payload
- user payloadDiagnosticContextHelper.getPayload()
public static long parseDyeMask(String mask)
Parses a comma-separated string of dye flag names, and returns
the corresponding dye mask. For example:
USER1,ADDR1
.
public static long parseDyeMask(String[] maskNames)
Parses an array of dye flag names, and returns the
corresponding dye mask. For example:
["USER1", "ADDR1"]
.
public static String[] getDyeFlagNames()
An array of valid dye flag names.
|
Copyright 1996, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Oracle WebLogic Server API Reference 11g Release 1 (10.3.5) Part Number E13941-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |