Show / Hide Table of Contents

Class WorkDispatcher

Represents a default dispatcher that dispatches WorkContext calls on the same thread that calls Dispatch(work). May extend this class to implement custom dispatchers, i.e. the once that maintain their won work queue/worker threads

Inheritance
System.Object
DisposableObject
ApplicationComponent
Service
Service<WaveServer>
WorkDispatcher
Implements
IApplicationComponent
System.IDisposable
IService
INamed
IConfigurable
ILocalizedTimeProvider
Inherited Members
Service<WaveServer>.ComponentDirector
Service.CONFIG_NAME_ATTR
Service.ApplicationDontAutoStartService
Service.Status
Service.Running
Service.Name
Service.TimeLocation
Service.LocalizedTime
Service.Configure(IConfigSectionNode)
Service.Start()
Service.SignalStop()
Service.CheckForCompleteStop()
Service.WaitForCompleteStop()
Service.AcceptManagerVisit(Object, DateTime)
Service.UniversalTimeToLocalizedTime(DateTime)
Service.LocalizedTimeToUniversalTime(DateTime)
Service.AbortStart()
Service.DoStart()
Service.DoSignalStop()
Service.DoCheckForCompleteStop()
Service.DoWaitForCompleteStop()
Service.CheckServiceInactive()
Service.CheckServiceActive()
Service.CheckServiceActiveOrStarting()
Service.DoAcceptManagerVisit(Object, DateTime)
Service.____ObtainPrivateServiceStatusLockObject()
ApplicationComponent.AllComponents
ApplicationComponent.GetAppComponentBySID(UInt64)
ApplicationComponent.GetAppComponentByCommonName(String)
ApplicationComponent.ComponentSID
ApplicationComponent.ComponentStartTime
ApplicationComponent.ComponentCommonName
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX.Wave
Assembly: NFX.Wave.dll
Syntax
public class WorkDispatcher : Service<WaveServer>, IApplicationComponent, IDisposable, IService, INamed, IConfigurable, ILocalizedTimeProvider

Constructors

WorkDispatcher(WaveServer)

Declaration
public WorkDispatcher(WaveServer director)
Parameters
Type Name Description
WaveServer director

Properties

Filters

Returns ordered registry of filters

Declaration
public IRegistry<WorkFilter> Filters { get; }
Property Value
Type Description
IRegistry<WorkFilter>

Handlers

Returns ordered registry of handlers

Declaration
public IRegistry<WorkHandler> Handlers { get; }
Property Value
Type Description
IRegistry<WorkHandler>

Methods

Destructor()

Declaration
protected override void Destructor()
Overrides
Service.Destructor()

Dispatch(WorkContext)

Dispatches work into appropriate handler passing through filters. The default implementation processes requests on the calling thread and disposes WorkContext deterministically

Declaration
public virtual void Dispatch(WorkContext work)
Parameters
Type Name Description
WorkContext work

DoConfigure(IConfigSectionNode)

Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node
Overrides
Service.DoConfigure(IConfigSectionNode)

GetWorkHandler(WorkContext)

Finds the most appropriate work handler to do the work. The default implementation finds first handler with matching URI pattern or null

Declaration
public virtual WorkHandler GetWorkHandler(WorkContext work)
Parameters
Type Name Description
WorkContext work
Returns
Type Description
WorkHandler

HandleException(WorkContext, WorkFilter, WorkHandler, Exception)

Handles processing exception - this implementation uses server-wide behavior. All parameters except ERROR can be null - which indicates error that happened during WorkContext dispose

Declaration
public virtual void HandleException(WorkContext work, WorkFilter filter, WorkHandler handler, Exception error)
Parameters
Type Name Description
WorkContext work
WorkFilter filter
WorkHandler handler
System.Exception error

InvokeHandler(WorkContext, out WorkHandler)

Finds appropriate handler and invokes it. Returns the appropriate handler or null if work was aborted or already handled. Throws if appropriate handler was not found

Declaration
public virtual void InvokeHandler(WorkContext work, out WorkHandler handler)
Parameters
Type Name Description
WorkContext work
WorkHandler handler

RegisterFilter(WorkFilter)

Registers filter and returns true if the named instance has not been registered yet Note: it is possible to call this method on active server that is - inject filters while serving requests

Declaration
public bool RegisterFilter(WorkFilter filter)
Parameters
Type Name Description
WorkFilter filter
Returns
Type Description
System.Boolean

RegisterHandler(WorkHandler)

Registers handler and returns true if the named instance has not been registered yet Note: it is possible to call this method on active server that is - inject handlers while serving requests

Declaration
public bool RegisterHandler(WorkHandler handler)
Parameters
Type Name Description
WorkHandler handler
Returns
Type Description
System.Boolean

UnRegisterFilter(WorkFilter)

Unregisters filter and returns true if the named instance has been removed Note: it is possible to call this method on active server that is - remove filters while serving requests

Declaration
public bool UnRegisterFilter(WorkFilter filter)
Parameters
Type Name Description
WorkFilter filter
Returns
Type Description
System.Boolean

UnRegisterHandler(WorkHandler)

Unregisters handler and returns true if the named instance has been removed Note: it is possible to call this method on active server that is - remove handlers while serving requests

Declaration
public bool UnRegisterHandler(WorkHandler handler)
Parameters
Type Name Description
WorkHandler handler
Returns
Type Description
System.Boolean

Implements

IApplicationComponent
System.IDisposable
IService
INamed
IConfigurable
ILocalizedTimeProvider

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX