Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ResourceHandlersSectionHandler Class

Handler for Spring.NET resourceHandlers config section.

For a list of all members of this type, see ResourceHandlersSectionHandler Members .

System.Object
   ResourceHandlersSectionHandler

[Visual Basic]
Public Class ResourceHandlersSectionHandler
    Implements IConfigurationSectionHandler
[C#]
public class ResourceHandlersSectionHandler : IConfigurationSectionHandler

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Spring allows registration of custom resource handlers that can be used to load object definitions from.

For example, if you wanted to store your object definitions in a database instead of in the config file, you could write a custom IResource implementation and register it with Spring using 'db' as a protocol name.

Afterwards, you would simply specify resource URI within the context config element using your custom resource handler.

Example

The following example shows how to configure both this section handler, how to define custom resource within Spring config section, and how to load object definitions using custom resource handler:

  <configuration>
    <configSections>
      <sectionGroup name="spring">
        <section name="resourceHandlers" type="Spring.Context.Support.ResourceHandlersSectionHandler, Spring.Core" />
      </sectionGroup>
    </configSections>
    <spring>
      <resourceHandlers>
        <handler protocol="db" type="MyCompany.MyApp.Resources.MyDbResource, MyAssembly" />
      </resourceHandlers>
      <context>
        <resource uri="db://user:pass@dbName/MyDefinitionsTable" />
      </context>
    </spring>
  </configuration>

Requirements

Namespace: Spring.Context.Support

Assembly: Spring.Core (in Spring.Core.dll)

See Also

ResourceHandlersSectionHandler Members | Spring.Context.Support Namespace | IResource