C# Class Spring.Context.Support.WebApplicationContext

Web application context, taking the context definition files from the file system or from URLs. Treats resource paths as web resources, when using IApplicationContext.GetResource. Resource paths are considered relative to the virtual directory. Note: In case of multiple config locations, later object definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain object definitions via an extra XML file.
Inheritance: Spring.Context.Support.AbstractXmlApplicationContext
Show file Open project: spring-projects/spring-net Class Usage Examples

Public Methods

Method Description
GetContext ( string virtualPath ) : IApplicationContext

Returns the web application context for the given (absolute!) virtual path

GetRootContext ( ) : IApplicationContext

Returns the root context of this web application

ToString ( ) : string

returns detailed instance information for debugging

WebApplicationContext ( ) : System

Create a new WebApplicationContext, loading the definitions from the given XML resource.

WebApplicationContext ( WebApplicationContextArgs args ) : System

Initializes a new instance of the WebApplicationContext class.

WebApplicationContext ( string name, bool caseSensitive ) : System

Create a new WebApplicationContext, loading the definitions from the given XML resource.

WebApplicationContext ( string name, bool caseSensitive, IApplicationContext parentContext ) : System

Create a new WebApplicationContext with the given parent, loading the definitions from the given XML resources.

WebApplicationContext ( string name, bool caseSensitive, string configurationLocations, IResource configurationResources ) : System

Create a new WebApplicationContext, loading the definitions from the given XML resource.

Protected Methods

Method Description
CreateObjectFactory ( ) : Spring.Objects.Factory.Support.DefaultListableObjectFactory

Creates web object factory for this context using parent context's factory as a parent.

CreateXmlObjectDefinitionReader ( Spring.Objects.Factory.Support.DefaultListableObjectFactory objectFactory ) : Spring.Objects.Factory.Xml.XmlObjectDefinitionReader

Create a reader instance capable of handling web objects (Pages,Controls) for importing o bject definitions into the specified objectFactory.

InitObjectDefinitionReader ( Spring.Objects.Factory.Xml.XmlObjectDefinitionReader objectDefinitionReader ) : void

Initializes object definition reader.

Private Methods

Method Description
GetContextInternal ( string virtualPath ) : IApplicationContext
GetContextPathWithTrailingSlash ( ) : string

Returns the application-relative virtual path of this context (without leading '~'!).

OnContextRegistryCleared ( object sender, EventArgs ev ) : void

EventHandler for ContextRegistry.Cleared event. Discards webContextCache.

Method Details

CreateObjectFactory() protected method

Creates web object factory for this context using parent context's factory as a parent.
protected CreateObjectFactory ( ) : Spring.Objects.Factory.Support.DefaultListableObjectFactory
return Spring.Objects.Factory.Support.DefaultListableObjectFactory

CreateXmlObjectDefinitionReader() protected method

Create a reader instance capable of handling web objects (Pages,Controls) for importing o bject definitions into the specified objectFactory.
protected CreateXmlObjectDefinitionReader ( Spring.Objects.Factory.Support.DefaultListableObjectFactory objectFactory ) : Spring.Objects.Factory.Xml.XmlObjectDefinitionReader
objectFactory Spring.Objects.Factory.Support.DefaultListableObjectFactory
return Spring.Objects.Factory.Xml.XmlObjectDefinitionReader

GetContext() public static method

Returns the web application context for the given (absolute!) virtual path
public static GetContext ( string virtualPath ) : IApplicationContext
virtualPath string
return IApplicationContext

GetRootContext() public static method

Returns the root context of this web application
public static GetRootContext ( ) : IApplicationContext
return IApplicationContext

InitObjectDefinitionReader() protected method

Initializes object definition reader.
protected InitObjectDefinitionReader ( Spring.Objects.Factory.Xml.XmlObjectDefinitionReader objectDefinitionReader ) : void
objectDefinitionReader Spring.Objects.Factory.Xml.XmlObjectDefinitionReader Reader to initialize.
return void

ToString() public method

returns detailed instance information for debugging
public ToString ( ) : string
return string

WebApplicationContext() public method

Create a new WebApplicationContext, loading the definitions from the given XML resource.
public WebApplicationContext ( ) : System
return System

WebApplicationContext() public method

Initializes a new instance of the WebApplicationContext class.
public WebApplicationContext ( WebApplicationContextArgs args ) : System
args WebApplicationContextArgs The args.
return System

WebApplicationContext() public method

Create a new WebApplicationContext, loading the definitions from the given XML resource.
public WebApplicationContext ( string name, bool caseSensitive ) : System
name string The application context name.
caseSensitive bool Flag specifying whether to make this context case sensitive or not.
return System

WebApplicationContext() public method

Create a new WebApplicationContext with the given parent, loading the definitions from the given XML resources.
public WebApplicationContext ( string name, bool caseSensitive, IApplicationContext parentContext ) : System
name string The application context name.
caseSensitive bool Flag specifying whether to make this context case sensitive or not.
parentContext IApplicationContext The parent context.
return System

WebApplicationContext() public method

Create a new WebApplicationContext, loading the definitions from the given XML resource.
public WebApplicationContext ( string name, bool caseSensitive, string configurationLocations, IResource configurationResources ) : System
name string The application context name.
caseSensitive bool Flag specifying whether to make this context case sensitive or not.
configurationLocations string Names of configuration resources.
configurationResources IResource Configuration resources.
return System