Class TypeLookupHandler<TTarget>
Represents a base handler for all handlers that dynamically resolve type that performs actual work
Inheritance
System.Object
TypeLookupHandler<TTarget>
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: Azos.Wave.dll
Syntax
public abstract class TypeLookupHandler<TTarget> : WorkHandler, IDisposable, IApplicationComponent, INamed, IOrdered where TTarget : class
Type Parameters
Constructors
TypeLookupHandler(WorkDispatcher, IConfigSectionNode)
Declaration
protected TypeLookupHandler(WorkDispatcher dispatcher, IConfigSectionNode confNode)
Parameters
TypeLookupHandler(WorkDispatcher, String, Int32, WorkMatch)
Declaration
protected TypeLookupHandler(WorkDispatcher dispatcher, string name, int order, WorkMatch match)
Parameters
Fields
CONFIG_CLOAK_TYPE_ATTR
Declaration
public const string CONFIG_CLOAK_TYPE_ATTR = "cloak-type"
Field Value
Type |
Description |
System.String |
|
CONFIG_DEFAULT_TYPE_ATTR
Declaration
public const string CONFIG_DEFAULT_TYPE_ATTR = "default-type"
Field Value
Type |
Description |
System.String |
|
CONFIG_NOT_FOUND_REDIRECT_URL_ATTR
Declaration
public const string CONFIG_NOT_FOUND_REDIRECT_URL_ATTR = "not-found-redirect-url"
Field Value
Type |
Description |
System.String |
|
VAR_INSTANCE_ID
Declaration
public const string VAR_INSTANCE_ID = "instanceID"
Field Value
Type |
Description |
System.String |
|
VAR_TARGET_TYPE
Declaration
public const string VAR_TARGET_TYPE = "type"
Field Value
Type |
Description |
System.String |
|
Properties
CloakTypeName
Provides type name which is used if the prior one was not found. This allows to block 404 errors,
i.e. if page with requested name is not found then always return the specified page
Declaration
public string CloakTypeName { get; set; }
Property Value
Type |
Description |
System.String |
|
DefaultTypeName
Provides default type name
Declaration
public string DefaultTypeName { get; set; }
Property Value
Type |
Description |
System.String |
|
NotFoundRedirectURL
Provides redirect URL where the user gets redirected when type name could not be resolved.
Note: CloakTypeName is used first when set.
Declaration
public string NotFoundRedirectURL { get; set; }
Property Value
Type |
Description |
System.String |
|
SupportsInstanceID
Indicates whether instance IDs are supported in requests. Default is false.
Override to return true for handlers that support target instance state between requests
Declaration
public virtual bool SupportsInstanceID { get; }
Property Value
Type |
Description |
System.Boolean |
|
TypeLocations
Returns a registry of type locations
Declaration
public TypeLocations TypeLocations { get; }
Property Value
Methods
CreateTargetInstance(WorkContext, Type)
Factory method - Override to create and initialize more particular template implementation (i.e. based on model)
Declaration
protected virtual TTarget CreateTargetInstance(WorkContext work, Type tt)
Parameters
Returns
Do404(WorkContext)
Override to handle 404 condition, i.e. may write into response instead of generating a exception.
The default implementation returns a HttpStatusException with 404 code
Declaration
protected virtual HTTPStatusException Do404(WorkContext context)
Parameters
Returns
DoError(WorkContext, Exception)
Override to handle error processing, i.e. may elect to write error data into response.
The default implementation throws the error. It is recommended to handle errors with filters instead
Declaration
protected virtual void DoError(WorkContext work, Exception error)
Parameters
Type |
Name |
Description |
WorkContext |
work |
|
System.Exception |
error |
|
DoHandleWork(WorkContext)
Sealed. Override DoTargetWork(TTarget, WorkContext) to do actual work
Declaration
protected override sealed void DoHandleWork(WorkContext work)
Parameters
Overrides
DoTargetWork(TTarget, WorkContext)
Performs work on the target instance
Declaration
protected abstract void DoTargetWork(TTarget target, WorkContext work)
Parameters
GetTargetType(WorkContext)
Override to resolve route/URL parameters to type
Declaration
protected virtual Type GetTargetType(WorkContext work)
Parameters
Returns
Type |
Description |
System.Type |
|
GetTargetTypeNameFromWorkContext(WorkContext)
Override to get type name from WorkContext. Default implementation looks for MatchedVars[VAR_TARGET_TYPE]
Declaration
protected virtual string GetTargetTypeNameFromWorkContext(WorkContext work)
Parameters
Returns
Type |
Description |
System.String |
|
Implements
System.IDisposable
Extension Methods