Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | Oracle
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weblogic.diagnostics.context
Class DiagnosticContextHelper

    java.lang.Object
      weblogic.diagnostics.context.DiagnosticContextHelper

All Implemented Interfaces:
  DiagnosticContextConstants

    public final class DiagnosticContextHelper

extends Object
implements DiagnosticContextConstants

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` through`DYE_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

### DiagnosticContextHelper

    public DiagnosticContextHelper()

Method Detail

### getContextId

    public static String getContextId()

  The immutable identifier for the current diagnostic context, which is unique within the domain.

  Returns:
    unique id of the current diagnostic context

### setDye

    public static void setDye(byte dye,
                              boolean enable)
                       throws InvalidDyeException

  Sets an application-available dye flag (`DYE_0` through`DYE_7`) to be used to mark the diagnostic context.

  Parameters:
    `dye` - The dye whose value is to be set
    `enable` - the value of the dye, `true` to dye, `false` to undye
  Throws:
    `InvalidDyeException` - if dye index is out of range

### isDyedWith

    public 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.

  Parameters:
    `dye` - The dye to check
  Returns:
    `true` if context is dyed with given context; false otherwise.
  Throws:
    `InvalidDyeException` - if dye index is out of range.

### getPayload

    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.

  Returns:
    user payload in the diagnostic context. Returns null if none exists.

### setPayload

    public static void setPayload(String payload)

  Sets the value of the Payload attribute.

  Parameters:
    `payload` - user payload
  See Also:
    `DiagnosticContextHelper.getPayload()`

### parseDyeMask

    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`.

### parseDyeMask

    public static long parseDyeMask(String[] maskNames)

  Parses an array of dye flag names, and returns the corresponding dye mask. For example: `["USER1", "ADDR1"]`.

### getDyeFlagNames

    public static String[] getDyeFlagNames()

  An array of valid dye flag names.

  Returns:
    Names of available dye flags.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://edocs.bea.com/wls/docs103 Copyright 1996,2008, 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.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD