MultithreadedCallerContextService Class

An ICallerContextService implementation suitable for multi-threaded applications.
Inheritance Hierarchy

Namespace:  Dundas.BI.Services
Assembly:  Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (24.3.0.1000)
Syntax
public class MultithreadedCallerContextService : CallerContextService

The MultithreadedCallerContextService type exposes the following members.

Constructors
  NameDescription
Public methodMultithreadedCallerContextService
Initializes a new instance of the MultithreadedCallerContextService class.
Top
Properties
  NameDescription
Public propertyCurrentContext
Gets an object representing the current caller context.
(Inherited from CallerContextService.)
Public propertyCurrentWindowsIdentity
Gets the WindowsIdentity associated with the caller.
(Inherited from CallerContextService.)
Public propertyIsMultithreaded
Gets a value indicating whether the service supports different callers between threads.
(Overrides CallerContextServiceIsMultithreaded.)
Protected propertyStoredContext
Gets or sets the context that is actually stored by a derived class.
(Overrides CallerContextServiceStoredContext.)
Public propertyWillCreatedContextBeThreadAgnostic
Gets a value indicating whether a caller context created on the current thread will be thread-agnostic.
(Inherited from CallerContextService.)
Top
Methods
  NameDescription
Public methodCloneAndSetCurrentContext
Clones the provided caller context and associates it with the current caller.
(Inherited from CallerContextService.)
Public methodCloneAndSetCurrentContextIfRequired
Ensures that the properties of the specified context are associated with the current thread.
(Inherited from CallerContextService.)
Public methodCreateAndSetCurrentContext
Creates a new context object and associates it with the current caller.
(Inherited from CallerContextService.)
Public methodCreateContext
Creates a context object initialized with a session ID.
(Inherited from CallerContextService.)
Public methodDestroyCurrentContext
Disposes the current context (if there is one) and replaces it with a new one.
(Inherited from CallerContextService.)
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from CallerContextService.)
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources.
(Overrides CallerContextServiceDispose(Boolean).)
Protected methodFinalize
Finalizes an instance of the CallerContextService class.
(Inherited from CallerContextService.)
Public methodQueueBackgroundTask(Action, TimeSpan, CancellationToken)
Runs an action after a specified delay.
(Inherited from CallerContextService.)
Public methodQueueBackgroundTaskT(FuncT, TimeSpan, CancellationToken)
Runs an action after a specified delay.
(Inherited from CallerContextService.)
Protected methodSetContextAsThreadAgnostic
Marks the specified context as thread agnostic.
Public methodSpawnTaskTResult
Creates an asynchronous task which inherits the properties of the current caller context.
(Inherited from CallerContextService.)
Public methodTryGetCurrentContext
Gets the active caller context.
(Inherited from CallerContextService.)
Top
Remarks

This implementation assumes that any specific thread is only associated with one Session at a time, by storing the session internally using a ThreadLocalT field.

Depending on the circumstances, this may or may not be appropriate for web servers.

See Also