Class WorkHandler
  
  Represents a base for all work handlers. Handlers are final work execution destination
 
  
  
    Inheritance
    System.Object
    
    
    WorkHandler
      
      
      
      
      
      
   
  
    Implements
    
    System.IDisposable
    
    
   
  
    Inherited Members
    
    
    
    
    
    
    
    
    
    
    
    
    
      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)
    
   
  
  Assembly: NFX.Wave.dll
  Syntax
  
    public abstract class WorkHandler : ApplicationComponent, IApplicationComponent, IDisposable, INamed, IOrdered
   
  Constructors
  
  
  
  
  WorkHandler(WorkDispatcher, IConfigSectionNode)
  
  
  Declaration
  
    protected WorkHandler(WorkDispatcher dispatcher, IConfigSectionNode confNode)
   
  Parameters
  
  
  
  
  WorkHandler(WorkDispatcher, String, Int32, WorkMatch)
  
  
  Declaration
  
    protected WorkHandler(WorkDispatcher dispatcher, string name, int order, WorkMatch match)
   
  Parameters
  
  Fields
  
  
  
  CONFIG_HANDLER_SECTION
  
  
  Declaration
  
    public const string CONFIG_HANDLER_SECTION = "handler"
   
  Field Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  Properties
  
  
  
  
  Dispatcher
  Returns the dispatcher that this handler works under
 
  
  Declaration
  
    public WorkDispatcher Dispatcher { get; }
   
  Property Value
  
  
  
  
  Filters
  Returns ordered registry of filters
 
  
  Declaration
  
    public IRegistry<WorkFilter> Filters { get; }
   
  Property Value
  
  
  
  
  Matches
  Returns matches used by this handler. May change the registry at runtime (inject/remove matches)
 
  
  Declaration
  
    public OrderedRegistry<WorkMatch> Matches { get; }
   
  Property Value
  
  
  
  
  Name
  Returns the handler instance name
 
  
  Declaration
  
    public string Name { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  NetGate
  Returns network gate that handler implementation may use to set business variables or null
 
  
  Declaration
  
    public INetGate NetGate { get; }
   
  Property Value
  
  
  
  
  Order
  Returns the handler order in handler registry. Order is used for URI pattern matching
 
  
  Declaration
  
    public int Order { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Int32 | 
         | 
      
    
  
  
  
  
  ParentHandler
  Returns parent handler that this handler is under or null
 
  
  Declaration
  
    public WorkHandler ParentHandler { get; }
   
  Property Value
  
  
  
  
  Server
  Returns the server that this handler works under
 
  
  Declaration
  
    public WaveServer Server { get; }
   
  Property Value
  
  Methods
  
  
  
  
  Destructor()
  
  
  Declaration
  
    protected override void Destructor()
   
  Overrides
  
  
  
  
  DoHandleWork(WorkContext)
  Override to handle the work - i.e. render a template page or call MVC controller method.
Note: This method is re-entrant by multiple threads
 
  
  Declaration
  
    protected abstract void DoHandleWork(WorkContext work)
   
  Parameters
  
  
  
  
  FilterAndHandleWork(WorkContext)
  Handles the work -  first involes all filters then calls HandleWork to do actual processing
Note: This method is re-entrant by multiple threads
 
  
  Declaration
  
    public void FilterAndHandleWork(WorkContext work)
   
  Parameters
  
  
  
  
  HandleWork(WorkContext)
  Handles the work - i.e. renders a template page or calls MVC controller method.
This method does not pass through handler's filters
Note: This method is re-entrant by multiple threads
 
  
  Declaration
  
    public void HandleWork(WorkContext work)
   
  Parameters
  
  
  
  
  MakeMatch(WorkContext)
  Returns true when the particular work request matches the pattern match of this handler.
Also sets the WorkHandler's MatchedVars property filled with matched values
 
  
  Declaration
  
    public virtual bool MakeMatch(WorkContext work)
   
  Parameters
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
  
  
  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
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
  
  
  ToString()
  
  
  Declaration
  
    public override string ToString()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  Overrides
  System.Object.ToString()
  
  
  
  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
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  Implements
  
  
      System.IDisposable
  
  
  
  Extension Methods