|
Home
StructureMap on SourceForge
Basic Architecture
Concepts
API Documentation
FAQ
Configuration Schema
Memento Sources
Node Normalized Xml
Attribute
Normalized Xml
Attribute Usage
Instance Lifecyle Scoping
Configuration Management
StructureMapDoctor
StructureMapExplorer
deployment Task
verification Task
ValidationMethod Attribute
Other NAnt Tasks
Troubleshooting
Singleton Injection
|
Instance Scoping
New in version 1.0 is the ability to quickly define
different creation modes. This functionality can be
configured with the new optional "Scope" property on the [PluginFamily]
attribute or the "Scope" attribute on the <PluginFamily>
node. The alternatives are:
- PerRequest - The default operation. A new
instance will be created for each request.
- Singleton - A single instance will be shared across
all requests
- ThreadLocal - A single instance will be created for
each requesting thread. Caches the instances with
ThreadLocalStorage.
- HttpContext - A single instance will be created for
each HttpContext. Caches the instances in the
HttpContext.Items collection.
- Hybrid - Uses HttpContext storage if it exists,
otherwise uses ThreadLocal storage.
|