|
Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
||||||||||
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_6, DYE_7, PROTOCOL_HTTP, PROTOCOL_IIOP, PROTOCOL_JRMP, PROTOCOL_RMI, PROTOCOL_SSL, PROTOCOL_T3, THROTTLE, USER1, USER2, USER3, USER4 |
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 long |
getDyeVector() Return the dye vector of the diagnostic context. |
static int |
getLogLevel() Gets the log level currently set into the diagnostic context. |
static String |
getPayload() Deprecated. |
static String |
getRID() Return the relationship-id of the diagnostic context. |
static void |
handleLocalContextAsNonInheritable() Provides the DiagnosticContext management a hint that locally formed DiagnostContext's on the current thread of execution will not be propagated. |
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 |
setApplicationDye(byte dye, boolean enable) Sets an application-available dye flag ( DYE_0 throughDYE_7 ) to be used to mark the diagnostic context. |
static void |
setDye(byte dye, boolean enable) Deprecated. use setApplicationDye instead |
static void |
setLogLevel(int level) Sets the specified log level into the diagnostic context. |
static void |
setPayload(String payload) Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 undyeInvalidDyeException
- if dye index is out of rangepublic static void setApplicationDye(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 undyeInvalidDyeException
- 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 checktrue
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.
public static String getRID()
public static int getLogLevel()
public static void setLogLevel(int level)
level
- log level that needs to be set into the diagnostic context.public static long getDyeVector()
public static void handleLocalContextAsNonInheritable()
|
Copyright 1996, 2015, 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 Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |