Class WorkFilter
Represents a base for all work filters. Unlike handlers, filters do not necessarily handle work rather augment the work context
Inheritance
Inherited Members
Namespace: Azos.Wave
Assembly: Azos.Wave.dll
Syntax
public abstract class WorkFilter : ApplicationComponent, IDisposable, IApplicationComponent, INamed, IOrdered
Constructors
WorkFilter(WorkDispatcher, IConfigSectionNode)
Declaration
protected WorkFilter(WorkDispatcher dispatcher, IConfigSectionNode confNode)
Parameters
Type | Name | Description |
---|---|---|
WorkDispatcher | dispatcher | |
IConfigSectionNode | confNode |
WorkFilter(WorkDispatcher, String, Int32)
Declaration
protected WorkFilter(WorkDispatcher dispatcher, string name, int order)
Parameters
Type | Name | Description |
---|---|---|
WorkDispatcher | dispatcher | |
System.String | name | |
System.Int32 | order |
WorkFilter(WorkHandler, IConfigSectionNode)
Declaration
protected WorkFilter(WorkHandler handler, IConfigSectionNode confNode)
Parameters
Type | Name | Description |
---|---|---|
WorkHandler | handler | |
IConfigSectionNode | confNode |
WorkFilter(WorkHandler, String, Int32)
Declaration
protected WorkFilter(WorkHandler handler, string name, int order)
Parameters
Type | Name | Description |
---|---|---|
WorkHandler | handler | |
System.String | name | |
System.Int32 | order |
Fields
CONFIG_FILTER_SECTION
Declaration
public const string CONFIG_FILTER_SECTION = "filter"
Field Value
Type | Description |
---|---|
System.String |
Properties
ComponentLogTopic
Declaration
public override string ComponentLogTopic { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Dispatcher
Returns the dispatcher that this filter works under
Declaration
public WorkDispatcher Dispatcher { get; }
Property Value
Type | Description |
---|---|
WorkDispatcher |
Handler
Returns the handler that this filter works under. May be null if the filter works under dispatcher
Declaration
public WorkHandler Handler { get; }
Property Value
Type | Description |
---|---|
WorkHandler |
Name
Returns the filter instance name
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
NetGate
Returns network gate that filter implementation may use to set business variables or null
Declaration
public INetGate NetGate { get; }
Property Value
Type | Description |
---|---|
INetGate |
Order
Returns the filter order in filter registry. Order is used for URI pattern matching
Declaration
public int Order { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Server
Returns the server that this filter works under
Declaration
public WaveServer Server { get; }
Property Value
Type | Description |
---|---|
WaveServer |
Methods
DoFilterWork(WorkContext, IList<WorkFilter>, Int32)
Override to filter the work - i.e. extract some security name from cookies and check access, turn exception in error page etc. Note: This method is re-entrant by multiple threads. Do not forget to call InvokeNextWorker() to continue request processing, otherwise the work will not be handled (which may be a desired behavior)
Declaration
protected abstract void DoFilterWork(WorkContext work, IList<WorkFilter> filters, int thisFilterIndex)
Parameters
Type | Name | Description |
---|---|---|
WorkContext | work | Work context |
System.Collections.Generic.IList<WorkFilter> | filters | The filters that participated in a call. Note the Dipatcher.Filters may yield different results as it may change with time, whereas this parameter captures all filters during the call start |
System.Int32 | thisFilterIndex | The index of THIS filter in filters |
FilterWork(WorkContext, IList<WorkFilter>, Int32)
Override to filter the work - i.e. extract some security name from cookies and check access, turn exception in error page etc. Note: This method is re-entrant by multiple threads
Declaration
public void FilterWork(WorkContext work, IList<WorkFilter> filters, int thisFilterIndex)
Parameters
Type | Name | Description |
---|---|---|
WorkContext | work | Work context |
System.Collections.Generic.IList<WorkFilter> | filters | The filters that participated in a call. Note the Dipatcher.Filters may yield different results as it may change with time, whereas this parameter captures all filters during the call start |
System.Int32 | thisFilterIndex | The index of THIS filter in filters |
InvokeNextWorker(WorkContext, IList<WorkFilter>, Int32)
Invokes next processing body be it the next filter or handler (when all filters are iterated through). The filter implementors must call this method to pass WorkContext processing along the line. Does nothing if work is Aborted or Handled
Declaration
protected void InvokeNextWorker(WorkContext work, IList<WorkFilter> filters, int thisFilterIndex)
Parameters
Type | Name | Description |
---|---|---|
WorkContext | work | |
System.Collections.Generic.IList<WorkFilter> | filters | |
System.Int32 | thisFilterIndex |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |