Class ThreadLocalContext

  • java.lang.Object
    • com.thingworx.webservices.context.ThreadLocalContext

  • @ThingworxExtensionApiClass(since={6,6},
                                canInstantiate=true)
    public final class ThreadLocalContext
    extends java.lang.Object
    A container for all session-managed objects.

    The ThreadLocalContext class contains all objects that are tied to a request. This includes but is not limited to the session data, the authorized account that made the request, the transaction success state, events that have been queued for processing, and the entity (if any) the current request is being made against.

    Security contexts are managed in a stack-like manner. That is, the most recently set security context is returned by ThreadLocalContext#getSecurityContext() and clearing a security context will move the previously set security context to the top.

    See Also:
    SecurityContext, TransactionFactory