diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..df6decd --- /dev/null +++ b/.gitignore @@ -0,0 +1,163 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +.builds +*.dotCover + +## TODO: If you have NuGet Package Restore enabled, uncomment this +packages/ + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Others +[Bb]in +[Oo]bj +sql +TestResults +*.Cache +ClientBin +stylecop.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + + + +############ +## Windows +############ + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +# Mac crap +.DS_Store diff --git a/WCFChannelManager/example/Client/App.config b/WCFChannelManager/example/Client/App.config index d854d6f..793aa0c 100644 --- a/WCFChannelManager/example/Client/App.config +++ b/WCFChannelManager/example/Client/App.config @@ -1,80 +1,80 @@ - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WCFChannelManager/example/Client/Client.csproj b/WCFChannelManager/example/Client/Client.csproj index 67b1693..15e0fd8 100644 --- a/WCFChannelManager/example/Client/Client.csproj +++ b/WCFChannelManager/example/Client/Client.csproj @@ -1,84 +1,84 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0D173DEB-76A3-455F-A2B3-84E780CC6888} - Exe - Properties - Client - Client - v3.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\sharedlib\Spring.Net\antlr.runtime.dll - - - False - ..\..\..\sharedlib\Spring.Net\Common.Logging.dll - - - False - ..\..\..\sharedlib\Spring.Net\Spring.Core.dll - - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938} - WCFChannelManager - - - {BDE976A7-184B-43B1-A4CB-EF8F6E84B325} - Common - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {0D173DEB-76A3-455F-A2B3-84E780CC6888} + Exe + Properties + Client + Client + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\sharedlib\Spring.Net\antlr.runtime.dll + + + False + ..\..\..\sharedlib\Spring.Net\Common.Logging.dll + + + False + ..\..\..\sharedlib\Spring.Net\Spring.Core.dll + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938} + WCFChannelManager + + + {BDE976A7-184B-43B1-A4CB-EF8F6E84B325} + Common + + + + + + + \ No newline at end of file diff --git a/WCFChannelManager/example/Client/Program.cs b/WCFChannelManager/example/Client/Program.cs index b1c3aa1..457e42e 100644 --- a/WCFChannelManager/example/Client/Program.cs +++ b/WCFChannelManager/example/Client/Program.cs @@ -1,24 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Spring.Context.Support; -using Server; - -namespace Client -{ - class Program - { - static void Main(string[] args) - { - var myService = ContextRegistry.GetContext().GetObject("MyService") as IService1; - string value = myService.GetData(5); - var returnValue = myService.GetDataUsingDataContract(new CompositeType() - { - BoolValue = false, - StringValue = "Perponcher" }); - Console.ReadLine(); - } - } - -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Spring.Context.Support; +using Server; + +namespace Client +{ + class Program + { + static void Main(string[] args) + { + var myService = ContextRegistry.GetContext().GetObject("MyService") as IService1; + string value = myService.GetData(5); + var returnValue = myService.GetDataUsingDataContract(new CompositeType() + { + BoolValue = false, + StringValue = "Perponcher" }); + Console.ReadLine(); + } + } + +} diff --git a/WCFChannelManager/example/Client/Properties/AssemblyInfo.cs b/WCFChannelManager/example/Client/Properties/AssemblyInfo.cs index 7b96e74..ad53bb5 100644 --- a/WCFChannelManager/example/Client/Properties/AssemblyInfo.cs +++ b/WCFChannelManager/example/Client/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Client")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Client")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2fced0aa-fb6c-46e5-9d37-d9d1d3811532")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Client")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Client")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2fced0aa-fb6c-46e5-9d37-d9d1d3811532")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WCFChannelManager/example/Common/Common.csproj b/WCFChannelManager/example/Common/Common.csproj index 2625f3e..0484efa 100644 --- a/WCFChannelManager/example/Common/Common.csproj +++ b/WCFChannelManager/example/Common/Common.csproj @@ -1,65 +1,65 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BDE976A7-184B-43B1-A4CB-EF8F6E84B325} - Library - Properties - Common - Common - v3.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - 3.5 - - - 3.0 - - - 3.0 - - - 3.5 - - - 3.5 - - - - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {BDE976A7-184B-43B1-A4CB-EF8F6E84B325} + Library + Properties + Common + Common + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + 3.5 + + + 3.0 + + + 3.0 + + + 3.5 + + + 3.5 + + + + + + + + + + \ No newline at end of file diff --git a/WCFChannelManager/example/Common/IService1.cs b/WCFChannelManager/example/Common/IService1.cs index 5297c9c..f329570 100644 --- a/WCFChannelManager/example/Common/IService1.cs +++ b/WCFChannelManager/example/Common/IService1.cs @@ -1,44 +1,44 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using System.ServiceModel; -using System.Text; - -namespace Server -{ - // NOTE: If you change the interface name "IService1" here, you must also update the reference to "IService1" in App.config. - [ServiceContract] - public interface IService1 - { - [OperationContract] - string GetData(int value); - - [OperationContract] - CompositeType GetDataUsingDataContract(CompositeType composite); - - // TODO: Add your service operations here - } - - // Use a data contract as illustrated in the sample below to add composite types to service operations - [DataContract] - public class CompositeType - { - bool boolValue = true; - string stringValue = "Hello "; - - [DataMember] - public bool BoolValue - { - get { return boolValue; } - set { boolValue = value; } - } - - [DataMember] - public string StringValue - { - get { return stringValue; } - set { stringValue = value; } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.ServiceModel; +using System.Text; + +namespace Server +{ + // NOTE: If you change the interface name "IService1" here, you must also update the reference to "IService1" in App.config. + [ServiceContract] + public interface IService1 + { + [OperationContract] + string GetData(int value); + + [OperationContract] + CompositeType GetDataUsingDataContract(CompositeType composite); + + // TODO: Add your service operations here + } + + // Use a data contract as illustrated in the sample below to add composite types to service operations + [DataContract] + public class CompositeType + { + bool boolValue = true; + string stringValue = "Hello "; + + [DataMember] + public bool BoolValue + { + get { return boolValue; } + set { boolValue = value; } + } + + [DataMember] + public string StringValue + { + get { return stringValue; } + set { stringValue = value; } + } + } +} diff --git a/WCFChannelManager/example/Common/Properties/AssemblyInfo.cs b/WCFChannelManager/example/Common/Properties/AssemblyInfo.cs index 8a0e0ae..162e48b 100644 --- a/WCFChannelManager/example/Common/Properties/AssemblyInfo.cs +++ b/WCFChannelManager/example/Common/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Common")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Common")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("568c2bb9-6d6b-438e-ba87-ada254364cc3")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Common")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Common")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("568c2bb9-6d6b-438e-ba87-ada254364cc3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WCFChannelManager/example/Server/App.config b/WCFChannelManager/example/Server/App.config index 83c3045..059a4c1 100644 --- a/WCFChannelManager/example/Server/App.config +++ b/WCFChannelManager/example/Server/App.config @@ -1,48 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WCFChannelManager/example/Server/Properties/AssemblyInfo.cs b/WCFChannelManager/example/Server/Properties/AssemblyInfo.cs index 1dc13d9..68f30c2 100644 --- a/WCFChannelManager/example/Server/Properties/AssemblyInfo.cs +++ b/WCFChannelManager/example/Server/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Server")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Server")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c0ba7697-b6b4-493e-9142-ee6f8e0fca07")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Server")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Server")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c0ba7697-b6b4-493e-9142-ee6f8e0fca07")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WCFChannelManager/example/Server/Server.csproj b/WCFChannelManager/example/Server/Server.csproj index f3f45a4..a525dc4 100644 --- a/WCFChannelManager/example/Server/Server.csproj +++ b/WCFChannelManager/example/Server/Server.csproj @@ -1,80 +1,80 @@ - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {96DBE00A-CD5B-4A4D-B024-1D95771F8C00} - Library - Properties - Server - Server - {3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - /client:"WcfTestClient.exe" - v3.5 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - 3.5 - - - - 3.0 - - - 3.0 - - - - 3.5 - - - - - - - - - - - - {BDE976A7-184B-43B1-A4CB-EF8F6E84B325} - Common - - - - - - - - - True - - - - + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {96DBE00A-CD5B-4A4D-B024-1D95771F8C00} + Library + Properties + Server + Server + {3D9AD99F-2412-4246-B90B-4EAA41C64699};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + /client:"WcfTestClient.exe" + v3.5 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + 3.5 + + + + 3.0 + + + 3.0 + + + + 3.5 + + + + + + + + + + + + {BDE976A7-184B-43B1-A4CB-EF8F6E84B325} + Common + + + + + + + + + True + + + + \ No newline at end of file diff --git a/WCFChannelManager/example/Server/Service1.cs b/WCFChannelManager/example/Server/Service1.cs index 6d81d20..5562ce5 100644 --- a/WCFChannelManager/example/Server/Service1.cs +++ b/WCFChannelManager/example/Server/Service1.cs @@ -1,27 +1,27 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using System.ServiceModel; -using System.Text; - -namespace Server -{ - // NOTE: If you change the class name "Service1" here, you must also update the reference to "Service1" in App.config. - public class Service1 : IService1 - { - public string GetData(int value) - { - return string.Format("You entered: {0}", value); - } - - public CompositeType GetDataUsingDataContract(CompositeType composite) - { - if (composite.BoolValue) - { - composite.StringValue += "Suffix"; - } - return composite; - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.ServiceModel; +using System.Text; + +namespace Server +{ + // NOTE: If you change the class name "Service1" here, you must also update the reference to "Service1" in App.config. + public class Service1 : IService1 + { + public string GetData(int value) + { + return string.Format("You entered: {0}", value); + } + + public CompositeType GetDataUsingDataContract(CompositeType composite) + { + if (composite.BoolValue) + { + composite.StringValue += "Suffix"; + } + return composite; + } + } +} diff --git a/WCFChannelManager/example/WCFChannelManagerExample/Class1.cs b/WCFChannelManager/example/WCFChannelManagerExample/Class1.cs index 2090daa..85e730f 100644 --- a/WCFChannelManager/example/WCFChannelManagerExample/Class1.cs +++ b/WCFChannelManager/example/WCFChannelManagerExample/Class1.cs @@ -1,11 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace WCFChannelManagerExample -{ - public class Class1 - { - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WCFChannelManagerExample +{ + public class Class1 + { + } +} diff --git a/WCFChannelManager/example/WCFChannelManagerExample/Properties/AssemblyInfo.cs b/WCFChannelManager/example/WCFChannelManagerExample/Properties/AssemblyInfo.cs index 112f10d..e5e1c74 100644 --- a/WCFChannelManager/example/WCFChannelManagerExample/Properties/AssemblyInfo.cs +++ b/WCFChannelManager/example/WCFChannelManagerExample/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("WCFChannelManagerExample")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WCFChannelManagerExample")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b1e9f2b8-2aca-4ba1-b4c6-ecd6248d7467")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WCFChannelManagerExample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WCFChannelManagerExample")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b1e9f2b8-2aca-4ba1-b4c6-ecd6248d7467")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WCFChannelManager/example/WCFChannelManagerExample/WCFChannelManagerExample.csproj b/WCFChannelManager/example/WCFChannelManagerExample/WCFChannelManagerExample.csproj index 6a33318..ec73777 100644 --- a/WCFChannelManager/example/WCFChannelManagerExample/WCFChannelManagerExample.csproj +++ b/WCFChannelManager/example/WCFChannelManagerExample/WCFChannelManagerExample.csproj @@ -1,59 +1,59 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E2AEBC55-6667-4D07-80BF-082E3429260D} - Library - Properties - WCFChannelManagerExample - WCFChannelManagerExample - v3.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E2AEBC55-6667-4D07-80BF-082E3429260D} + Library + Properties + WCFChannelManagerExample + WCFChannelManagerExample + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + \ No newline at end of file diff --git a/WCFChannelManager/example/WCFChannelManagerExample/WCFChannelManagerExample.sln b/WCFChannelManager/example/WCFChannelManagerExample/WCFChannelManagerExample.sln index 649c09c..1413c0b 100644 --- a/WCFChannelManager/example/WCFChannelManagerExample/WCFChannelManagerExample.sln +++ b/WCFChannelManager/example/WCFChannelManagerExample/WCFChannelManagerExample.sln @@ -1,43 +1,43 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "..\Client\Client.csproj", "{0D173DEB-76A3-455F-A2B3-84E780CC6888}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "..\Common\Common.csproj", "{BDE976A7-184B-43B1-A4CB-EF8F6E84B325}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "..\Server\Server.csproj", "{96DBE00A-CD5B-4A4D-B024-1D95771F8C00}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WCFChannelManagement", "WCFChannelManagement", "{2213CDCA-0100-4074-A589-563CE1C6BE90}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WCFChannelManager", "..\..\src\WCFChannelManager\WCFChannelManager\WCFChannelManager.csproj", "{E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0D173DEB-76A3-455F-A2B3-84E780CC6888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D173DEB-76A3-455F-A2B3-84E780CC6888}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D173DEB-76A3-455F-A2B3-84E780CC6888}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D173DEB-76A3-455F-A2B3-84E780CC6888}.Release|Any CPU.Build.0 = Release|Any CPU - {BDE976A7-184B-43B1-A4CB-EF8F6E84B325}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BDE976A7-184B-43B1-A4CB-EF8F6E84B325}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BDE976A7-184B-43B1-A4CB-EF8F6E84B325}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BDE976A7-184B-43B1-A4CB-EF8F6E84B325}.Release|Any CPU.Build.0 = Release|Any CPU - {96DBE00A-CD5B-4A4D-B024-1D95771F8C00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {96DBE00A-CD5B-4A4D-B024-1D95771F8C00}.Debug|Any CPU.Build.0 = Debug|Any CPU - {96DBE00A-CD5B-4A4D-B024-1D95771F8C00}.Release|Any CPU.ActiveCfg = Release|Any CPU - {96DBE00A-CD5B-4A4D-B024-1D95771F8C00}.Release|Any CPU.Build.0 = Release|Any CPU - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938} = {2213CDCA-0100-4074-A589-563CE1C6BE90} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "..\Client\Client.csproj", "{0D173DEB-76A3-455F-A2B3-84E780CC6888}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "..\Common\Common.csproj", "{BDE976A7-184B-43B1-A4CB-EF8F6E84B325}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "..\Server\Server.csproj", "{96DBE00A-CD5B-4A4D-B024-1D95771F8C00}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WCFChannelManagement", "WCFChannelManagement", "{2213CDCA-0100-4074-A589-563CE1C6BE90}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WCFChannelManager", "..\..\src\WCFChannelManager\WCFChannelManager\WCFChannelManager.csproj", "{E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0D173DEB-76A3-455F-A2B3-84E780CC6888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0D173DEB-76A3-455F-A2B3-84E780CC6888}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0D173DEB-76A3-455F-A2B3-84E780CC6888}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0D173DEB-76A3-455F-A2B3-84E780CC6888}.Release|Any CPU.Build.0 = Release|Any CPU + {BDE976A7-184B-43B1-A4CB-EF8F6E84B325}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDE976A7-184B-43B1-A4CB-EF8F6E84B325}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDE976A7-184B-43B1-A4CB-EF8F6E84B325}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDE976A7-184B-43B1-A4CB-EF8F6E84B325}.Release|Any CPU.Build.0 = Release|Any CPU + {96DBE00A-CD5B-4A4D-B024-1D95771F8C00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96DBE00A-CD5B-4A4D-B024-1D95771F8C00}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96DBE00A-CD5B-4A4D-B024-1D95771F8C00}.Release|Any CPU.ActiveCfg = Release|Any CPU + {96DBE00A-CD5B-4A4D-B024-1D95771F8C00}.Release|Any CPU.Build.0 = Release|Any CPU + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938} = {2213CDCA-0100-4074-A589-563CE1C6BE90} + EndGlobalSection +EndGlobal diff --git a/WCFChannelManager/src/WCFChannelManager/.nuget/NuGet.Config b/WCFChannelManager/src/WCFChannelManager/.nuget/NuGet.Config new file mode 100644 index 0000000..67f8ea0 --- /dev/null +++ b/WCFChannelManager/src/WCFChannelManager/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/WCFChannelManager/src/WCFChannelManager/.nuget/NuGet.exe b/WCFChannelManager/src/WCFChannelManager/.nuget/NuGet.exe new file mode 100644 index 0000000..4645f4b Binary files /dev/null and b/WCFChannelManager/src/WCFChannelManager/.nuget/NuGet.exe differ diff --git a/WCFChannelManager/src/WCFChannelManager/.nuget/NuGet.targets b/WCFChannelManager/src/WCFChannelManager/.nuget/NuGet.targets new file mode 100644 index 0000000..2d11ba5 --- /dev/null +++ b/WCFChannelManager/src/WCFChannelManager/.nuget/NuGet.targets @@ -0,0 +1,153 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + $([System.IO.Path]::Combine($(SolutionDir), "packages")) + + + + + $(SolutionDir).nuget + packages.config + $(SolutionDir)packages + + + + + $(NuGetToolsPath)\nuget.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)" + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager.sln b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager.sln index 5f0c26f..0e79d10 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager.sln +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager.sln @@ -1,26 +1,33 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WCFChannelManager", "WCFChannelManager\WCFChannelManager.csproj", "{E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WCFChannelManagerTests", "WCFChannelManagerTests\WCFChannelManagerTests.csproj", "{092C9457-CC27-4AB3-9CB2-7488CB9AB267}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Release|Any CPU.Build.0 = Release|Any CPU - {092C9457-CC27-4AB3-9CB2-7488CB9AB267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {092C9457-CC27-4AB3-9CB2-7488CB9AB267}.Debug|Any CPU.Build.0 = Debug|Any CPU - {092C9457-CC27-4AB3-9CB2-7488CB9AB267}.Release|Any CPU.ActiveCfg = Release|Any CPU - {092C9457-CC27-4AB3-9CB2-7488CB9AB267}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WCFChannelManager", "WCFChannelManager\WCFChannelManager.csproj", "{E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WCFChannelManagerTests", "WCFChannelManagerTests\WCFChannelManagerTests.csproj", "{092C9457-CC27-4AB3-9CB2-7488CB9AB267}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{44B9D521-3687-4829-BDB8-369E920F8170}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938}.Release|Any CPU.Build.0 = Release|Any CPU + {092C9457-CC27-4AB3-9CB2-7488CB9AB267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {092C9457-CC27-4AB3-9CB2-7488CB9AB267}.Debug|Any CPU.Build.0 = Debug|Any CPU + {092C9457-CC27-4AB3-9CB2-7488CB9AB267}.Release|Any CPU.ActiveCfg = Release|Any CPU + {092C9457-CC27-4AB3-9CB2-7488CB9AB267}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/AutoSizePool.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/AutoSizePool.cs index e528818..a079528 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/AutoSizePool.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/AutoSizePool.cs @@ -1,168 +1,168 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Spring.Pool; - -namespace WCFChannelManager -{ - /// - /// A pool that automatically grows if more instances are requested than there are available in the queue. - /// - public class AutoSizePool - : IObjectPool - { - protected List activeObjects; - protected List passiveObjects; - protected bool closed; - private object sync; - - public AutoSizePool(IPoolableObjectFactory factory) - { - activeObjects = new List(); - passiveObjects = new List(); - sync = new object(); - PoolableObjectFactory = factory; - } - - #region IObjectPool Members - - public void AddObject() - { - lock (sync) - { - passiveObjects.Add(PoolableObjectFactory.MakeObject()); - } - } - - public object BorrowObject() - { - lock (sync) - { - if (closed) - { - throw new InvalidOperationException("The pool is closed."); - } - object useable = null; - IEnumerator objects = passiveObjects.GetEnumerator(); - List destroyedObjects = new List(); - while (objects.MoveNext() && useable == null) - { - PoolableObjectFactory.ActivateObject(objects.Current); - if (PoolableObjectFactory.ValidateObject(objects.Current)) - { - useable = objects.Current; - } - else - { - PoolableObjectFactory.DestroyObject(objects.Current); - destroyedObjects.Add(objects.Current); - } - } - passiveObjects.RemoveAll(o => destroyedObjects.Contains(o)); - if (useable == null) - { - useable = PoolableObjectFactory.MakeObject(); - PoolableObjectFactory.ActivateObject(useable); - } - activeObjects.Add(useable); - return useable; - } - } - - public void Clear() - { - lock (sync) - { - RemoveAllPassiveObjects(); - } - } - - public void Close() - { - lock (sync) - { - closed = true; - RemoveAllPassiveObjects(); - RemoveAllActiveObjects(); - } - } - - public int NumActive - { - get - { - lock (sync) - { - return activeObjects.Count; - } - } - } - - public int NumIdle - { - get - { - lock (sync) - { - return passiveObjects.Count; - } - } - } - - public IPoolableObjectFactory PoolableObjectFactory - { - get; - set; - } - - public void ReturnObject(object target) - { - lock (sync) - { - if (activeObjects.Contains(target)) - { - activeObjects.Remove(target); - PoolableObjectFactory.PassivateObject(target); - passiveObjects.Add(target); - - } - } - } - - #endregion - - private void RemoveAllPassiveObjects() - { - ClearList(passiveObjects); - } - - private void RemoveAllActiveObjects() - { - ClearList(activeObjects); - } - - private void ClearList(List list) - { - foreach (object o in list) - { - PoolableObjectFactory.DestroyObject(o); - } - list.Clear(); - } - } -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Spring.Pool; + +namespace WCFChannelManager +{ + /// + /// A pool that automatically grows if more instances are requested than there are available in the queue. + /// + public class AutoSizePool + : IObjectPool + { + protected List activeObjects; + protected List passiveObjects; + protected bool closed; + private object sync; + + public AutoSizePool(IPoolableObjectFactory factory) + { + activeObjects = new List(); + passiveObjects = new List(); + sync = new object(); + PoolableObjectFactory = factory; + } + + #region IObjectPool Members + + public void AddObject() + { + lock (sync) + { + passiveObjects.Add(PoolableObjectFactory.MakeObject()); + } + } + + public object BorrowObject() + { + lock (sync) + { + if (closed) + { + throw new InvalidOperationException("The pool is closed."); + } + object useable = null; + IEnumerator objects = passiveObjects.GetEnumerator(); + List destroyedObjects = new List(); + while (objects.MoveNext() && useable == null) + { + PoolableObjectFactory.ActivateObject(objects.Current); + if (PoolableObjectFactory.ValidateObject(objects.Current)) + { + useable = objects.Current; + } + else + { + PoolableObjectFactory.DestroyObject(objects.Current); + destroyedObjects.Add(objects.Current); + } + } + passiveObjects.RemoveAll(o => destroyedObjects.Contains(o)); + if (useable == null) + { + useable = PoolableObjectFactory.MakeObject(); + PoolableObjectFactory.ActivateObject(useable); + } + activeObjects.Add(useable); + return useable; + } + } + + public void Clear() + { + lock (sync) + { + RemoveAllPassiveObjects(); + } + } + + public void Close() + { + lock (sync) + { + closed = true; + RemoveAllPassiveObjects(); + RemoveAllActiveObjects(); + } + } + + public int NumActive + { + get + { + lock (sync) + { + return activeObjects.Count; + } + } + } + + public int NumIdle + { + get + { + lock (sync) + { + return passiveObjects.Count; + } + } + } + + public IPoolableObjectFactory PoolableObjectFactory + { + get; + set; + } + + public void ReturnObject(object target) + { + lock (sync) + { + if (activeObjects.Contains(target)) + { + activeObjects.Remove(target); + PoolableObjectFactory.PassivateObject(target); + passiveObjects.Add(target); + + } + } + } + + #endregion + + private void RemoveAllPassiveObjects() + { + ClearList(passiveObjects); + } + + private void RemoveAllActiveObjects() + { + ClearList(activeObjects); + } + + private void ClearList(List list) + { + foreach (object o in list) + { + PoolableObjectFactory.DestroyObject(o); + } + list.Clear(); + } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/AutoSizePoolFactory.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/AutoSizePoolFactory.cs index 6eea3d3..17da953 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/AutoSizePoolFactory.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/AutoSizePoolFactory.cs @@ -1,38 +1,38 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Spring.Pool; - -namespace WCFChannelManager -{ - /// - /// Factory for AutoSizePools. - /// - public class AutoSizePoolFactory - : IPoolFactory - { - #region IPoolFactory Members - - public IObjectPool CreatePool(IPoolableObjectFactory poolableObjectFactory) - { - return new AutoSizePool(poolableObjectFactory); - } - - #endregion - } -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Spring.Pool; + +namespace WCFChannelManager +{ + /// + /// Factory for AutoSizePools. + /// + public class AutoSizePoolFactory + : IPoolFactory + { + #region IPoolFactory Members + + public IObjectPool CreatePool(IPoolableObjectFactory poolableObjectFactory) + { + return new AutoSizePool(poolableObjectFactory); + } + + #endregion + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelCreator.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelCreator.cs index 1385313..b745698 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelCreator.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelCreator.cs @@ -1,52 +1,52 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ServiceModel; -using System.ServiceModel.Channels; - -namespace WCFChannelManager -{ - public class ChannelCreator - : ICanCreateChannels - { - private ChannelFactory channelFactory; - - public ChannelCreator(ChannelFactory channelFactory) - { - this.channelFactory = channelFactory; - } - - #region ICanCreateChannels Members - - public TChannel CreateChannel() - { - return channelFactory.CreateChannel(); - } - - public IChannelFactory ChannelFactory - { - get - { - return channelFactory; - } - } - - #endregion - } - -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ServiceModel; +using System.ServiceModel.Channels; + +namespace WCFChannelManager +{ + public class ChannelCreator + : ICanCreateChannels + { + private ChannelFactory channelFactory; + + public ChannelCreator(ChannelFactory channelFactory) + { + this.channelFactory = channelFactory; + } + + #region ICanCreateChannels Members + + public TChannel CreateChannel() + { + return channelFactory.CreateChannel(); + } + + public IChannelFactory ChannelFactory + { + get + { + return channelFactory; + } + } + + #endregion + } + +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelManagerBase.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelManagerBase.cs index a45c24a..d455f5c 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelManagerBase.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelManagerBase.cs @@ -1,126 +1,126 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ServiceModel; -using System.ServiceModel.Channels; - -namespace WCFChannelManager -{ - /// - /// Base class for channelmanagers. - /// - /// The type of the channel - public abstract class ChannelManagerBase - : IChannelManager - { - - /// - /// Constructor taking the name of an endpoint. - /// - /// Name of an endpoint. - public ChannelManagerBase(string endpointConfigurationName) - : this(new ChannelCreator(new ChannelFactory(endpointConfigurationName))) - { - - } - - /// - /// Constructor taking a channelfactory. - /// - /// The channelfactory to use in this instance. - public ChannelManagerBase(ICanCreateChannels factory) - { - ChannelCreater = factory; - } - - - /// - /// The channelfactory. - /// - public virtual IChannelFactory ChannelFactory - { - get - { - return ChannelCreater.ChannelFactory; - } - } - - public virtual ICanCreateChannels ChannelCreater - { - get; - set; - } - - /// - /// Get a channel on which actions can be performed. - /// - /// A working channel. - public abstract TChannel FetchChannelToWorkWith(); - - /// - /// Perform any cleanup work needed when an action has been performed on a channel. - /// - /// The channel that was used. - public abstract void FinishedWorkWithChannel(TChannel channel); - - /// - /// Creates and opens a channel. - /// - /// An open channel. - protected virtual TChannel CreateAndOpenChannel() - { - return OpenChannel(CreateChannel()); - - } - - /// - /// Creates a channel - /// - /// - protected virtual TChannel CreateChannel() - { - TChannel channel = ChannelCreater.CreateChannel(); - ICommunicationObject comm = channel as ICommunicationObject; - return channel; - } - - /// - /// Open the channel. - /// - /// The channel to open. - /// An opened channel. - protected virtual TChannel OpenChannel(TChannel channel) - { - ICommunicationObject communicationChannel = channel as ICommunicationObject; - if (communicationChannel != null && communicationChannel.State == CommunicationState.Created) - { - communicationChannel.Open(); - } - return channel; - } - - protected virtual void CloseChannel(TChannel channel) - { - ICommunicationObject communicationChannel = channel as ICommunicationObject; - if (communicationChannel != null) - { - communicationChannel.Close(); - } - } - } -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ServiceModel; +using System.ServiceModel.Channels; + +namespace WCFChannelManager +{ + /// + /// Base class for channelmanagers. + /// + /// The type of the channel + public abstract class ChannelManagerBase + : IChannelManager + { + + /// + /// Constructor taking the name of an endpoint. + /// + /// Name of an endpoint. + public ChannelManagerBase(string endpointConfigurationName) + : this(new ChannelCreator(new ChannelFactory(endpointConfigurationName))) + { + + } + + /// + /// Constructor taking a channelfactory. + /// + /// The channelfactory to use in this instance. + public ChannelManagerBase(ICanCreateChannels factory) + { + ChannelCreater = factory; + } + + + /// + /// The channelfactory. + /// + public virtual IChannelFactory ChannelFactory + { + get + { + return ChannelCreater.ChannelFactory; + } + } + + public virtual ICanCreateChannels ChannelCreater + { + get; + set; + } + + /// + /// Get a channel on which actions can be performed. + /// + /// A working channel. + public abstract TChannel FetchChannelToWorkWith(); + + /// + /// Perform any cleanup work needed when an action has been performed on a channel. + /// + /// The channel that was used. + public abstract void FinishedWorkWithChannel(TChannel channel); + + /// + /// Creates and opens a channel. + /// + /// An open channel. + protected virtual TChannel CreateAndOpenChannel() + { + return OpenChannel(CreateChannel()); + + } + + /// + /// Creates a channel + /// + /// + protected virtual TChannel CreateChannel() + { + TChannel channel = ChannelCreater.CreateChannel(); + ICommunicationObject comm = channel as ICommunicationObject; + return channel; + } + + /// + /// Open the channel. + /// + /// The channel to open. + /// An opened channel. + protected virtual TChannel OpenChannel(TChannel channel) + { + ICommunicationObject communicationChannel = channel as ICommunicationObject; + if (communicationChannel != null && communicationChannel.State == CommunicationState.Created) + { + communicationChannel.Open(); + } + return channel; + } + + protected virtual void CloseChannel(TChannel channel) + { + ICommunicationObject communicationChannel = channel as ICommunicationObject; + if (communicationChannel != null) + { + communicationChannel.Close(); + } + } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelManagerFactoryObject.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelManagerFactoryObject.cs index a0ef8ce..bae7252 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelManagerFactoryObject.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelManagerFactoryObject.cs @@ -1,237 +1,274 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Spring.Objects.Factory.Config; -using Spring.Util; -using Spring.Proxy; -using System.Reflection; -using Spring.Objects.Factory.Support; -using Spring.Objects.Factory; - -namespace WCFChannelManager -{ - /// - /// ChannelManagerFactoryObjects dynamically subclasses ChannelActionWrappers and implements the channel interface - /// - public class ChannelManagerFactoryObject - : IConfigurableFactoryObject, IInitializingObject - { - protected ConstructorInfo proxyConstructor; - - public const string SingleAction = "SingleAction"; - public const string FixedPool = "FixedPool"; - public const string VariablePool = "VariablePool"; - public const string ChannelManagerPropertyName = "ChannelManager"; - - #region IConfigurableFactoryObject Members - - /// - /// Get or set the template used to configure the proxy. - /// - public IObjectDefinition ProductTemplate - { - get; - set; - } - - #endregion - - #region IFactoryObject Members - /// - /// Creates a new instance of the channelmanager. - /// - /// New instance of the channelmanager - public object GetObject() - { - if (proxyConstructor == null) - { - GenerateProxy(); - } - object channelProxy = ObjectUtils.InstantiateType(proxyConstructor, ObjectUtils.EmptyObjects); - SetDefaultValues(channelProxy); - return channelProxy; - } - - /// - /// - /// - /// - private void SetDefaultValues(object channelProxy) - { - if (ProductTemplate == null || !ProductTemplate.PropertyValues.Contains(ChannelManagerPropertyName)) - { - Type channelManagerType = null; - Type channelType = WcfChannelProxyTypeBuilder.FindChannelType(channelProxy.GetType()); - List contructorArgumentTypes = new List(); - contructorArgumentTypes.Add(typeof(string)); - List constructorArguments = new List(); - constructorArguments.Add(EndpointConfigurationName); - if (string.IsNullOrEmpty(ChannelManagementMode) || ChannelManagementMode.Equals(SingleAction)) - { - channelManagerType = typeof(SingleActionChannelManager<>).MakeGenericType(channelType); - - } - else - { - channelManagerType = typeof(ChannelPoolManager<>).MakeGenericType(channelType); - contructorArgumentTypes.Add(typeof(IPoolFactory)); - if (ChannelManagementMode.Equals(FixedPool)) - { - constructorArguments.Add(new SimplePoolFactory()); - } - else - { - constructorArguments.Add(new AutoSizePoolFactory()); - } - } - ConstructorInfo managerConstructor = channelManagerType.GetConstructor(contructorArgumentTypes.ToArray()); - object channelManager = ObjectUtils.InstantiateType(managerConstructor, constructorArguments.ToArray()); - PropertyInfo property = channelProxy.GetType().GetProperty(ChannelManagerPropertyName); - property.SetValue(channelProxy, channelManager, null); - } - } - - /// - /// Is the factory a singleton. - /// - public bool IsSingleton - { - get; - set; - } - - /// - /// Returns the type of the channelmanager. - /// - public Type ObjectType - { - get - { - return (proxyConstructor != null ? proxyConstructor.DeclaringType : ChannelActionWrapperType); - } - - } - - #endregion - /// - /// The type used for subclassing, default is ProxyChannel. - /// - public virtual Type ChannelActionWrapperType - { - get; - set; - } - /// - /// The channel interface to implement. - /// - public virtual Type ChannelType - { - get; - set; - } - /// - /// The mode on how the channel is managed. Default is "SingleAction". - /// - public virtual string ChannelManagementMode - { - get; - set; - } - /// - /// The name of the endpoint in system.servicemodel section. - /// - public virtual string EndpointConfigurationName - { - get; - set; - } - - /// - /// Returns the type of the channelactionwrapper to use. - /// - /// The channel type. - protected Type BuildChannelActionWrapperType() - { - Type baseClass = null; - if (ChannelActionWrapperType == null) - { - baseClass = typeof(ProxyChannel<>).MakeGenericType(ChannelType); - } - else if (ChannelActionWrapperType.IsGenericType) - { - baseClass = ChannelActionWrapperType.MakeGenericType(ChannelType); - } - else - { - baseClass = ChannelActionWrapperType; - } - return baseClass; - } - - /// - /// Returns the channel type. - /// - /// The channelActionWrapperType being used. - /// The channel type. - protected virtual Type BuildChannelType(Type channelActionWrapperType) - { - Type channelType = null; - if (ChannelType != null) - { - channelType = ChannelType; - } - else - { - channelType = WcfChannelProxyTypeBuilder.FindChannelType(channelActionWrapperType); - } - return channelType; - } - - /// - /// Generates a subclass of the specified ChannelActionWrapperType and the ChannelType. - /// - protected virtual void GenerateProxy() - { - Type baseClass = BuildChannelActionWrapperType(); - IProxyTypeBuilder builder = new WcfChannelProxyTypeBuilder(baseClass); - Type wrapper = builder.BuildProxyType(); - proxyConstructor = wrapper.GetConstructor(Type.EmptyTypes); - } - - - - #region IInitializingObject Members - /// - /// Validates the configuration. - /// - public virtual void AfterPropertiesSet() - { - if ((ChannelType == null && ChannelActionWrapperType == null) || - (ChannelType == null && ChannelActionWrapperType != null && WcfChannelProxyTypeBuilder.FindChannelType(ChannelActionWrapperType).IsGenericParameter)) - { - throw new ArgumentException("No channeltype supplied."); - } - if (string.IsNullOrEmpty(EndpointConfigurationName)) - { - throw new ArgumentException("No endpoint supplied."); - } - } - - #endregion - } -} +//Copyright 2013 Sergio Moreno Calzada + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Spring.Objects.Factory.Config; +using Spring.Util; +using Spring.Proxy; +using System.Reflection; +using Spring.Objects.Factory.Support; +using Spring.Objects.Factory; + +namespace WCFChannelManager +{ + using AopAlliance.Aop; + + using Spring.Aop.Framework; + + /// + /// ChannelManagerFactoryObjects dynamically subclasses ChannelActionWrappers and implements the channel interface + /// + public class ChannelManagerFactoryObject + : IConfigurableFactoryObject, IInitializingObject + { + protected ConstructorInfo proxyConstructor; + protected ConstructorInfo interceptorConstructor; + + public const string SingleAction = "SingleAction"; + public const string FixedPool = "FixedPool"; + public const string VariablePool = "VariablePool"; + public const string ChannelManagerPropertyName = "ChannelManager"; + + #region IConfigurableFactoryObject Members + + /// + /// Get or set the template used to configure the proxy. + /// + public IObjectDefinition ProductTemplate + { + get; + set; + } + + #endregion + + #region IFactoryObject Members + /// + /// Creates a new instance of the channelmanager. + /// + /// New instance of the channelmanager + public object GetObject() + { + if (proxyConstructor == null || interceptorConstructor == null) + { + GenerateProxy(); + } + object channelProxy = ObjectUtils.InstantiateType(proxyConstructor, ObjectUtils.EmptyObjects); + object interceptorProxy = ObjectUtils.InstantiateType(interceptorConstructor, ObjectUtils.EmptyObjects); + + + + + AdvisedSupport advisedSupport = new AdvisedSupport(new Type[] { ChannelType }); + advisedSupport.AddAdvice((IAdvice)interceptorProxy); + advisedSupport.Target = channelProxy; + advisedSupport.ProxyTargetType = true; + + var proxy = advisedSupport.AopProxyFactory.CreateAopProxy(advisedSupport); + + SetDefaultValues(channelProxy); + + return proxy; + } + + /// + /// + /// + /// + private void SetDefaultValues(object channelProxy) + { + if (ProductTemplate == null || !ProductTemplate.PropertyValues.Contains(ChannelManagerPropertyName)) + { + Type channelManagerType = null; + Type channelType = FindChannelType(channelProxy.GetType()); + List contructorArgumentTypes = new List(); + contructorArgumentTypes.Add(typeof(string)); + List constructorArguments = new List(); + constructorArguments.Add(EndpointConfigurationName); + if (string.IsNullOrEmpty(ChannelManagementMode) || ChannelManagementMode.Equals(SingleAction)) + { + channelManagerType = typeof(SingleActionChannelManager<>).MakeGenericType(channelType); + + } + else + { + channelManagerType = typeof(ChannelPoolManager<>).MakeGenericType(channelType); + contructorArgumentTypes.Add(typeof(IPoolFactory)); + if (ChannelManagementMode.Equals(FixedPool)) + { + constructorArguments.Add(new SimplePoolFactory()); + } + else + { + constructorArguments.Add(new AutoSizePoolFactory()); + } + } + ConstructorInfo managerConstructor = channelManagerType.GetConstructor(contructorArgumentTypes.ToArray()); + object channelManager = ObjectUtils.InstantiateType(managerConstructor, constructorArguments.ToArray()); + PropertyInfo property = channelProxy.GetType().GetProperty(ChannelManagerPropertyName); + property.SetValue(channelProxy, channelManager, null); + } + } + + /// + /// Is the factory a singleton. + /// + public bool IsSingleton + { + get; + set; + } + + /// + /// Returns the type of the channelmanager. + /// + public Type ObjectType + { + get + { + return (proxyConstructor != null ? proxyConstructor.DeclaringType : ChannelActionWrapperType); + } + + } + + #endregion + /// + /// The type used for subclassing, default is ProxyChannel. + /// + public virtual Type ChannelActionWrapperType + { + get; + set; + } + /// + /// The channel interface to implement. + /// + public virtual Type ChannelType + { + get; + set; + } + /// + /// The mode on how the channel is managed. Default is "SingleAction". + /// + public virtual string ChannelManagementMode + { + get; + set; + } + /// + /// The name of the endpoint in system.servicemodel section. + /// + public virtual string EndpointConfigurationName + { + get; + set; + } + + /// + /// Returns the type of the channelactionwrapper to use. + /// + /// The channel type. + protected Type BuildChannelActionWrapperType() + { + Type baseClass = typeof(ProxyChannel<>).MakeGenericType(ChannelType); + return baseClass; + } + + /// + /// Returns the type of the Interceptor to use. + /// + /// The channel type. + protected Type BuildInterceptorWrapperType() + { + Type baseClass = typeof(WcfInterceptor<>).MakeGenericType(ChannelType); + return baseClass; + } + + + /// + /// Returns the channel type. + /// + /// The channelActionWrapperType being used. + /// The channel type. + protected virtual Type BuildChannelType(Type channelActionWrapperType) + { + Type channelType = null; + if (ChannelType != null) + { + channelType = ChannelType; + } + else + { + channelType = FindChannelType(channelActionWrapperType); + } + return channelType; + } + + /// + /// Generates a subclass of the specified ChannelActionWrapperType and the ChannelType. + /// + protected virtual void GenerateProxy() + { + Type proxyType = BuildChannelActionWrapperType(); + proxyConstructor = proxyType.GetConstructor(Type.EmptyTypes); + + Type interceptorType = this.BuildInterceptorWrapperType(); + interceptorConstructor = interceptorType.GetConstructor(Type.EmptyTypes); + } + + /// + /// Finds the channeltype from a ChannelActionWrapperType. + /// + /// The ChannelManagerType. + /// Returns the channaltype if found, otherwise null. + protected virtual Type FindChannelType(Type channelManagerType) + { + Type t = channelManagerType; + Type channelType = null; + while (t != typeof(object) && channelType == null) + { + var cur = t.IsGenericType ? t.GetGenericTypeDefinition() : t; + if (typeof(ProxyChannel<>) == cur) + { + channelType = t.GetGenericArguments()[0]; + } + t = t.BaseType; + } + return channelType; + } + + #region IInitializingObject Members + /// + /// Validates the configuration. + /// + public virtual void AfterPropertiesSet() + { + if ((ChannelType == null && ChannelActionWrapperType == null) || + (ChannelType == null && ChannelActionWrapperType != null && FindChannelType(ChannelActionWrapperType).IsGenericParameter)) + { + throw new ArgumentException("No channeltype supplied."); + } + if (string.IsNullOrEmpty(EndpointConfigurationName)) + { + throw new ArgumentException("No endpoint supplied."); + } + } + + #endregion + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelPoolManager.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelPoolManager.cs index 7280810..f9caf19 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelPoolManager.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ChannelPoolManager.cs @@ -1,151 +1,151 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Spring.Pool; -using System.ServiceModel; -using Spring.Pool.Support; -using System.ServiceModel.Channels; - -namespace WCFChannelManager -{ - - /// - /// A ChannelManager that pools channels that can be used. - /// - /// The channeltype. - public class ChannelPoolManager - : ChannelManagerBase, IPoolableObjectFactory - { - - /// - /// Constructs a channelpoolmanager. - /// - /// The name of the endpoint in your system.Servicemodel section. - public ChannelPoolManager(string endpointConfigurationName, IPoolFactory poolFactory) - : base(endpointConfigurationName) - { - Pool = CreatePool(poolFactory); - } - - - /// - /// Constructs a channelpoolmanager. - /// - /// The channel factory to use. - public ChannelPoolManager(ICanCreateChannels factory, IPoolFactory poolFactory) - : base(factory) - { - Pool = CreatePool(poolFactory); - } - - /// - /// Create a pool to use. - /// - /// The size of the pool. - /// A valid pool that can be used. - protected virtual IObjectPool CreatePool(IPoolFactory poolFactory) - { - return poolFactory.CreatePool(this); - } - - /// - /// The pool of channels. - /// - public virtual IObjectPool Pool - { - get; - private set; - } - - #region IPoolableObjectFactory Members - - /// - /// Activates a channel. - /// - /// The channel to activate. - void IPoolableObjectFactory.ActivateObject(object obj) - { - OpenChannel((TChannel)obj); - } - - /// - /// Destory a channel. - /// - /// The channel to destroy. - void IPoolableObjectFactory.DestroyObject(object obj) - { - CloseChannel((TChannel)obj); - } - - /// - /// Create a channel for the pool. - /// - /// A channel for the pool. - object IPoolableObjectFactory.MakeObject() - { - return CreateChannel(); - } - - /// - /// Passivate a channel. - /// - /// The channel to passivate. - void IPoolableObjectFactory.PassivateObject(object obj) - { - - } - - /// - /// Check if the channel is valid. - /// - /// The channel to check. - /// Returns true if the channel can be used, otherwise false. - bool IPoolableObjectFactory.ValidateObject(object obj) - { - ICommunicationObject communicationObject = obj as ICommunicationObject; - bool valid = false; - if (communicationObject != null && communicationObject.State == CommunicationState.Opened) - { - valid = true; - } - return valid; - } - - #endregion - - /// - /// Get a channel to send messages to. - /// - /// A channel that can be used to send messages to. - public override TChannel FetchChannelToWorkWith() - { - return (TChannel)Pool.BorrowObject(); - } - - /// - /// Perform cleanup work after sending messages to the channel. - /// - /// The channel to send messages to. - public override void FinishedWorkWithChannel(TChannel channel) - { - Pool.ReturnObject(channel); - } - - - } -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Spring.Pool; +using System.ServiceModel; +using Spring.Pool.Support; +using System.ServiceModel.Channels; + +namespace WCFChannelManager +{ + + /// + /// A ChannelManager that pools channels that can be used. + /// + /// The channeltype. + public class ChannelPoolManager + : ChannelManagerBase, IPoolableObjectFactory + { + + /// + /// Constructs a channelpoolmanager. + /// + /// The name of the endpoint in your system.Servicemodel section. + public ChannelPoolManager(string endpointConfigurationName, IPoolFactory poolFactory) + : base(endpointConfigurationName) + { + Pool = CreatePool(poolFactory); + } + + + /// + /// Constructs a channelpoolmanager. + /// + /// The channel factory to use. + public ChannelPoolManager(ICanCreateChannels factory, IPoolFactory poolFactory) + : base(factory) + { + Pool = CreatePool(poolFactory); + } + + /// + /// Create a pool to use. + /// + /// The size of the pool. + /// A valid pool that can be used. + protected virtual IObjectPool CreatePool(IPoolFactory poolFactory) + { + return poolFactory.CreatePool(this); + } + + /// + /// The pool of channels. + /// + public virtual IObjectPool Pool + { + get; + private set; + } + + #region IPoolableObjectFactory Members + + /// + /// Activates a channel. + /// + /// The channel to activate. + void IPoolableObjectFactory.ActivateObject(object obj) + { + OpenChannel((TChannel)obj); + } + + /// + /// Destory a channel. + /// + /// The channel to destroy. + void IPoolableObjectFactory.DestroyObject(object obj) + { + CloseChannel((TChannel)obj); + } + + /// + /// Create a channel for the pool. + /// + /// A channel for the pool. + object IPoolableObjectFactory.MakeObject() + { + return CreateChannel(); + } + + /// + /// Passivate a channel. + /// + /// The channel to passivate. + void IPoolableObjectFactory.PassivateObject(object obj) + { + + } + + /// + /// Check if the channel is valid. + /// + /// The channel to check. + /// Returns true if the channel can be used, otherwise false. + bool IPoolableObjectFactory.ValidateObject(object obj) + { + ICommunicationObject communicationObject = obj as ICommunicationObject; + bool valid = false; + if (communicationObject != null && communicationObject.State == CommunicationState.Opened) + { + valid = true; + } + return valid; + } + + #endregion + + /// + /// Get a channel to send messages to. + /// + /// A channel that can be used to send messages to. + public override TChannel FetchChannelToWorkWith() + { + return (TChannel)Pool.BorrowObject(); + } + + /// + /// Perform cleanup work after sending messages to the channel. + /// + /// The channel to send messages to. + public override void FinishedWorkWithChannel(TChannel channel) + { + Pool.ReturnObject(channel); + } + + + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ICanCreateChannels.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ICanCreateChannels.cs index 80d4a53..c51ecda 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ICanCreateChannels.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ICanCreateChannels.cs @@ -1,28 +1,28 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ServiceModel.Channels; - -namespace WCFChannelManager -{ - public interface ICanCreateChannels - { - TChannel CreateChannel(); - IChannelFactory ChannelFactory { get; } - } -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ServiceModel.Channels; + +namespace WCFChannelManager +{ + public interface ICanCreateChannels + { + TChannel CreateChannel(); + IChannelFactory ChannelFactory { get; } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/IChannelManager.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/IChannelManager.cs index 3c0a61b..fe44af3 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/IChannelManager.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/IChannelManager.cs @@ -1,40 +1,40 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace WCFChannelManager -{ - /// - /// Interface which defines the methods channel lifecycle managers should implements. Implementors can be used - /// by the ProxyChannel. - /// - /// The type of the channel. - public interface IChannelManager - { - /// - /// Creates a channel that can be used. - /// - /// A usable channel. - TChannel FetchChannelToWorkWith(); - /// - /// When work is finished with a channel this method is called to hand it back to the manager. - /// - /// The channel which no longer is needed. - void FinishedWorkWithChannel(TChannel channel); - } -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WCFChannelManager +{ + /// + /// Interface which defines the methods channel lifecycle managers should implements. Implementors can be used + /// by the ProxyChannel. + /// + /// The type of the channel. + public interface IChannelManager + { + /// + /// Creates a channel that can be used. + /// + /// A usable channel. + TChannel FetchChannelToWorkWith(); + /// + /// When work is finished with a channel this method is called to hand it back to the manager. + /// + /// The channel which no longer is needed. + void FinishedWorkWithChannel(TChannel channel); + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/IPoolFactory.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/IPoolFactory.cs index 07c8518..e9a28e4 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/IPoolFactory.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/IPoolFactory.cs @@ -1,35 +1,35 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Spring.Pool; - -namespace WCFChannelManager -{ - /// - /// PoolFactories can create object pools. - /// - public interface IPoolFactory - { - /// - /// Create an ObjectPool. - /// - /// The objectFactory to be used by the pool. - /// An objectpool. - IObjectPool CreatePool(IPoolableObjectFactory poolableObjectFactory); - } -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Spring.Pool; + +namespace WCFChannelManager +{ + /// + /// PoolFactories can create object pools. + /// + public interface IPoolFactory + { + /// + /// Create an ObjectPool. + /// + /// The objectFactory to be used by the pool. + /// An objectpool. + IObjectPool CreatePool(IPoolableObjectFactory poolableObjectFactory); + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/Properties/AssemblyInfo.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/Properties/AssemblyInfo.cs index 10c81a4..f78754f 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/Properties/AssemblyInfo.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("WCFChannelManager")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WCFChannelManager")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("9182274f-6e09-4f29-a3c9-f1af19550e2e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WCFChannelManager")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WCFChannelManager")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9182274f-6e09-4f29-a3c9-f1af19550e2e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ProxyChannel.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ProxyChannel.cs index f6310e2..b085126 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ProxyChannel.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/ProxyChannel.cs @@ -1,132 +1,134 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Spring.Proxy; -using System.Reflection.Emit; -using System.ServiceModel.Channels; -using System.ServiceModel; -using System.Reflection; -using System.Collections; - -namespace WCFChannelManager -{ - /// - /// ProxyChannel has the workflow that needs to be done before an action on a channel is done, calls the action on the channel - /// and finally any cleanup that needs to be done after the action is completed. - /// - /// The type of the channel. - public class ProxyChannel - { - /// - /// Default constructor. - /// - public ProxyChannel() - : this(null) - { - - } - - /// - /// Constructor that takes a channelManager. - /// - /// The channelmanager to use in this instance of ProxyChannel - public ProxyChannel(IChannelManager channelManager) - { - ChannelManager = channelManager; - } - - /// - /// The ChannelManager used. The ProxyChannel delegates channel creation and cleanup to this instance. - /// - public virtual IChannelManager ChannelManager - { - get; - set; - } - - /// - /// Retrieve a channel to work with. - /// - /// A channel that can be used. - protected virtual TChannel GetChannelToWorkWith() - { - return ChannelManager.FetchChannelToWorkWith(); - } - - /// - /// Execute a method on a channel. - /// - /// The method to invoke on the channel. - /// Any parameters that are needed when invoking the method. - /// AReturns any value returned by the method invoked on the channel. - protected object[] ExecuteInChannel(MethodInfo method, object[] parameters) - { - TChannel channel = GetChannelToWorkWith(); - object returnValue; - try - { - returnValue = method.Invoke(channel, parameters); - } - catch (Exception) - { - throw; - } - finally - { - FinishedWorkWithChannel(channel); - } - return new object[] { returnValue }; - } - - /// - /// When work on a channel has been completed the channel is handed for any cleanup work. - /// - /// The channel which has been used. - protected virtual void FinishedWorkWithChannel(TChannel channel) - { - ChannelManager.FinishedWorkWithChannel(channel); - } - - /// - /// Executes the method matched by the methodname and parameters on a channel of TChannel. - /// - /// The name of the method. - /// Parameters used by the method. - /// Returns any value returned by the method invoked on the channel. - protected object Execute(string methodName, object[] parameters) - { - Type[] parameterTypes; - if(parameters == null || parameters.Length == 0) - { - parameterTypes = Type.EmptyTypes; - } - else - { - List types = new List(); - foreach(object o in parameters) - { - types.Add(o.GetType()); - } - parameterTypes = types.ToArray(); - } - MethodInfo methodToCall = typeof(TChannel).GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public, null, parameterTypes,null); - return ExecuteInChannel(methodToCall, parameters); - } - - } -} +//Copyright 2013 Sergio Moreno Calzada + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Spring.Proxy; +using System.Reflection.Emit; +using System.ServiceModel.Channels; +using System.ServiceModel; +using System.Reflection; +using System.Collections; + +namespace WCFChannelManager +{ + /// + /// ProxyChannel has the workflow that needs to be done before an action on a channel is done, calls the action on the channel + /// and finally any cleanup that needs to be done after the action is completed. + /// + /// The type of the channel. + public class ProxyChannel + { + /// + /// Default constructor. + /// + public ProxyChannel() + : this(null) + { + + } + + /// + /// Constructor that takes a channelManager. + /// + /// The channelmanager to use in this instance of ProxyChannel + public ProxyChannel(IChannelManager channelManager) + { + ChannelManager = channelManager; + } + + /// + /// The ChannelManager used. The ProxyChannel delegates channel creation and cleanup to this instance. + /// + public virtual IChannelManager ChannelManager + { + get; + set; + } + + /// + /// Retrieve a channel to work with. + /// + /// A channel that can be used. + protected virtual TChannel GetChannelToWorkWith() + { + return ChannelManager.FetchChannelToWorkWith(); + } + + /// + /// Execute a method on a channel. + /// + /// The method to invoke on the channel. + /// Any parameters that are needed when invoking the method. + /// AReturns any value returned by the method invoked on the channel. + protected object ExecuteInChannel(MethodInfo method, object[] parameters) + { + TChannel channel = GetChannelToWorkWith(); + object returnValue; + try + { + returnValue = method.Invoke(channel, parameters); + } + catch (Exception) + { + throw; + } + finally + { + FinishedWorkWithChannel(channel); + } + return returnValue ; + } + + /// + /// When work on a channel has been completed the channel is handed for any cleanup work. + /// + /// The channel which has been used. + protected virtual void FinishedWorkWithChannel(TChannel channel) + { + ChannelManager.FinishedWorkWithChannel(channel); + } + + /// + /// Executes the method matched by the methodname and parameters on a channel of TChannel. + /// + /// The name of the method. + /// Parameters used by the method. + /// Returns any value returned by the method invoked on the channel. + public object Execute(MethodInfo method, object[] parameters) + { + + Type[] parameterTypes = method.GetParameters().Select(p => p.ParameterType).ToArray(); + //Type[] parameterTypes; + //if(parameters == null || parameters.Length == 0) + //{ + // parameterTypes = Type.EmptyTypes; + //} + //else + //{ + // List types = new List(); + // foreach(object o in parameters) + // { + // types.Add(o.GetType()); + // } + // parameterTypes = types.ToArray(); + //} + MethodInfo methodToCall = typeof(TChannel).GetMethod(method.Name, BindingFlags.Instance | BindingFlags.Public, null, parameterTypes,null); + return ExecuteInChannel(methodToCall, parameters); + } + + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/SimplePoolFactory.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/SimplePoolFactory.cs index 14c4e1f..7fdb3f0 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/SimplePoolFactory.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/SimplePoolFactory.cs @@ -1,55 +1,55 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Spring.Pool; -using Spring.Pool.Support; - -namespace WCFChannelManager -{ - public class SimplePoolFactory - : IPoolFactory - { - public const int DefaultPoolSize = 5; - - public SimplePoolFactory() - : this(DefaultPoolSize) - { - - } - - public SimplePoolFactory(int size) - { - PoolSize = size; - } - - public int PoolSize - { - get; - set; - } - - #region IPoolFactory Members - - public IObjectPool CreatePool(IPoolableObjectFactory poolableObjectFactory) - { - return new SimplePool(poolableObjectFactory, PoolSize); - } - - #endregion - } -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Spring.Pool; +using Spring.Pool.Support; + +namespace WCFChannelManager +{ + public class SimplePoolFactory + : IPoolFactory + { + public const int DefaultPoolSize = 5; + + public SimplePoolFactory() + : this(DefaultPoolSize) + { + + } + + public SimplePoolFactory(int size) + { + PoolSize = size; + } + + public int PoolSize + { + get; + set; + } + + #region IPoolFactory Members + + public IObjectPool CreatePool(IPoolableObjectFactory poolableObjectFactory) + { + return new SimplePool(poolableObjectFactory, PoolSize); + } + + #endregion + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/SingleActionChannelManager.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/SingleActionChannelManager.cs index 3ab4e3a..972d22b 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/SingleActionChannelManager.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/SingleActionChannelManager.cs @@ -1,72 +1,72 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ServiceModel; - -namespace WCFChannelManager -{ - /// - /// Creates a channel for one time use. - /// - /// The type of the channel. - public class SingleActionChannelManager - : ChannelManagerBase - { - - /// - /// Constructor which takes the name of a valid endpoint. - /// - /// The name of the endpoint. - public SingleActionChannelManager(string endpointConfigurationName) - : base(endpointConfigurationName) - { - - } - - /// - /// Constructor which takes a channelfactory which can be used by this instance. - /// - /// - public SingleActionChannelManager(ICanCreateChannels factory) - : base(factory) - { - - } - - /// - /// Creates a channel that can be used. - /// - /// A usable channel. - public override TChannel FetchChannelToWorkWith() - { - return CreateAndOpenChannel(); - } - - /// - /// Closes the channel being passed. - /// - /// The channel to close. - public override void FinishedWorkWithChannel(TChannel channel) - { - CloseChannel(channel); - } - - } - - -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ServiceModel; + +namespace WCFChannelManager +{ + /// + /// Creates a channel for one time use. + /// + /// The type of the channel. + public class SingleActionChannelManager + : ChannelManagerBase + { + + /// + /// Constructor which takes the name of a valid endpoint. + /// + /// The name of the endpoint. + public SingleActionChannelManager(string endpointConfigurationName) + : base(endpointConfigurationName) + { + + } + + /// + /// Constructor which takes a channelfactory which can be used by this instance. + /// + /// + public SingleActionChannelManager(ICanCreateChannels factory) + : base(factory) + { + + } + + /// + /// Creates a channel that can be used. + /// + /// A usable channel. + public override TChannel FetchChannelToWorkWith() + { + return CreateAndOpenChannel(); + } + + /// + /// Closes the channel being passed. + /// + /// The channel to close. + public override void FinishedWorkWithChannel(TChannel channel) + { + CloseChannel(channel); + } + + } + + +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WCFChannelManager.csproj b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WCFChannelManager.csproj index db7a49b..7369c11 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WCFChannelManager.csproj +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WCFChannelManager.csproj @@ -1,79 +1,97 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938} - Library - Properties - WCFChannelManager - Perponcher.WCFChannelManager - v3.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\..\sharedlib\Spring.Net\Spring.Core.dll - - - - 3.5 - - - 3.0 - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938} + Library + Properties + WCFChannelManager + Perponcher.WCFChannelManager + v4.0 + 512 + + + + + 3.5 + ..\ + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\packages\Common.Logging.1.2.0\lib\1.0\Common.Logging.dll + + + ..\packages\Spring.Aop.1.3.2\lib\net35\Spring.Aop.dll + + + False + ..\packages\Spring.Core.1.3.2\lib\net35\Spring.Core.dll + + + + 3.5 + + + 3.0 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfChannelProxyTypeBuilder.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfChannelProxyTypeBuilder.cs index a38d75e..75bdf31 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfChannelProxyTypeBuilder.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfChannelProxyTypeBuilder.cs @@ -1,130 +1,130 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Spring.Proxy; -using System.Reflection.Emit; - -namespace WCFChannelManager -{ - /// - /// Builds subclasses of a ProxyChannel type so all calls get handled by the Execute method. - /// - public class WcfChannelProxyTypeBuilder - : AbstractProxyTypeBuilder - { - /// - /// Default Constructor. - /// - /// The type to subclass. - public WcfChannelProxyTypeBuilder(Type channelActionWrapper) - { - if (!IsSubclassOfRawGeneric(typeof(ProxyChannel<>), channelActionWrapper)) - { - throw new ArgumentException("The type used as channelActionWrapper should inherit from ChannelActionWrapper"); - } - - ChannelManagerType = channelActionWrapper; - } - - /// - /// Checks if a class is a subclass of generic class. - /// - /// The generic class. - /// The type to check. - /// True if its a subclass, otherwise false. - public static bool IsSubclassOfRawGeneric(Type generic, Type toCheck) - { - bool isSubclass = false; - while (toCheck != typeof(object) && !isSubclass) - { - var cur = toCheck.IsGenericType ? toCheck.GetGenericTypeDefinition() : toCheck; - if (generic == cur) - { - return true; - } - toCheck = toCheck.BaseType; - } - return isSubclass; - } - - /// - /// Finds the channeltype from a ChannelActionWrapperType. - /// - /// The ChannelManagerType. - /// Returns the channaltype if found, otherwise null. - public static Type FindChannelType(Type channelManagerType) - { - Type t = channelManagerType; - Type channelType = null; - while (t != typeof(object)&& channelType == null) - { - var cur = t.IsGenericType ? t.GetGenericTypeDefinition() : t; - if (typeof(ProxyChannel<>) == cur) - { - channelType = t.GetGenericArguments()[0]; - } - t = t.BaseType; - } - return channelType; - } - - /// - /// The ChannelManagerType. - /// - public Type ChannelManagerType - { - get; - set; - } - - /// - /// The channeltype. - /// - public Type ChannelType - { - get - { - return FindChannelType(ChannelManagerType); - } - } - - #region AbstractProxyTypeBuilder Members - - /// - /// Create the new type. - /// - /// A subclass of ProxyChannel with channel interface implementation. - public override Type BuildProxyType() - { - TypeBuilder builder = CreateTypeBuilder(Name, ChannelManagerType); - ImplementInterface(builder, new WcfMethodBuilder(builder, this, ChannelManagerType), ChannelType, TargetType); - return builder.CreateType(); - } - - /// - /// Pushed the target. - /// - /// IL generator. - public override void PushTarget(System.Reflection.Emit.ILGenerator il) - { - PushProxy(il); - } - - #endregion - } -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Spring.Proxy; +using System.Reflection.Emit; + +namespace WCFChannelManager +{ + /// + /// Builds subclasses of a ProxyChannel type so all calls get handled by the Execute method. + /// + public class WcfChannelProxyTypeBuilder + : AbstractProxyTypeBuilder + { + /// + /// Default Constructor. + /// + /// The type to subclass. + public WcfChannelProxyTypeBuilder(Type channelActionWrapper) + { + if (!IsSubclassOfRawGeneric(typeof(ProxyChannel<>), channelActionWrapper)) + { + throw new ArgumentException("The type used as channelActionWrapper should inherit from ChannelActionWrapper"); + } + + ChannelManagerType = channelActionWrapper; + } + + /// + /// Checks if a class is a subclass of generic class. + /// + /// The generic class. + /// The type to check. + /// True if its a subclass, otherwise false. + public static bool IsSubclassOfRawGeneric(Type generic, Type toCheck) + { + bool isSubclass = false; + while (toCheck != typeof(object) && !isSubclass) + { + var cur = toCheck.IsGenericType ? toCheck.GetGenericTypeDefinition() : toCheck; + if (generic == cur) + { + return true; + } + toCheck = toCheck.BaseType; + } + return isSubclass; + } + + /// + /// Finds the channeltype from a ChannelActionWrapperType. + /// + /// The ChannelManagerType. + /// Returns the channaltype if found, otherwise null. + public static Type FindChannelType(Type channelManagerType) + { + Type t = channelManagerType; + Type channelType = null; + while (t != typeof(object)&& channelType == null) + { + var cur = t.IsGenericType ? t.GetGenericTypeDefinition() : t; + if (typeof(ProxyChannel<>) == cur) + { + channelType = t.GetGenericArguments()[0]; + } + t = t.BaseType; + } + return channelType; + } + + /// + /// The ChannelManagerType. + /// + public Type ChannelManagerType + { + get; + set; + } + + /// + /// The channeltype. + /// + public Type ChannelType + { + get + { + return FindChannelType(ChannelManagerType); + } + } + + #region AbstractProxyTypeBuilder Members + + /// + /// Create the new type. + /// + /// A subclass of ProxyChannel with channel interface implementation. + public override Type BuildProxyType() + { + TypeBuilder builder = CreateTypeBuilder(Name, ChannelManagerType); + ImplementInterface(builder, new WcfMethodBuilder(builder, this, ChannelManagerType), ChannelType, TargetType); + return builder.CreateType(); + } + + /// + /// Pushed the target. + /// + /// IL generator. + public override void PushTarget(System.Reflection.Emit.ILGenerator il) + { + PushProxy(il); + } + + #endregion + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfInterceptor.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfInterceptor.cs new file mode 100644 index 0000000..88daa02 --- /dev/null +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfInterceptor.cs @@ -0,0 +1,55 @@ +//Copyright 2013 Sergio Moreno Calzada + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +namespace WCFChannelManager +{ + using AopAlliance.Intercept; + + public class WcfInterceptor : IMethodInterceptor + { + #region IMethodInterceptor + + public object Invoke(IMethodInvocation invocation) + { + if (!ShouldProxyMethod(invocation.Method.Name)) + { + return invocation.Proceed(); + } + + var proxy = this.GetProxy(invocation.Target); + if (proxy == null) + { + return invocation.Proceed(); + } + + var result = proxy.Execute(invocation.Method, invocation.Arguments); + return result; + } + + private bool ShouldProxyMethod(string methodName) + { + var type = typeof(TChannel); + var method = type.GetMethod(methodName); + var shoudProxy = method != null; + return shoudProxy; + } + + #endregion + + public ProxyChannel GetProxy(object target) + { + return target as ProxyChannel; + } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfMethodBuilder.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfMethodBuilder.cs index 42cdadf..e9964e1 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfMethodBuilder.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/WcfMethodBuilder.cs @@ -1,147 +1,147 @@ -//Copyright 2009 Benny Michielsen - -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 - -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Collections; -using System.Reflection; -using System.Reflection.Emit; -using Spring.Proxy; - -namespace WCFChannelManager -{ - public class WcfMethodBuilder - : AbstractProxyMethodBuilder - { - private const string ExecuteMethodName = "Execute"; - - public WcfMethodBuilder(TypeBuilder builder, IProxyTypeGenerator generator, Type channelManager) - : base(builder, generator, false) - { - InvokeMethod = channelManager.GetMethod(ExecuteMethodName, BindingFlags.NonPublic | BindingFlags.Instance); - } - - protected MethodInfo InvokeMethod - { - get; - set; - } - - protected override void GenerateMethod(ILGenerator il, System.Reflection.MethodInfo method, System.Reflection.MethodInfo interfaceMethod) - { - // In Parameters - ArrayList inParams = new ArrayList(); - // Ref or Out Parameters - ArrayList refOutParams = new ArrayList(); - - foreach (ParameterInfo paramInfo in interfaceMethod.GetParameters()) - { - if (paramInfo.IsRetval || paramInfo.IsOut) - { - refOutParams.Add(paramInfo); - } - else - { - inParams.Add(paramInfo); - } - } - - proxyGenerator.PushTarget(il); - - //LocalBuilder methodToCall = il.DeclareLocal(typeof(MethodInfo)); - //il.Emit(OpCodes.Newobj, interfaceMethod); - //il.Emit(OpCodes.Ldloc, methodToCall); - il.Emit(OpCodes.Ldstr, interfaceMethod.Name); - - - - // Parameter #2 - LocalBuilder parameters = il.DeclareLocal(typeof(Object[])); - il.Emit(OpCodes.Ldc_I4, inParams.Count); - il.Emit(OpCodes.Newarr, typeof(Object)); - il.Emit(OpCodes.Stloc, parameters); - - int paramIndex = 0; - foreach (ParameterInfo paramInfo in inParams) - { - il.Emit(OpCodes.Ldloc, parameters); - il.Emit(OpCodes.Ldc_I4, paramIndex); - il.Emit(OpCodes.Ldarg, paramInfo.Position + 1); - if (paramInfo.ParameterType.IsValueType) - { - il.Emit(OpCodes.Box, paramInfo.ParameterType); - } - il.Emit(OpCodes.Stelem_Ref); - - paramIndex++; - } - - il.Emit(OpCodes.Ldloc, parameters); - - // Call Invoke method and save result - LocalBuilder results = il.DeclareLocal(typeof(Object[])); - il.EmitCall(OpCodes.Callvirt, InvokeMethod, null); - il.Emit(OpCodes.Stloc, results); - - - int resultIndex = (interfaceMethod.ReturnType == typeof(void) ? 0 : 1); - foreach (ParameterInfo paramInfo in refOutParams) - { - il.Emit(OpCodes.Ldarg, paramInfo.Position + 1); - il.Emit(OpCodes.Ldloc, results); - - // Cast / Unbox the return value - il.Emit(OpCodes.Ldc_I4, resultIndex); - il.Emit(OpCodes.Ldelem_Ref); - - Type elementType = paramInfo.ParameterType.GetElementType(); - if (elementType.IsValueType) - { - il.Emit(OpCodes.Unbox, elementType); - il.Emit(OpCodes.Ldobj, elementType); - il.Emit(OpCodes.Stobj, elementType); - } - else - { - il.Emit(OpCodes.Castclass, elementType); - il.Emit(OpCodes.Stind_Ref); - } - - resultIndex++; - } - - if (interfaceMethod.ReturnType != typeof(void)) - { - il.Emit(OpCodes.Ldloc, results); - - // Cast / Unbox the return value - il.Emit(OpCodes.Ldc_I4_0); - il.Emit(OpCodes.Ldelem_Ref); - if (interfaceMethod.ReturnType.IsValueType) - { - il.Emit(OpCodes.Unbox, interfaceMethod.ReturnType); - il.Emit(OpCodes.Ldobj, interfaceMethod.ReturnType); - } - else - { - il.Emit(OpCodes.Castclass, interfaceMethod.ReturnType); - } - } - - } - } - -} +//Copyright 2009 Benny Michielsen + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; +using System.Reflection; +using System.Reflection.Emit; +using Spring.Proxy; + +namespace WCFChannelManager +{ + public class WcfMethodBuilder + : AbstractProxyMethodBuilder + { + private const string ExecuteMethodName = "Execute"; + + public WcfMethodBuilder(TypeBuilder builder, IProxyTypeGenerator generator, Type channelManager) + : base(builder, generator, false) + { + InvokeMethod = channelManager.GetMethod(ExecuteMethodName, BindingFlags.NonPublic | BindingFlags.Instance); + } + + protected MethodInfo InvokeMethod + { + get; + set; + } + + protected override void GenerateMethod(ILGenerator il, System.Reflection.MethodInfo method, System.Reflection.MethodInfo interfaceMethod) + { + // In Parameters + ArrayList inParams = new ArrayList(); + // Ref or Out Parameters + ArrayList refOutParams = new ArrayList(); + + foreach (ParameterInfo paramInfo in interfaceMethod.GetParameters()) + { + if (paramInfo.IsRetval || paramInfo.IsOut) + { + refOutParams.Add(paramInfo); + } + else + { + inParams.Add(paramInfo); + } + } + + proxyGenerator.PushTarget(il); + + //LocalBuilder methodToCall = il.DeclareLocal(typeof(MethodInfo)); + //il.Emit(OpCodes.Newobj, interfaceMethod); + //il.Emit(OpCodes.Ldloc, methodToCall); + il.Emit(OpCodes.Ldstr, interfaceMethod.Name); + + + + // Parameter #2 + LocalBuilder parameters = il.DeclareLocal(typeof(Object[])); + il.Emit(OpCodes.Ldc_I4, inParams.Count); + il.Emit(OpCodes.Newarr, typeof(Object)); + il.Emit(OpCodes.Stloc, parameters); + + int paramIndex = 0; + foreach (ParameterInfo paramInfo in inParams) + { + il.Emit(OpCodes.Ldloc, parameters); + il.Emit(OpCodes.Ldc_I4, paramIndex); + il.Emit(OpCodes.Ldarg, paramInfo.Position + 1); + if (paramInfo.ParameterType.IsValueType) + { + il.Emit(OpCodes.Box, paramInfo.ParameterType); + } + il.Emit(OpCodes.Stelem_Ref); + + paramIndex++; + } + + il.Emit(OpCodes.Ldloc, parameters); + + // Call Invoke method and save result + LocalBuilder results = il.DeclareLocal(typeof(Object[])); + il.EmitCall(OpCodes.Callvirt, InvokeMethod, null); + il.Emit(OpCodes.Stloc, results); + + + int resultIndex = (interfaceMethod.ReturnType == typeof(void) ? 0 : 1); + foreach (ParameterInfo paramInfo in refOutParams) + { + il.Emit(OpCodes.Ldarg, paramInfo.Position + 1); + il.Emit(OpCodes.Ldloc, results); + + // Cast / Unbox the return value + il.Emit(OpCodes.Ldc_I4, resultIndex); + il.Emit(OpCodes.Ldelem_Ref); + + Type elementType = paramInfo.ParameterType.GetElementType(); + if (elementType.IsValueType) + { + il.Emit(OpCodes.Unbox, elementType); + il.Emit(OpCodes.Ldobj, elementType); + il.Emit(OpCodes.Stobj, elementType); + } + else + { + il.Emit(OpCodes.Castclass, elementType); + il.Emit(OpCodes.Stind_Ref); + } + + resultIndex++; + } + + if (interfaceMethod.ReturnType != typeof(void)) + { + il.Emit(OpCodes.Ldloc, results); + + // Cast / Unbox the return value + il.Emit(OpCodes.Ldc_I4_0); + il.Emit(OpCodes.Ldelem_Ref); + if (interfaceMethod.ReturnType.IsValueType) + { + il.Emit(OpCodes.Unbox, interfaceMethod.ReturnType); + il.Emit(OpCodes.Ldobj, interfaceMethod.ReturnType); + } + else + { + il.Emit(OpCodes.Castclass, interfaceMethod.ReturnType); + } + } + + } + } + +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/packages.config b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/packages.config new file mode 100644 index 0000000..6b94bba --- /dev/null +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManager/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/App.config b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/App.config index af96bc8..0e679de 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/App.config +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/App.config @@ -1,31 +1,31 @@ - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/IService.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/IService.cs index c7fdcba..991ad85 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/IService.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/IService.cs @@ -1,27 +1,30 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ServiceModel; - -namespace WCFChannelManagerTests -{ - [ServiceContract] - public interface IService - { - [OperationContract] - void DoOperation1(); - - [OperationContract] - int DoOperation2(); - - [OperationContract] - int DoOperation2WithNumber(int number); - - [OperationContract] - void Calculate(int a, int b, out int c); - - [OperationContract] - ComplexObject ReturnComplexObject(); - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ServiceModel; + +namespace WCFChannelManagerTests +{ + [ServiceContract] + public interface IService + { + [OperationContract] + void DoOperation1(); + + [OperationContract] + int DoOperation2(); + + [OperationContract] + int DoOperation2WithNumber(int number); + + [OperationContract] + void Calculate(int a, int b, out int c); + + [OperationContract] + ComplexObject ReturnComplexObject(); + + [OperationContract] + void DoOperationWithByRef(ref int number); + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/OpenGenericProxyChannel.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/OpenGenericProxyChannel.cs index 7d08a3a..1b54f2c 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/OpenGenericProxyChannel.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/OpenGenericProxyChannel.cs @@ -1,14 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using WCFChannelManager; - -namespace WCFChannelManagerTests -{ - public class OpenGenericProxyChannel - : ProxyChannel - { - - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using WCFChannelManager; + +namespace WCFChannelManagerTests +{ + public class OpenGenericProxyChannel + : ProxyChannel + { + + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Properties/AssemblyInfo.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Properties/AssemblyInfo.cs index 4d92fa9..aa84506 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Properties/AssemblyInfo.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("WCFChannelManagerTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WCFChannelManagerTests")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("300aa672-f5b5-4e05-aecb-eadb4285978c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WCFChannelManagerTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WCFChannelManagerTests")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("300aa672-f5b5-4e05-aecb-eadb4285978c")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Service.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Service.cs index 0e72e6a..0469b05 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Service.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Service.cs @@ -1,58 +1,62 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.Serialization; - -namespace WCFChannelManagerTests -{ - public class Service - : IService - { - #region IService Members - - public void DoOperation1() - { - - } - - public int DoOperation2() - { - return 5; - } - - public int DoOperation2WithNumber(int number) - { - return number; - } - - public void Calculate(int a, int b, out int c) - { - c = a + b; - } - - public object ReturnsNull() - { - return null; - } - - #endregion - - #region IService Members - - - public ComplexObject ReturnComplexObject() - { - return null; - } - - #endregion - } - - [DataContract] - public class ComplexObject - { - [DataMember] - public int Value { get; set; } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Runtime.Serialization; + +namespace WCFChannelManagerTests +{ + public class Service : IService + { + #region IService Members + + public void DoOperation1() + { + + } + + public int DoOperation2() + { + return 5; + } + + public int DoOperation2WithNumber(int number) + { + return number; + } + + public void Calculate(int a, int b, out int c) + { + c = a + b; + } + + public object ReturnsNull() + { + return null; + } + + #endregion + + #region IService Members + + + public ComplexObject ReturnComplexObject() + { + return null; + } + + public void DoOperationWithByRef(ref int number) + { + number = 5; + } + + #endregion + } + + [DataContract] + public class ComplexObject + { + [DataMember] + public int Value { get; set; } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/StubAutoSizePool.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/StubAutoSizePool.cs index 23f9719..9d6971d 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/StubAutoSizePool.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/StubAutoSizePool.cs @@ -1,35 +1,35 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using WCFChannelManager; -using Spring.Pool; - -namespace WCFChannelManagerTests -{ - public class StubAutoSizePool - : AutoSizePool - { - - public StubAutoSizePool(IPoolableObjectFactory factory) - : base(factory) - { - - } - - public void AddIdleObject(object o) - { - base.passiveObjects.Add(o); - } - - public void AddActiveObject(object o) - { - base.activeObjects.Add(o); - } - - public void SetClosed() - { - closed = true; - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using WCFChannelManager; +using Spring.Pool; + +namespace WCFChannelManagerTests +{ + public class StubAutoSizePool + : AutoSizePool + { + + public StubAutoSizePool(IPoolableObjectFactory factory) + : base(factory) + { + + } + + public void AddIdleObject(object o) + { + base.passiveObjects.Add(o); + } + + public void AddActiveObject(object o) + { + base.activeObjects.Add(o); + } + + public void SetClosed() + { + closed = true; + } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/StubProxyChannel.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/StubProxyChannel.cs index 6024585..3522f7d 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/StubProxyChannel.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/StubProxyChannel.cs @@ -1,20 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using WCFChannelManager; -using System.Reflection; - -namespace WCFChannelManagerTests -{ - public class StubProxyChannel - : ProxyChannel - { - public void DoOperation(MethodInfo methodInfo, object[] parameters) - { - base.ExecuteInChannel(methodInfo, parameters); - } - } - - -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using WCFChannelManager; +using System.Reflection; + +namespace WCFChannelManagerTests +{ + public class StubProxyChannel + : ProxyChannel + { + public void DoOperation(MethodInfo methodInfo, object[] parameters) + { + base.ExecuteInChannel(methodInfo, parameters); + } + } + + +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/AutoSizePoolFactoryTests.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/AutoSizePoolFactoryTests.cs index 623a9b2..5dfedb6 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/AutoSizePoolFactoryTests.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/AutoSizePoolFactoryTests.cs @@ -1,29 +1,29 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; -using WCFChannelManager; -using Rhino.Mocks; -using Spring.Pool; - -namespace WCFChannelManagerTests -{ - [TestFixture] - public class AutoSizePoolFactoryTests - { - [Test] - public void CreatePool_WhenCalled_ReturnsAutoSizePool() - { - var repo = new MockRepository(); - var poolableObjectFactory = repo.StrictMock(); - repo.ReplayAll(); - AutoSizePoolFactory factory = new AutoSizePoolFactory(); - - var result = factory.CreatePool(poolableObjectFactory); - - Assert.IsInstanceOfType(typeof(AutoSizePool), result); - repo.VerifyAll(); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using WCFChannelManager; +using Rhino.Mocks; +using Spring.Pool; + +namespace WCFChannelManagerTests +{ + [TestFixture] + public class AutoSizePoolFactoryTests + { + [Test] + public void CreatePool_WhenCalled_ReturnsAutoSizePool() + { + var repo = new MockRepository(); + var poolableObjectFactory = repo.StrictMock(); + repo.ReplayAll(); + AutoSizePoolFactory factory = new AutoSizePoolFactory(); + + var result = factory.CreatePool(poolableObjectFactory); + + Assert.IsInstanceOfType(typeof(AutoSizePool), result); + repo.VerifyAll(); + } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/AutoSizePoolTests.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/AutoSizePoolTests.cs index ac0179a..9535ef7 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/AutoSizePoolTests.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/AutoSizePoolTests.cs @@ -1,176 +1,176 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; -using WCFChannelManager; -using Rhino.Mocks; -using Spring.Pool; - -namespace WCFChannelManagerTests -{ - [TestFixture] - public class AutoSizePoolTests - { - private MockRepository repo; - private IPoolableObjectFactory factory; - private StubAutoSizePool pool; - - [SetUp] - public void Init() - { - repo = new MockRepository(); - factory = repo.StrictMock(); - pool = new StubAutoSizePool(factory); - } - - [TearDown] - public void StopTest() - { - repo.VerifyAll(); - } - - [Test] - public void PoolConstructor_WhenCalled_InitializesProperties() - { - repo.ReplayAll(); - - Assert.AreEqual(0, pool.NumActive); - Assert.AreEqual(0, pool.NumIdle); - Assert.AreSame(factory, pool.PoolableObjectFactory); - } - - [Test] - public void AddObject_WhenCalled_AddsObjectToIdle() - { - Expect.Call(factory.MakeObject()).Return(new object()); - repo.ReplayAll(); - pool.AddObject(); - Assert.AreEqual(1, pool.NumIdle); - } - - [Test] - public void BorrowObject_WhenCalled_ReturnsNewObjectWhenNoneExistedBefore() - { - object factoryProduct = new object(); - - Expect.Call(factory.MakeObject()).Return(factoryProduct); - factory.ActivateObject(factoryProduct); - repo.ReplayAll(); - - object borrowedObject = pool.BorrowObject(); - Assert.AreSame(borrowedObject, factoryProduct); - } - - [Test] - public void BorrowObject_WhenCalled_ReturnsIdleObject() - { - object idleObject = new object(); - pool.AddIdleObject(idleObject); - - factory.ActivateObject(idleObject); - Expect.Call(factory.ValidateObject(idleObject)).Return(true); - repo.ReplayAll(); - - object borrowedObject = pool.BorrowObject(); - Assert.AreSame(borrowedObject, idleObject); - } - - [Test] - public void BorrowObject_WhenCalled_CleansupInvalidIdles() - { - object invalidIdle = new object(); - object validObject = new object(); - pool.AddIdleObject(invalidIdle); - - factory.ActivateObject(invalidIdle); - Expect.Call(factory.ValidateObject(invalidIdle)).Return(false); - factory.DestroyObject(invalidIdle); - Expect.Call(factory.MakeObject()).Return(validObject); - factory.ActivateObject(validObject); - repo.ReplayAll(); - - object borrowedObject = pool.BorrowObject(); - Assert.AreSame(borrowedObject, validObject); - } - - [Test] - public void BorrowObject_WhenCalled_AddObjectToActiveList() - { - object newObject = new object(); - - Expect.Call(factory.MakeObject()).Return(newObject); - factory.ActivateObject(newObject); - repo.ReplayAll(); - - object borrowed = pool.BorrowObject(); - Assert.AreEqual(1, pool.NumActive); - } - - [Test] - public void Clear_WhenCalled_RemovesAllIdleObjects() - { - object idleOne = new object(); - object idleTwo = new object(); - pool.AddIdleObject(idleOne); - pool.AddIdleObject(idleTwo); - - factory.DestroyObject(idleOne); - factory.DestroyObject(idleTwo); - repo.ReplayAll(); - - pool.Clear(); - Assert.AreEqual(0, pool.NumIdle); - } - - [Test] - public void Close_WhenCalled_ClearsActiveAndIdleObjects() - { - object idle = new object(); - object active = new object(); - pool.AddIdleObject(idle); - pool.AddActiveObject(active); - - factory.DestroyObject(idle); - factory.DestroyObject(active); - repo.ReplayAll(); - - pool.Close(); - Assert.AreEqual(0, pool.NumIdle); - Assert.AreEqual(0, pool.NumActive); - } - - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void BorrowObject_WhenCalledOnClosedPool_ThrowsException() - { - repo.ReplayAll(); - pool.SetClosed(); - pool.BorrowObject(); - } - - [Test] - public void ReturnObject_WhenCalled_MakesObjectIdle() - { - object activeObject = new object(); - pool.AddActiveObject(activeObject); - - factory.PassivateObject(activeObject); - repo.ReplayAll(); - - pool.ReturnObject(activeObject); - Assert.AreEqual(1, pool.NumIdle); - } - - [Test] - public void ReturnObject_WhenCalledWithNotKnownObject_DoesNotMakeObjectIdle() - { - object stranger = new object(); - - repo.ReplayAll(); - - pool.ReturnObject(stranger); - Assert.AreEqual(0, pool.NumIdle); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using WCFChannelManager; +using Rhino.Mocks; +using Spring.Pool; + +namespace WCFChannelManagerTests +{ + [TestFixture] + public class AutoSizePoolTests + { + private MockRepository repo; + private IPoolableObjectFactory factory; + private StubAutoSizePool pool; + + [SetUp] + public void Init() + { + repo = new MockRepository(); + factory = repo.StrictMock(); + pool = new StubAutoSizePool(factory); + } + + [TearDown] + public void StopTest() + { + repo.VerifyAll(); + } + + [Test] + public void PoolConstructor_WhenCalled_InitializesProperties() + { + repo.ReplayAll(); + + Assert.AreEqual(0, pool.NumActive); + Assert.AreEqual(0, pool.NumIdle); + Assert.AreSame(factory, pool.PoolableObjectFactory); + } + + [Test] + public void AddObject_WhenCalled_AddsObjectToIdle() + { + Expect.Call(factory.MakeObject()).Return(new object()); + repo.ReplayAll(); + pool.AddObject(); + Assert.AreEqual(1, pool.NumIdle); + } + + [Test] + public void BorrowObject_WhenCalled_ReturnsNewObjectWhenNoneExistedBefore() + { + object factoryProduct = new object(); + + Expect.Call(factory.MakeObject()).Return(factoryProduct); + factory.ActivateObject(factoryProduct); + repo.ReplayAll(); + + object borrowedObject = pool.BorrowObject(); + Assert.AreSame(borrowedObject, factoryProduct); + } + + [Test] + public void BorrowObject_WhenCalled_ReturnsIdleObject() + { + object idleObject = new object(); + pool.AddIdleObject(idleObject); + + factory.ActivateObject(idleObject); + Expect.Call(factory.ValidateObject(idleObject)).Return(true); + repo.ReplayAll(); + + object borrowedObject = pool.BorrowObject(); + Assert.AreSame(borrowedObject, idleObject); + } + + [Test] + public void BorrowObject_WhenCalled_CleansupInvalidIdles() + { + object invalidIdle = new object(); + object validObject = new object(); + pool.AddIdleObject(invalidIdle); + + factory.ActivateObject(invalidIdle); + Expect.Call(factory.ValidateObject(invalidIdle)).Return(false); + factory.DestroyObject(invalidIdle); + Expect.Call(factory.MakeObject()).Return(validObject); + factory.ActivateObject(validObject); + repo.ReplayAll(); + + object borrowedObject = pool.BorrowObject(); + Assert.AreSame(borrowedObject, validObject); + } + + [Test] + public void BorrowObject_WhenCalled_AddObjectToActiveList() + { + object newObject = new object(); + + Expect.Call(factory.MakeObject()).Return(newObject); + factory.ActivateObject(newObject); + repo.ReplayAll(); + + object borrowed = pool.BorrowObject(); + Assert.AreEqual(1, pool.NumActive); + } + + [Test] + public void Clear_WhenCalled_RemovesAllIdleObjects() + { + object idleOne = new object(); + object idleTwo = new object(); + pool.AddIdleObject(idleOne); + pool.AddIdleObject(idleTwo); + + factory.DestroyObject(idleOne); + factory.DestroyObject(idleTwo); + repo.ReplayAll(); + + pool.Clear(); + Assert.AreEqual(0, pool.NumIdle); + } + + [Test] + public void Close_WhenCalled_ClearsActiveAndIdleObjects() + { + object idle = new object(); + object active = new object(); + pool.AddIdleObject(idle); + pool.AddActiveObject(active); + + factory.DestroyObject(idle); + factory.DestroyObject(active); + repo.ReplayAll(); + + pool.Close(); + Assert.AreEqual(0, pool.NumIdle); + Assert.AreEqual(0, pool.NumActive); + } + + [Test] + [ExpectedException(typeof(InvalidOperationException))] + public void BorrowObject_WhenCalledOnClosedPool_ThrowsException() + { + repo.ReplayAll(); + pool.SetClosed(); + pool.BorrowObject(); + } + + [Test] + public void ReturnObject_WhenCalled_MakesObjectIdle() + { + object activeObject = new object(); + pool.AddActiveObject(activeObject); + + factory.PassivateObject(activeObject); + repo.ReplayAll(); + + pool.ReturnObject(activeObject); + Assert.AreEqual(1, pool.NumIdle); + } + + [Test] + public void ReturnObject_WhenCalledWithNotKnownObject_DoesNotMakeObjectIdle() + { + object stranger = new object(); + + repo.ReplayAll(); + + pool.ReturnObject(stranger); + Assert.AreEqual(0, pool.NumIdle); + } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ChannelManagerFactoryObjectTests.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ChannelManagerFactoryObjectTests.cs index 9d9328d..d2a31cc 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ChannelManagerFactoryObjectTests.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ChannelManagerFactoryObjectTests.cs @@ -1,158 +1,158 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; -using WCFChannelManager; -using Spring.Objects.Factory.Support; -using Spring.Context.Support; -using Spring.Objects; -using System.ServiceModel; -using Spring.Pool.Support; - -namespace WCFChannelManagerTests -{ - [TestFixture] - public class ChannelManagerFactoryObjectTests - { - public const string EndpointName = "MyEndpoint"; - - public ChannelManagerFactoryObject Factory - { - get; - set; - } - - [SetUp] - public void StartTest() - { - Factory = new ChannelManagerFactoryObject(); - } - - private void SetupFactoryWithEndpointAndService() - { - SetupFactory(EndpointName, typeof(IService)); - } - - private void SetupFactory(string endpointName, Type channelType) - { - Factory.EndpointConfigurationName = endpointName; - Factory.ChannelType = channelType; - } - - [Test, ExpectedException(typeof(ArgumentException))] - public void AfterPropertiesSet_WhenNothingIsConfigured_ThrowsException() - { - Factory.AfterPropertiesSet(); - } - - [Test, ExpectedException(typeof(ArgumentException))] - public void AfterPropertiesSet_WhenMissingEndpoint_ThrowsException() - { - Factory.ChannelType = typeof(IService); - - Factory.AfterPropertiesSet(); - } - - [Test, ExpectedException(typeof(ArgumentException))] - public void AfterPropertiesSet_WhenMissingChannelType_ThrowsException() - { - Factory.EndpointConfigurationName = EndpointName; - - Factory.AfterPropertiesSet(); - } - - [Test, ExpectedException(typeof(ArgumentException))] - public void AfterPropertiesSet_WhenChannelTypeCanNotBeDerived_ThrowsException() - { - SetupFactory(EndpointName, null); - Factory.ChannelActionWrapperType = typeof(OpenGenericProxyChannel<>); - - Factory.AfterPropertiesSet(); - } - - [Test] - public void AfterProperties_WhenChannelTypeAndEndpointConfigured_Succeeds() - { - SetupFactoryWithEndpointAndService(); - - Factory.AfterPropertiesSet(); - } - - [Test] - public void AfterProperties_WhenChannelTypeCanBeDerivedAndEndpointConfigured_Succeeds() - { - SetupFactory(EndpointName, typeof(StubProxyChannel)); - - Factory.AfterPropertiesSet(); - } - - [Test] - public void GetObject_WhenCalled_ReturnsChannelMatchingChannelType() - { - SetupFactoryWithEndpointAndService(); - - object result = Factory.GetObject(); - - Assert.IsTrue(result is IService); - } - - [Test] - public void GetObject_WhenCalled_ReturnsChannelWithDefaultValues() - { - SetupFactoryWithEndpointAndService(); - - var result = Factory.GetObject() as ProxyChannel; - - Assert.IsNotNull(result.ChannelManager, "No default channelmanager was set"); - Assert.IsInstanceOfType(typeof(SingleActionChannelManager), result.ChannelManager); - } - - [Test] - public void GetObject_WhenConfiguredWithFixedPool_ReturnsChannelWithFixedPool() - { - AssertChannelHasPool(ChannelManagerFactoryObject.FixedPool, typeof(SimplePool)); - } - - private void AssertChannelHasPool(string channelManagementMode, Type poolType) - { - SetupFactoryWithEndpointAndService(); - Factory.ChannelManagementMode = channelManagementMode; - - var result = Factory.GetObject() as ProxyChannel; - - Assert.IsInstanceOfType(typeof(ChannelPoolManager), result.ChannelManager); - Assert.IsInstanceOfType(poolType, ((ChannelPoolManager)result.ChannelManager).Pool); - } - - - [Test] - public void GetObject_WhenCalledWithAutoSizePool_ReturnsChannelWithAutoSizePool() - { - AssertChannelHasPool(ChannelManagerFactoryObject.VariablePool, typeof(AutoSizePool)); - } - - [Test] - public void Factory_WhenObtainedFromContainer_HasContainerConfiguration() - { - RootObjectDefinition productTemplate = new RootObjectDefinition(); - productTemplate.PropertyValues.Add(new Spring.Objects.PropertyValue("ChannelManager.ChannelFactory.Credentials.UserName.UserName", "un")); - productTemplate.PropertyValues.Add(new Spring.Objects.PropertyValue("ChannelManager.ChannelFactory.Credentials.UserName.Password", "pw")); - GenericApplicationContext context = new GenericApplicationContext(); - IObjectDefinitionFactory objectDefinitionFactory = new DefaultObjectDefinitionFactory(); - ObjectDefinitionBuilder builder = ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof(ChannelManagerFactoryObject)); - builder.AddPropertyValue("EndpointConfigurationName",EndpointName); - builder.AddPropertyValue("ChannelType",typeof(IService)); - builder.AddPropertyValue("ProductTemplate", productTemplate); - context.RegisterObjectDefinition("myChannelFactoryObject", builder.ObjectDefinition); - - var obj = context.GetObject("myChannelFactoryObject")as ProxyChannel; - - Assert.IsNotNull(obj); - ChannelManagerBase channelManager = obj.ChannelManager as ChannelManagerBase; - Assert.IsNotNull(channelManager); - Assert.AreEqual("un", ((ChannelFactory)channelManager.ChannelFactory).Credentials.UserName.UserName); - Assert.AreEqual("pw", ((ChannelFactory)channelManager.ChannelFactory).Credentials.UserName.Password); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using WCFChannelManager; +using Spring.Objects.Factory.Support; +using Spring.Context.Support; +using Spring.Objects; +using System.ServiceModel; +using Spring.Pool.Support; + +namespace WCFChannelManagerTests +{ + [TestFixture] + public class ChannelManagerFactoryObjectTests + { + public const string EndpointName = "MyEndpoint"; + + public ChannelManagerFactoryObject Factory + { + get; + set; + } + + [SetUp] + public void StartTest() + { + Factory = new ChannelManagerFactoryObject(); + } + + private void SetupFactoryWithEndpointAndService() + { + SetupFactory(EndpointName, typeof(IService)); + } + + private void SetupFactory(string endpointName, Type channelType) + { + Factory.EndpointConfigurationName = endpointName; + Factory.ChannelType = channelType; + } + + [Test, ExpectedException(typeof(ArgumentException))] + public void AfterPropertiesSet_WhenNothingIsConfigured_ThrowsException() + { + Factory.AfterPropertiesSet(); + } + + [Test, ExpectedException(typeof(ArgumentException))] + public void AfterPropertiesSet_WhenMissingEndpoint_ThrowsException() + { + Factory.ChannelType = typeof(IService); + + Factory.AfterPropertiesSet(); + } + + [Test, ExpectedException(typeof(ArgumentException))] + public void AfterPropertiesSet_WhenMissingChannelType_ThrowsException() + { + Factory.EndpointConfigurationName = EndpointName; + + Factory.AfterPropertiesSet(); + } + + [Test, ExpectedException(typeof(ArgumentException))] + public void AfterPropertiesSet_WhenChannelTypeCanNotBeDerived_ThrowsException() + { + SetupFactory(EndpointName, null); + Factory.ChannelActionWrapperType = typeof(OpenGenericProxyChannel<>); + + Factory.AfterPropertiesSet(); + } + + [Test] + public void AfterProperties_WhenChannelTypeAndEndpointConfigured_Succeeds() + { + SetupFactoryWithEndpointAndService(); + + Factory.AfterPropertiesSet(); + } + + [Test] + public void AfterProperties_WhenChannelTypeCanBeDerivedAndEndpointConfigured_Succeeds() + { + SetupFactory(EndpointName, typeof(StubProxyChannel)); + + Factory.AfterPropertiesSet(); + } + + [Test] + public void GetObject_WhenCalled_ReturnsChannelMatchingChannelType() + { + SetupFactoryWithEndpointAndService(); + + object result = Factory.GetObject(); + + Assert.IsTrue(result is IService); + } + + [Test] + public void GetObject_WhenCalled_ReturnsChannelWithDefaultValues() + { + SetupFactoryWithEndpointAndService(); + + var result = Factory.GetObject() as ProxyChannel; + + Assert.IsNotNull(result.ChannelManager, "No default channelmanager was set"); + Assert.IsInstanceOfType(typeof(SingleActionChannelManager), result.ChannelManager); + } + + [Test] + public void GetObject_WhenConfiguredWithFixedPool_ReturnsChannelWithFixedPool() + { + AssertChannelHasPool(ChannelManagerFactoryObject.FixedPool, typeof(SimplePool)); + } + + private void AssertChannelHasPool(string channelManagementMode, Type poolType) + { + SetupFactoryWithEndpointAndService(); + Factory.ChannelManagementMode = channelManagementMode; + + var result = Factory.GetObject() as ProxyChannel; + + Assert.IsInstanceOfType(typeof(ChannelPoolManager), result.ChannelManager); + Assert.IsInstanceOfType(poolType, ((ChannelPoolManager)result.ChannelManager).Pool); + } + + + [Test] + public void GetObject_WhenCalledWithAutoSizePool_ReturnsChannelWithAutoSizePool() + { + AssertChannelHasPool(ChannelManagerFactoryObject.VariablePool, typeof(AutoSizePool)); + } + + [Test] + public void Factory_WhenObtainedFromContainer_HasContainerConfiguration() + { + RootObjectDefinition productTemplate = new RootObjectDefinition(); + productTemplate.PropertyValues.Add(new Spring.Objects.PropertyValue("ChannelManager.ChannelFactory.Credentials.UserName.UserName", "un")); + productTemplate.PropertyValues.Add(new Spring.Objects.PropertyValue("ChannelManager.ChannelFactory.Credentials.UserName.Password", "pw")); + GenericApplicationContext context = new GenericApplicationContext(); + IObjectDefinitionFactory objectDefinitionFactory = new DefaultObjectDefinitionFactory(); + ObjectDefinitionBuilder builder = ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, typeof(ChannelManagerFactoryObject)); + builder.AddPropertyValue("EndpointConfigurationName",EndpointName); + builder.AddPropertyValue("ChannelType",typeof(IService)); + builder.AddPropertyValue("ProductTemplate", productTemplate); + context.RegisterObjectDefinition("myChannelFactoryObject", builder.ObjectDefinition); + + var obj = context.GetObject("myChannelFactoryObject")as ProxyChannel; + + Assert.IsNotNull(obj); + ChannelManagerBase channelManager = obj.ChannelManager as ChannelManagerBase; + Assert.IsNotNull(channelManager); + Assert.AreEqual("un", ((ChannelFactory)channelManager.ChannelFactory).Credentials.UserName.UserName); + Assert.AreEqual("pw", ((ChannelFactory)channelManager.ChannelFactory).Credentials.UserName.Password); + } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ChannelPoolManagerTests.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ChannelPoolManagerTests.cs index 9ce01d9..b7e4364 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ChannelPoolManagerTests.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ChannelPoolManagerTests.cs @@ -1,138 +1,138 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; -using Rhino.Mocks; -using WCFChannelManager; -using Spring.Pool; -using System.ServiceModel; - -namespace WCFChannelManagerTests -{ - [TestFixture] - public class ChannelPoolManagerTests - { - MockRepository repo; - ICanCreateChannels channelCreator; - IPoolFactory poolFactory; - IObjectPool pool; - - [SetUp] - public void BeginTest() - { - repo = new MockRepository(); - channelCreator = repo.StrictMock>(); - poolFactory = repo.StrictMock(); - pool = repo.StrictMock(); - Expect.Call(poolFactory.CreatePool(null)).IgnoreArguments().Return(pool); - LastCall.IgnoreArguments(); - } - - [TearDown] - public void EndTest() - { - repo.VerifyAll(); - } - - private ChannelPoolManager CreatePoolManager() - { - return new ChannelPoolManager(channelCreator, poolFactory); - } - - private ICommunicationObject CreateCommunicationObject() - { - return repo.StrictMultiMock(typeof(IService)); - } - - private void AssertValidateObjectWithChannelInState(CommunicationState state, bool validateObjectReturns) - { - var commObject = CreateCommunicationObject(); - Expect.Call(commObject.State).Return(state); - repo.ReplayAll(); - - var isValid = ((IPoolableObjectFactory)CreatePoolManager()).ValidateObject(commObject); - - Assert.AreEqual(validateObjectReturns, isValid); - } - - [Test] - public void Constructor_WhenCalled_CreatesPool() - { - repo.ReplayAll(); - - Assert.IsNotNull(CreatePoolManager().Pool); - - } - - [Test] - public void ActivateObject_WhenCalled_OpensChannel() - { - var commObject = CreateCommunicationObject(); - Expect.Call(commObject.State).Return(CommunicationState.Created); - commObject.Open(); - repo.ReplayAll(); - - ((IPoolableObjectFactory)CreatePoolManager()).ActivateObject(commObject); - } - - [Test] - public void DestroyObject_WhenCalled_ClosesChannel() - { - var commObject = CreateCommunicationObject(); - commObject.Close(); - repo.ReplayAll(); - - ((IPoolableObjectFactory)CreatePoolManager()).DestroyObject(commObject); - } - - [Test] - public void MakeObject_WhenCalled_CreatesChannel() - { - Service channel = new Service(); - Expect.Call(channelCreator.CreateChannel()).Return(channel); - repo.ReplayAll(); - - var result = ((IPoolableObjectFactory)CreatePoolManager()).MakeObject(); - - Assert.AreSame(channel, result); - } - - [Test] - public void ValidateObject_WhenCalledWithOpenChannel_ReturnsTrue() - { - bool ValidateObjectReturns = true; - AssertValidateObjectWithChannelInState(CommunicationState.Opened, ValidateObjectReturns); - } - - [Test] - public void ValidateObject_WhenCalledWithClosedChannel_ReturnsFalse() - { - bool ValidateObjectReturns = false; - AssertValidateObjectWithChannelInState(CommunicationState.Closed, ValidateObjectReturns); - } - - [Test] - public void FetchChannelToWorkWith_WhenCalled_AsksPoolBorrow() - { - Service channel = new Service(); - Expect.Call(pool.BorrowObject()).Return(channel); - repo.ReplayAll(); - - var result = CreatePoolManager().FetchChannelToWorkWith(); - - Assert.AreSame(result, channel); - } - - - [Test] - public void FinishedWorkWithChannel_WhenCalled_ReturnsObjectToPool() - { - pool.ReturnObject(null); - LastCall.IgnoreArguments(); - repo.ReplayAll(); - - CreatePoolManager().FinishedWorkWithChannel(null); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using Rhino.Mocks; +using WCFChannelManager; +using Spring.Pool; +using System.ServiceModel; + +namespace WCFChannelManagerTests +{ + [TestFixture] + public class ChannelPoolManagerTests + { + MockRepository repo; + ICanCreateChannels channelCreator; + IPoolFactory poolFactory; + IObjectPool pool; + + [SetUp] + public void BeginTest() + { + repo = new MockRepository(); + channelCreator = repo.StrictMock>(); + poolFactory = repo.StrictMock(); + pool = repo.StrictMock(); + Expect.Call(poolFactory.CreatePool(null)).IgnoreArguments().Return(pool); + LastCall.IgnoreArguments(); + } + + [TearDown] + public void EndTest() + { + repo.VerifyAll(); + } + + private ChannelPoolManager CreatePoolManager() + { + return new ChannelPoolManager(channelCreator, poolFactory); + } + + private ICommunicationObject CreateCommunicationObject() + { + return repo.StrictMultiMock(typeof(IService)); + } + + private void AssertValidateObjectWithChannelInState(CommunicationState state, bool validateObjectReturns) + { + var commObject = CreateCommunicationObject(); + Expect.Call(commObject.State).Return(state); + repo.ReplayAll(); + + var isValid = ((IPoolableObjectFactory)CreatePoolManager()).ValidateObject(commObject); + + Assert.AreEqual(validateObjectReturns, isValid); + } + + [Test] + public void Constructor_WhenCalled_CreatesPool() + { + repo.ReplayAll(); + + Assert.IsNotNull(CreatePoolManager().Pool); + + } + + [Test] + public void ActivateObject_WhenCalled_OpensChannel() + { + var commObject = CreateCommunicationObject(); + Expect.Call(commObject.State).Return(CommunicationState.Created); + commObject.Open(); + repo.ReplayAll(); + + ((IPoolableObjectFactory)CreatePoolManager()).ActivateObject(commObject); + } + + [Test] + public void DestroyObject_WhenCalled_ClosesChannel() + { + var commObject = CreateCommunicationObject(); + commObject.Close(); + repo.ReplayAll(); + + ((IPoolableObjectFactory)CreatePoolManager()).DestroyObject(commObject); + } + + [Test] + public void MakeObject_WhenCalled_CreatesChannel() + { + Service channel = new Service(); + Expect.Call(channelCreator.CreateChannel()).Return(channel); + repo.ReplayAll(); + + var result = ((IPoolableObjectFactory)CreatePoolManager()).MakeObject(); + + Assert.AreSame(channel, result); + } + + [Test] + public void ValidateObject_WhenCalledWithOpenChannel_ReturnsTrue() + { + bool ValidateObjectReturns = true; + AssertValidateObjectWithChannelInState(CommunicationState.Opened, ValidateObjectReturns); + } + + [Test] + public void ValidateObject_WhenCalledWithClosedChannel_ReturnsFalse() + { + bool ValidateObjectReturns = false; + AssertValidateObjectWithChannelInState(CommunicationState.Closed, ValidateObjectReturns); + } + + [Test] + public void FetchChannelToWorkWith_WhenCalled_AsksPoolBorrow() + { + Service channel = new Service(); + Expect.Call(pool.BorrowObject()).Return(channel); + repo.ReplayAll(); + + var result = CreatePoolManager().FetchChannelToWorkWith(); + + Assert.AreSame(result, channel); + } + + + [Test] + public void FinishedWorkWithChannel_WhenCalled_ReturnsObjectToPool() + { + pool.ReturnObject(null); + LastCall.IgnoreArguments(); + repo.ReplayAll(); + + CreatePoolManager().FinishedWorkWithChannel(null); + } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ProxyChannelTests.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ProxyChannelTests.cs index 1417dc6..74e343e 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ProxyChannelTests.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/ProxyChannelTests.cs @@ -1,39 +1,64 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ServiceModel; -using WCFChannelManager; -using System.Reflection; -using System.ServiceModel.Channels; -using NUnit.Framework; -using Spring.Context.Support; -using Rhino.Mocks; - -namespace WCFChannelManagerTests -{ - [TestFixture] - public class ProxyChannelTests - { - [Test] - public void ProxyChannel_WhenCalledToExecuteMethod_DoesWorkflow() - { - StubProxyChannel wrapper = new StubProxyChannel(); - MockRepository repo = new MockRepository(); - var channelManager = repo.StrictMock>(); - var channel = repo.StrictMock(); - - Expect.Call(channelManager.FetchChannelToWorkWith()).Return(channel); - channel.DoOperation1(); - channelManager.FinishedWorkWithChannel(channel); - repo.ReplayAll(); - - wrapper.ChannelManager = channelManager; - MethodInfo methodToExecuteOnChannel = (typeof(IService)).GetMethod("DoOperation1"); - wrapper.DoOperation(methodToExecuteOnChannel, null); - repo.VerifyAll(); - - } - - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ServiceModel; +using WCFChannelManager; +using System.Reflection; +using System.ServiceModel.Channels; +using NUnit.Framework; +using Spring.Context.Support; +using Rhino.Mocks; + +namespace WCFChannelManagerTests +{ + [TestFixture] + public class ProxyChannelTests + { + [Test] + public void ProxyChannel_WhenCalledToExecuteMethod_DoesWorkflow() + { + StubProxyChannel wrapper = new StubProxyChannel(); + MockRepository repo = new MockRepository(); + var channelManager = repo.StrictMock>(); + var channel = repo.StrictMock(); + + Expect.Call(channelManager.FetchChannelToWorkWith()).Return(channel); + channel.DoOperation1(); + channelManager.FinishedWorkWithChannel(channel); + repo.ReplayAll(); + + wrapper.ChannelManager = channelManager; + MethodInfo methodToExecuteOnChannel = (typeof(IService)).GetMethod("DoOperation1"); + wrapper.DoOperation(methodToExecuteOnChannel, null); + repo.VerifyAll(); + + } + + [Test] + public void ProxyChannel_WhenCalledToExecuteMethod_WithByRefParameter_DoesWorkflow() + { + StubProxyChannel wrapper = new StubProxyChannel(); + MockRepository repo = new MockRepository(); + var channelManager = repo.StrictMock>(); + var channel = repo.StrictMock(); + + Expect.Call(channelManager.FetchChannelToWorkWith()).Return(channel); + var number = 0; + channel.DoOperationWithByRef(ref number); + channelManager.FinishedWorkWithChannel(channel); + repo.ReplayAll(); + + wrapper.ChannelManager = channelManager; + MethodInfo methodToExecuteOnChannel = (typeof(IService)).GetMethod("DoOperationWithByRef"); + wrapper.DoOperation(methodToExecuteOnChannel, new object[] {number}); + + repo.VerifyAll(); + + } + + } + + + +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/SimplePoolFactoryTests.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/SimplePoolFactoryTests.cs index 98d9411..7817899 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/SimplePoolFactoryTests.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/SimplePoolFactoryTests.cs @@ -1,48 +1,48 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; -using WCFChannelManager; -using Rhino.Mocks; -using Spring.Pool; -using Spring.Pool.Support; - -namespace WCFChannelManagerTests -{ - [TestFixture] - public class SimplePoolFactoryTests - { - [Test] - public void ConstructorWithNoArgs_WhenCalled_SetsDefaultPoolSize() - { - SimplePoolFactory factory = new SimplePoolFactory(); - - Assert.AreEqual(SimplePoolFactory.DefaultPoolSize, factory.PoolSize); - } - - [Test] - public void ConstructorWithIntArg_WhenCalled_SetsPoolSize() - { - int poolSize = 8; - SimplePoolFactory factory = new SimplePoolFactory(poolSize); - - Assert.AreEqual(poolSize, factory.PoolSize); - } - - [Test] - public void CreatePool_WhenCalled_CreateSimplePool() - { - MockRepository repo = new MockRepository(); - var poolableObjectFactory = repo.StrictMock(); - Expect.Call(poolableObjectFactory.MakeObject()).Return(new object()).Repeat.Times(SimplePoolFactory.DefaultPoolSize); - SimplePoolFactory factory = new SimplePoolFactory(); - repo.ReplayAll(); - - var result = factory.CreatePool(poolableObjectFactory); - - Assert.IsInstanceOfType(typeof(SimplePool), result); - repo.VerifyAll(); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using WCFChannelManager; +using Rhino.Mocks; +using Spring.Pool; +using Spring.Pool.Support; + +namespace WCFChannelManagerTests +{ + [TestFixture] + public class SimplePoolFactoryTests + { + [Test] + public void ConstructorWithNoArgs_WhenCalled_SetsDefaultPoolSize() + { + SimplePoolFactory factory = new SimplePoolFactory(); + + Assert.AreEqual(SimplePoolFactory.DefaultPoolSize, factory.PoolSize); + } + + [Test] + public void ConstructorWithIntArg_WhenCalled_SetsPoolSize() + { + int poolSize = 8; + SimplePoolFactory factory = new SimplePoolFactory(poolSize); + + Assert.AreEqual(poolSize, factory.PoolSize); + } + + [Test] + public void CreatePool_WhenCalled_CreateSimplePool() + { + MockRepository repo = new MockRepository(); + var poolableObjectFactory = repo.StrictMock(); + Expect.Call(poolableObjectFactory.MakeObject()).Return(new object()).Repeat.Times(SimplePoolFactory.DefaultPoolSize); + SimplePoolFactory factory = new SimplePoolFactory(); + repo.ReplayAll(); + + var result = factory.CreatePool(poolableObjectFactory); + + Assert.IsInstanceOfType(typeof(SimplePool), result); + repo.VerifyAll(); + } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/SingleActionChannelManagerTests.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/SingleActionChannelManagerTests.cs index 09c1528..a0c14d6 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/SingleActionChannelManagerTests.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/SingleActionChannelManagerTests.cs @@ -1,57 +1,57 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; -using WCFChannelManager; -using Rhino.Mocks; -using System.ServiceModel; - -namespace WCFChannelManagerTests.Tests -{ - [TestFixture] - public class SingleActionChannelManagerTests - { - MockRepository repo; - ICanCreateChannels channelFactory; - ICommunicationObject communicationObject; - SingleActionChannelManager manager; - - [SetUp] - public void BeginTest() - { - repo = new MockRepository(); - channelFactory = repo.StrictMock>(); - communicationObject = repo.StrictMultiMock(typeof(IService)); - manager = new SingleActionChannelManager(channelFactory); - } - - [TearDown] - public void EndTest() - { - repo.VerifyAll(); - } - - [Test] - public void FetchChannelToWorkWith_WhenCalled_CreatesAndOpensChannel() - { - Expect.Call(channelFactory.CreateChannel()).Return((IService)communicationObject); - Expect.Call(communicationObject.State).Return(CommunicationState.Created); - communicationObject.Open(); - repo.ReplayAll(); - - var channel = manager.FetchChannelToWorkWith(); - - Assert.AreSame(communicationObject, channel); - } - - [Test] - public void FinishedWorkWithChannel_WhenCalled_ClosesChannel() - { - communicationObject.Close(); - repo.ReplayAll(); - - manager.FinishedWorkWithChannel((IService)communicationObject); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using WCFChannelManager; +using Rhino.Mocks; +using System.ServiceModel; + +namespace WCFChannelManagerTests.Tests +{ + [TestFixture] + public class SingleActionChannelManagerTests + { + MockRepository repo; + ICanCreateChannels channelFactory; + ICommunicationObject communicationObject; + SingleActionChannelManager manager; + + [SetUp] + public void BeginTest() + { + repo = new MockRepository(); + channelFactory = repo.StrictMock>(); + communicationObject = repo.StrictMultiMock(typeof(IService)); + manager = new SingleActionChannelManager(channelFactory); + } + + [TearDown] + public void EndTest() + { + repo.VerifyAll(); + } + + [Test] + public void FetchChannelToWorkWith_WhenCalled_CreatesAndOpensChannel() + { + Expect.Call(channelFactory.CreateChannel()).Return((IService)communicationObject); + Expect.Call(communicationObject.State).Return(CommunicationState.Created); + communicationObject.Open(); + repo.ReplayAll(); + + var channel = manager.FetchChannelToWorkWith(); + + Assert.AreSame(communicationObject, channel); + } + + [Test] + public void FinishedWorkWithChannel_WhenCalled_ClosesChannel() + { + communicationObject.Close(); + repo.ReplayAll(); + + manager.FinishedWorkWithChannel((IService)communicationObject); + } + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/WcfChannelProxyTypeBuilderTests.cs b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/WcfChannelProxyTypeBuilderTests.cs index cd1959d..5f48944 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/WcfChannelProxyTypeBuilderTests.cs +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/Tests/WcfChannelProxyTypeBuilderTests.cs @@ -1,74 +1,74 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using NUnit.Framework; -using WCFChannelManager; -using System.Reflection; - -namespace WCFChannelManagerTests -{ - [TestFixture] - public class WcfChannelProxyTypeBuilderTests - { - [Test, ExpectedException(typeof(ArgumentException))] - public void Constructor_WhenCalledWithAnIncorrectType_ThrowsException() - { - WcfChannelProxyTypeBuilder builder = new WcfChannelProxyTypeBuilder(typeof(TimeZone)); - } - - [Test] - public void IsSubclassOfRawGeneric_WhenCalledWithClosedGenericSubclass_FindsGenericType() - { - Assert.IsTrue(WcfChannelProxyTypeBuilder.IsSubclassOfRawGeneric(typeof(ProxyChannel<>),typeof(StubProxyChannel))); - Assert.IsFalse(WcfChannelProxyTypeBuilder.IsSubclassOfRawGeneric(typeof(ProxyChannel<>), typeof(TimeZone))); - } - - [Test] - public void FindChannelType_WhenCalledWithSubclass_FindsChannelType() - { - Type t = WcfChannelProxyTypeBuilder.FindChannelType(typeof(StubProxyChannel)); - Assert.IsNotNull(t); - Assert.AreEqual(t, typeof(IService)); - } - - [Test] - public void BuildProxyType_WhenCalled_ImplementsInterfaceAndSubclassesProxyChannel() - { - WcfChannelProxyTypeBuilder builder = new WcfChannelProxyTypeBuilder(typeof(ProxyChannel)); - Type t = builder.BuildProxyType(); - Assert.IsNotNull(t); - Assert.IsTrue(t.IsSubclassOf(typeof(ProxyChannel))); - Assert.IsNotNull(t.GetInterface("IService", true)); - } - - [Test] - public void Proxy_WhenCallingMethodThatReturnsNull_DoesNotThrowException() - { - WcfChannelProxyTypeBuilder builder = new WcfChannelProxyTypeBuilder(typeof(ProxyChannel)); - - Type t = builder.BuildProxyType(); - ConstructorInfo constructorInfo = t.GetConstructors()[0]; - - ProxyChannel channel = (ProxyChannel) constructorInfo.Invoke(null); - channel.ChannelManager = new StubChannelManager(); - ((IService)channel).ReturnComplexObject(); - - } - - public class StubChannelManager - : IChannelManager - { - public IService FetchChannelToWorkWith() - { - return new Service(); - } - - public void FinishedWorkWithChannel(IService channel) - { - - } - } - - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using WCFChannelManager; +using System.Reflection; + +namespace WCFChannelManagerTests +{ + [TestFixture] + public class WcfChannelProxyTypeBuilderTests + { + [Test, ExpectedException(typeof(ArgumentException))] + public void Constructor_WhenCalledWithAnIncorrectType_ThrowsException() + { + WcfChannelProxyTypeBuilder builder = new WcfChannelProxyTypeBuilder(typeof(TimeZone)); + } + + [Test] + public void IsSubclassOfRawGeneric_WhenCalledWithClosedGenericSubclass_FindsGenericType() + { + Assert.IsTrue(WcfChannelProxyTypeBuilder.IsSubclassOfRawGeneric(typeof(ProxyChannel<>),typeof(StubProxyChannel))); + Assert.IsFalse(WcfChannelProxyTypeBuilder.IsSubclassOfRawGeneric(typeof(ProxyChannel<>), typeof(TimeZone))); + } + + [Test] + public void FindChannelType_WhenCalledWithSubclass_FindsChannelType() + { + Type t = WcfChannelProxyTypeBuilder.FindChannelType(typeof(StubProxyChannel)); + Assert.IsNotNull(t); + Assert.AreEqual(t, typeof(IService)); + } + + [Test] + public void BuildProxyType_WhenCalled_ImplementsInterfaceAndSubclassesProxyChannel() + { + WcfChannelProxyTypeBuilder builder = new WcfChannelProxyTypeBuilder(typeof(ProxyChannel)); + Type t = builder.BuildProxyType(); + Assert.IsNotNull(t); + Assert.IsTrue(t.IsSubclassOf(typeof(ProxyChannel))); + Assert.IsNotNull(t.GetInterface("IService", true)); + } + + [Test] + public void Proxy_WhenCallingMethodThatReturnsNull_DoesNotThrowException() + { + WcfChannelProxyTypeBuilder builder = new WcfChannelProxyTypeBuilder(typeof(ProxyChannel)); + + Type t = builder.BuildProxyType(); + ConstructorInfo constructorInfo = t.GetConstructors()[0]; + + ProxyChannel channel = (ProxyChannel) constructorInfo.Invoke(null); + channel.ChannelManager = new StubChannelManager(); + ((IService)channel).ReturnComplexObject(); + + } + + public class StubChannelManager + : IChannelManager + { + public IService FetchChannelToWorkWith() + { + return new Service(); + } + + public void FinishedWorkWithChannel(IService channel) + { + + } + } + + } +} diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/WCFChannelManagerTests.csproj b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/WCFChannelManagerTests.csproj index f6326b3..64ad4d6 100644 --- a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/WCFChannelManagerTests.csproj +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/WCFChannelManagerTests.csproj @@ -1,95 +1,111 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {092C9457-CC27-4AB3-9CB2-7488CB9AB267} - Library - Properties - WCFChannelManagerTests - Perponcher.WCFChannelManagerTests - v3.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - False - ..\..\..\..\sharedlib\Rhino Mocks\Rhino.Mocks.dll - - - False - ..\..\..\..\sharedlib\Spring.Net\Spring.Core.dll - - - - 3.5 - - - 3.0 - - - 3.0 - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938} - WCFChannelManager - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {092C9457-CC27-4AB3-9CB2-7488CB9AB267} + Library + Properties + WCFChannelManagerTests + Perponcher.WCFChannelManagerTests + v4.0 + 512 + + + + + 3.5 + ..\ + true + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Common.Logging.1.2.0\lib\1.0\Common.Logging.dll + + + ..\packages\NUnit.2.6.2\lib\nunit.framework.dll + + + False + ..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll + + + ..\packages\Spring.Aop.1.3.2\lib\net35\Spring.Aop.dll + + + ..\packages\Spring.Core.1.3.2\lib\net35\Spring.Core.dll + + + + 3.5 + + + 3.0 + + + 3.0 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + {E94EB6C3-E81F-4C5C-BEDE-B4CC79D0E938} + WCFChannelManager + + + + + + + + + \ No newline at end of file diff --git a/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/packages.config b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/packages.config new file mode 100644 index 0000000..0015417 --- /dev/null +++ b/WCFChannelManager/src/WCFChannelManager/WCFChannelManagerTests/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/sharedlib/Rhino Mocks/Rhino.Mocks.dll b/sharedlib/Rhino Mocks/Rhino.Mocks.dll deleted file mode 100644 index 4b6904b..0000000 Binary files a/sharedlib/Rhino Mocks/Rhino.Mocks.dll and /dev/null differ diff --git a/sharedlib/Rhino Mocks/Rhino.Mocks.xml b/sharedlib/Rhino Mocks/Rhino.Mocks.xml deleted file mode 100644 index 7518b3e..0000000 --- a/sharedlib/Rhino Mocks/Rhino.Mocks.xml +++ /dev/null @@ -1,5226 +0,0 @@ - - - - Rhino.Mocks.Partial - - - - - Interface for constraints - - - - - determains if the object pass the constraints - - - - - And operator for constraints - - - - - Not operator for constraints - - - - - Or operator for constraints - - - - - Allow overriding of || or && - - - - - - - Allow overriding of || or && - - - - - - - Gets the message for this constraint - - - - - - Initializes a new constraint object. - - The expected object, The actual object is passed in as a parameter to the method - - - - Evaluate this constraint. - - The actual object that was passed in the method call to the mock. - True when the constraint is met, else false. - - - - Checks if the properties of the object - are the same as the properies of the object. - - The expected object - The actual object - True when both objects have the same values, else False. - - - - - - - - - This is the real heart of the beast. - - - - Used by CheckReferenceType to check all properties of the reference type. - - The expected object - The actual object - True when both objects have the same values, else False. - - - - Used by CheckReferenceType to check all fields of the reference type. - - The expected object - The actual object - True when both objects have the same values, else False. - - - - Checks the items of both collections - - The expected collection - - True if both collections contain the same items in the same order. - - - - Builds a propertyname from the Stack _properties like 'Order.Product.Price' - to be used in the error message. - - A nested property name. - - - - Rhino.Mocks uses this property to generate an error message. - - - A message telling the tester why the constraint failed. - - - - - Constrain that the public field has a specified value - - - - - Constrain that the public field matches another constraint. - - - - - Creates a new instance. - - Name of the public field. - Constraint to place on the public field value. - - - - Creates a new instance, specifying a disambiguating - for the public field. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - Constraint to place on the public field value. - - - - Determines if the object passes the constraint. - - - - - Gets the message for this constraint - - - - - - Creates a new instance. - - Name of the public field. - Expected value. - - - - Creates a new instance, specifying a disambiguating - for the public field. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - Expected value. - - - - Constrain that the property has a specified value - - - - - Constrain that the property matches another constraint. - - - - - Creates a new instance. - - Name of the property. - Constraint to place on the property value. - - - - Creates a new instance, specifying a disambiguating - for the property. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - Constraint to place on the property value. - - - - Determines if the object passes the constraint. - - - - - Gets the message for this constraint - - - - - - Creates a new instance. - - Name of the property. - Expected value. - - - - Creates a new instance, specifying a disambiguating - for the property. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - Expected value. - - - - Constrain that the parameter must be of the specified type - - - - - Creates a new instance. - - Type. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that determines whether an object is the same object as another. - - - - - Creates a new instance. - - Obj. - - - - Determines if the object passes the constraints. - - - - - Gets the message for this constraint. - - - - - Evaluate a parameter using constraints - - - - - Create new instance - - - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - A constraint based on lambda expression, we are using Expression{T} - because we want to be able to get good error reporting on that. - - - - - Initializes a new instance of the class. - - The expr. - - - - determains if the object pass the constraints - - - - - - - Gets the message for this constraint - - - - - - Constrain that the list contains the same items as the parameter list - - - - - Creates a new instance. - - In list. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constrain that the parameter is one of the items in the list - - - - - Creates a new instance. - - In list. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constrain that the object is inside the parameter list - - - - - Creates a new instance. - - In list. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Applies another AbstractConstraint to the collection count. - - - - - Creates a new instance. - - The constraint that should be applied to the collection count. - - - - Determines if the parameter conforms to this constraint. - - - - - Gets the message for this constraint. - - - - - Applies another AbstractConstraint to a specific list element. - - - - - Creates a new instance. - - The zero-based index of the list element. - The constraint that should be applied to the list element. - - - - Determines if the parameter conforms to this constraint. - - - - - Gets the message for this constraint - - - - - - Applies another AbstractConstraint to a specific generic keyed list element. - - - - - Creates a new instance. - - The key of the list element. - The constraint that should be applied to the list element. - - - - Determines if the parameter conforms to this constraint. - - - - - Gets the message for this constraint - - - - - - Constrains that all elements are in the parameter list - - - - - Initializes a new instance of the class. - - The these. - - - - determains if the object pass the constraints - - - - - - - Gets the message for this constraint - - - - - - Combines two constraints, constraint pass if either is fine. - - - - - Creates a new instance. - - C1. - C2. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Negate a constraint - - - - - Creates a new instance. - - C1. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Combines two constraints - - - - - - Creates a new instance. - - C1. - C2. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constrain the argument to validate according to regex pattern - - - - - Creates a new instance. - - Pattern. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that evaluate whatever an argument contains the specified string. - - - - - Creates a new instance. - - Inner string. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that evaluate whatever an argument ends with the specified string - - - - - Creates a new instance. - - End. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that evaluate whatever an argument start with the specified string - - - - - Creates a new instance. - - Start. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that evaluate whatever an object equals another - - - - - Creates a new instance. - - Obj. - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that always returns true - - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that evaluate whatever a comparable is greater than another - - - - - Creates a new instance. - - - - - determains if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Central location for constraints - - - - - Evaluate a greater than constraint for . - - The object the parameter should be greater than - - - - Evaluate a less than constraint for . - - The object the parameter should be less than - - - - Evaluate a less than or equal constraint for . - - The object the parameter should be less than or equal to - - - - Evaluate a greater than or equal constraint for . - - The object the parameter should be greater than or equal to - - - - Evaluate an equal constraint for . - - The object the parameter should equal to - - - - Evaluate a not equal constraint for . - - The object the parameter should not equal to - - - - Evaluate a same as constraint. - - The object the parameter should the same as. - - - - Evaluate a not same as constraint. - - The object the parameter should not be the same as. - - - - A constraints that accept anything - - - - - - A constraint that accept only nulls - - - - - - A constraint that accept only non null values - - - - - - A constraint that accept only value of the specified type - - - - - A constraint that accept only value of the specified type - - - - - Evaluate a parameter using a predicate - - The predicate to use - - - - Provides access to the constraintes defined in the class to be used in context - with the syntax. - - The type of the argument - - - - Evaluate a greater than constraint for . - - The object the parameter should be greater than - - - - Evaluate a less than constraint for . - - The object the parameter should be less than - - - - Evaluate a less than or equal constraint for . - - The object the parameter should be less than or equal to - - - - Evaluate a greater than or equal constraint for . - - The object the parameter should be greater than or equal to - - - - Evaluate an equal constraint for . - - The object the parameter should equal to - - - - Evaluate a not equal constraint for . - - The object the parameter should not equal to - - - - Evaluate a same as constraint. - - The object the parameter should the same as. - - - - Evaluate a not same as constraint. - - The object the parameter should not be the same as. - - - - Throws NotSupportedException. Don't use Equals to define constraints. Use Equal instead. - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - A constraints that accept anything - - - - - - A constraint that accept only nulls - - - - - - A constraint that accept only non null values - - - - - - A constraint that accept only value of the specified type. - The check is performed on the type that has been defined - as the argument type. - - - - - Central location for constraints about lists and collections - - - - - Determines whether the specified obj is in the paramter. - The parameter must be IEnumerable. - - Obj. - - - - - Determains whatever the parameter is in the collection. - - - - - Determains that the parameter collection is identical to the specified collection - - - - - Determines that the parameter collection has the specified number of elements. - - The constraint that should be applied to the collection count. - - - - Determines that an element of the parameter collections conforms to another AbstractConstraint. - - The zero-based index of the list element. - The constraint which should be applied to the list element. - - - - Determines that an element of the parameter collections conforms to another AbstractConstraint. - - The key of the element. - The constraint which should be applied to the element. - - - - Determines that all elements of the specified collection are in the the parameter collection - - The collection to compare against - The constraint which should be applied to the list parameter. - - - - Provides access to the constraintes defined in the class to be used in context - with the syntax. - - - - - Determines whether the specified object is in the paramter. - The parameter must be IEnumerable. - - Obj. - - - - - Determains whatever the parameter is in the collection. - - - - - Determains that the parameter collection is identical to the specified collection - - - - - Determines that the parameter collection has the specified number of elements. - - The constraint that should be applied to the collection count. - - - - Determines that an element of the parameter collections conforms to another AbstractConstraint. - - The zero-based index of the list element. - The constraint which should be applied to the list element. - - - - Determines that all elements of the specified collection are in the the parameter collection - - The collection to compare against - The constraint which should be applied to the list parameter. - - - - Throws NotSupportedException. Don't use Equals to define constraints. Use Equal instead. - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Provides a dummy field to pass as out or ref argument. - - - - - - Dummy field to satisfy the compiler. Used for out and ref arguments. - - - - - Central location for constraints for object's properties - - - - - Constrains the parameter to have property with the specified value - - Name of the property. - Expected value. - - - - - Constrains the parameter to have property with the specified value. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - Expected value. - - - - - Constrains the parameter to have a property satisfying a specified constraint. - - Name of the property. - Constraint for the property. - - - - Constrains the parameter to have a property satisfying a specified constraint. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - Constraint for the property. - - - - Determines whether the parameter has the specified property and that it is null. - - Name of the property. - - - - - Determines whether the parameter has the specified property and that it is null. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - - - - - Determines whether the parameter has the specified property and that it is not null. - - Name of the property. - - - - - Determines whether the parameter has the specified property and that it is not null. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - - - - - constraints the parameter to have the exact same property values as the expected object. - - An object, of the same type as the parameter, whose properties are set with the expected values. - An instance of the constraint that will do the actual check. - - The parameter's public property values and public field values will be matched against the expected object's - public property values and public field values. The first mismatch will be reported and no further matching is done. - The matching is recursive for any property or field that has properties or fields of it's own. - Collections are supported through IEnumerable, which means the constraint will check if the actual and expected - collection contain the same values in the same order, where the values contained by the collection can have properties - and fields of their own that will be checked as well because of the recursive nature of this constraint. - - - - - Central location for constraints for object's public fields - - - - - Constrains the parameter to have a public field with the specified value - - Name of the public field. - Expected value. - - - - - Constrains the parameter to have a public field with the specified value. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - Expected value. - - - - - Constrains the parameter to have a public field satisfying a specified constraint. - - Name of the public field. - Constraint for the public field. - - - - Constrains the parameter to have a public field satisfying a specified constraint. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - Constraint for the public field. - - - - Determines whether the parameter has the specified public field and that it is null. - - Name of the public field. - - - - - Determines whether the parameter has the specified public field and that it is null. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - - - - - Determines whether the parameter has the specified public field and that it is not null. - - Name of the public field. - - - - - Determines whether the parameter has the specified public field and that it is not null. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - - - - - Central location for all text related constraints - - - - - Constrain the argument to starts with the specified string - - - - - Constrain the argument to end with the specified string - - - - - Constrain the argument to contain the specified string - - - - - Constrain the argument to validate according to regex pattern - - - - - Provides access to the constraintes defined in the class to be used in context - with the syntax. - - - - - Constrain the argument to starts with the specified string - - - - - - Constrain the argument to end with the specified string - - - - - Constrain the argument to contain the specified string - - - - - Constrain the argument to validate according to regex pattern - - - - - Throws NotSupportedException. Don't use Equals to define constraints. Use Equal instead. - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - An expectaton violation was detected. - - - - - Creates a new instance. - - Message. - - - - Serialization constructor - - - - - Signals that an object was call on a mock repostiroy which doesn't - belong to this mock repository or not a mock - - - - - Creates a new instance. - - Message. - - - - Serialization constructor - - - - - Abstract class that holds common information for - expectations. - - - - - Interface to validate that a method call is correct. - - - - - Validate the arguments for the method. - This method can be called numerous times, so be careful about side effects - - The arguments with which the method was called - - - - Add an actual method call to this expectation - - - - - Returns the return value or throw the exception and setup any output / ref parameters - that has been set. - - - - - Allow to set the return value in the future, if it was already set. - - - - - Builds the verification failure message. - - - - - - Gets the error message. - - - - - - Range of expected calls - - - - - Number of call actually made for this method - - - - - If this expectation is still waiting for calls. - - - - - The return value for a method matching this expectation - - - - - Gets or sets the exception to throw on a method matching this expectation. - - - - - Gets a value indicating whether this instance's action is staisfied. - A staisfied instance means that there are no more requirements from - this method. A method with non void return value must register either - a return value or an exception to throw. - - - - - Gets the method this expectation is for. - - - - - Gets or sets what special condtions there are for this method - repeating. - - - - - Gets a value indicating whether this expectation was satisfied - - - - - Specify whatever this expectation has a return value set - You can't check ReturnValue for this because a valid return value include null. - - - - - An action to execute when the method is matched. - - - - - Set the out / ref parameters for the method call. - The indexing is zero based and ignores any non out/ref parameter. - It is possible not to pass all the parameters. This method can be called only once. - - - - - Documentation Message - - - - - Gets the invocation for this expectation - - The invocation. - - - - Occurs when the exceptation is match on a method call - - - - - Number of actuall calls made that passed this expectation - - - - - Range of expected calls that should pass this expectation. - - - - - The return value for a method matching this expectation - - - - - The exception to throw on a method matching this expectation. - - - - - The method this expectation is for. - - - - - The return value for this method was set - - - - - Whether this method will repeat - unlimited number of times. - - - - - A delegate that will be run when the - expectation is matched. - - - - - The arguments that matched this expectation. - - - - - Documentation message - - - - - The method originalInvocation - - - - - Get the hash code - - - - - Add an actual actualMethodCall call to this expectation - - - - - Builds the verification failure message. - - - - - - Allow to set the return value in the future, if it was already set. - - - - - Returns the return value or throw the exception and setup output / ref parameters - - - - - Validate the arguments for the method on the child methods - - The arguments with which the method was called - - - - Creates a new instance. - - The originalInvocation for this method, required because it contains the generic type infromation - - - - Creates a new instance. - - Expectation. - - - - Validate the arguments for the method on the child methods - - The arguments with which the method was called - - - - Determines if this object equal to obj - - - - - The error message for these arguments - - - - - Asserts that the delegate has the same parameters as the expectation's method call - - - - - Setter for the outpur / ref parameters for this expecataion. - Can only be set once. - - - - - Specify whatever this expectation has a return value set - You can't check ReturnValue for this because a valid return value include null. - - - - - Gets the method this expectation is for. - - - - - Gets the originalInvocation for this expectation - - The originalInvocation. - - - - Gets or sets what special condtions there are for this method - - - - - Range of expected calls - - - - - Number of call actually made for this method - - - - - If this expectation is still waiting for calls. - - - - - Gets a value indicating whether this expectation was satisfied - - - - - The return value for a method matching this expectation - - - - - An action to execute when the method is matched. - - - - - Gets or sets the exception to throw on a method matching this expectation. - - - - - Gets a value indicating whether this instance's action is staisfied. - A staisfied instance means that there are no more requirements from - this method. A method with non void return value must register either - a return value or an exception to throw or an action to execute. - - - - - Documentation message - - - - - Occurs when the exceptation is match on a method call - - - - - Gets the error message. - - - - - - Expectation that matchs any arguments for the method. - - - - - Creates a new instance. - - Invocation for this expectation - - - - Creates a new instance. - - Expectation. - - - - Validate the arguments for the method. - - The arguments with which the method was called - - - - Determines if the object equal to expectation - - - - - Get the hash code - - - - - Gets the error message. - - - - - - Summary description for ArgsEqualExpectation. - - - - - Creates a new instance. - - Expected args. - The invocation for this expectation - - - - Validate the arguments for the method. - - The arguments with which the method was called - - - - Determines if the object equal to expectation - - - - - Get the hash code - - - - - Gets the error message. - - - - - - Get the expected args. - - - - - Call a specified callback to verify the expectation - - - - - Creates a new instance. - - Expectation. - Callback. - - - - Creates a new instance. - - Invocation for this expectation - Callback. - - - - Validate the arguments for the method on the child methods - - The arguments with which the method was called - - - - Determines if the object equal to expectation - - - - - Get the hash code - - - - - Gets the error message. - - - - - - Expect the method's arguments to match the contraints - - - - - Creates a new instance. - - Invocation for this expectation - Constraints. - - - - Creates a new instance. - - Expectation. - Constraints. - - - - Validate the arguments for the method. - - The arguments with which the method was called - - - - Determines if the object equal to expectation - - - - - Get the hash code - - - - - Gets the error message. - - - - - - ExpectationsList - - - - - Dictionary - - - - - Dictionary class - - - - - Create a new instance of ProxyStateDictionary - - - - - Operation on a remoting proxy - - - It is not possible to directly communicate to a real proxy via transparent proxy. - Transparent proxy impersonates a user type and only methods of that user type are callable. - The only methods that are guaranteed to exist on any transparent proxy are methods defined - in Object: namely ToString(), GetHashCode(), and Equals()). - - These three methods are the only way to tell the real proxy to do something. - Equals() is the most suitable of all, since it accepts an arbitrary object parameter. - The RemotingProxy code is built so that if it is compared to an IRemotingProxyOperation, - transparentProxy.Equals(operation) will call operation.Process(realProxy). - This way we can retrieve a real proxy from transparent proxy and perform - arbitrary operation on it. - - - - - Implementation of IInvocation based on remoting proxy - - Some methods are marked NotSupported since they either don't make sense - for remoting proxies, or they are never called by Rhino Mocks - - - - Generates remoting proxies and provides utility functions - - - - - Create the proxy using remoting - - - - - Check whether an object is a transparent proxy with a RemotingProxy behind it - - Object to check - true if the object is a transparent proxy with a RemotingProxy instance behind it, false otherwise - We use Equals() method to communicate with the real proxy behind the object. - See IRemotingProxyOperation for more details - - - - Retrieve a mocked object from a transparent proxy - - Transparent proxy with a RemotingProxy instance behind it - Mocked object associated with the proxy - We use Equals() method to communicate with the real proxy behind the object. - See IRemotingProxyOperation for more details - - - - Allows to call a method and immediatly get it's options. - - - - - Interface to allows to call a method and immediatly get it's options. - - - - - Get the method options for the call - - The method call should go here, the return value is ignored - - - - Creates a new instance. - - - - - Get the method options for the call - - The method call should go here, the return value is ignored - - - - Allows to call a method and immediatly get it's options. - Set the expected number for the call to Any() - - - - - Creates a new instance. - - Proxy. - Mocked instance. - - - - Get the method options for the call - - The method call should go here, the return value is ignored - - - - This class is reponsible for taking a delegate and creating a wrapper - interface around it, so it can be mocked. - - - - - The scope for all the delegate interfaces create by this mock repositroy. - - - - - Gets a type with an "Invoke" method suitable for use as a target of the - specified delegate type. - - - - - - - Raise events for all subscribers for an event - - - - - Raise events for all subscribers for an event - - - - - Raise the event - - - - - The most common form for the event handler signature - - - - - Create an event raise for the specified event on this instance. - - - - - Creates a new instance of EventRaiser - - - - - Raise the event - - - - - The most common signature for events - Here to allow intellisense to make better guesses about how - it should suggest parameters. - - - - - Allows to define what would happen when a method - is called. - - - - - Allows to define what would happen when a method - is called. - - - - - Set the return value for the method. - - The object the method will return - IRepeat that defines how many times the method will return this value - - - - Allow to override this return value in the future - - IRepeat that defines how many times the method will return this value - - - - Throws the specified exception when the method is called. - - Exception to throw - - - - Ignores the arguments for this method. Any argument will be matched - againt this method. - - - - - Add constraints for the method's arguments. - - - - - Set a callback method for the last call - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched - and allow to optionally modify the invocation as needed - - - - - Call the original method on the class, bypassing the mocking layers. - - - - - - Call the original method on the class, optionally bypassing the mocking layers. - - - - - - Use the property as a simple property, getting/setting the values without - causing mock expectations. - - - - - Expect last (property) call as property setting, ignore the argument given - - - - - - Expect last (property) call as property setting with a given argument. - - - - - - - Get an event raiser for the last subscribed event. - - - - - Set the parameter values for out and ref parameters. - This is done using zero based indexing, and _ignoring_ any non out/ref parameter. - - - - - Documentation message for the expectation - - Message - - - - Better syntax to define repeats. - - - - - Allows to specify the number of time for method calls - - - - - Repeat the method twice. - - - - - Repeat the method once. - - - - - Repeat the method at least once, then repeat as many time as it would like. - - - - - Repeat the method any number of times. - This has special affects in that this method would now ignore orderring. - - - - - Set the range to repeat an action. - - Min. - Max. - - - - Set the amount of times to repeat an action. - - - - - This method must not appear in the replay state. - This has special affects in that this method would now ignore orderring. - - - - - Creates a new instance. - - the repository for this expectation - the recorder for this proxy - the proxy for this expectation - Expectation. - - - - Add constraints for the method's arguments. - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set the return value for the method. - - The object the method will return - IRepeat that defines how many times the method will return this value - - - - Set the return value for the method, but allow to override this return value in the future - - IRepeat that defines how many times the method will return this value - - - - Throws the specified exception when the method is called. - - Exception to throw - - - - Ignores the arguments for this method. Any argument will be matched - againt this method. - - - - - Call the original method on the class, bypassing the mocking layers. - - - - - - Call the original method on the class, optionally bypassing the mocking layers - - - - - - Use the property as a simple property, getting/setting the values without - causing mock expectations. - - - - - Expect last (property) call as property setting, ignore the argument given - - - - - - Expect last (property) call as property setting with a given argument. - - - - - - - Gets the event raiser for the last event - - - - - Set the parameter values for out and ref parameters. - This is done using zero based indexing, and _ignoring_ any non out/ref parameter. - - - - - Repeat the method twice. - - - - - Repeat the method once. - - - - - Repeat the method at least once, then repeat as many time as it would like. - - - - - This method must not appear in the replay state. - - - - - Documentation message for the expectation - - Message - - - - Repeat the method any number of times. - - - - - Set the range to repeat an action. - - Min. - Max. - - - - Set the amount of times to repeat an action. - - - - - Better syntax to define repeats. - - - - - This class will provide hash code for hashtables without needing - to call the GetHashCode() on the object, which may very well be mocked. - This class has no state so it is a singelton to avoid creating a lot of objects - that does the exact same thing. See flyweight patterns. - - - - - Get the hash code for a proxy object without calling GetHashCode() - on the object. - - - - - Compares two instances of mocked objects - - - - - Compare two mocked objects - - - - - The next hash code value for a mock object. - This is safe for multi threading. - - - - - The sole instance of - - - - - Doesn't log anything, just makes happy noises - - - - - Log expectations - allows to see what is going on inside Rhino Mocks - - - - - Logs the expectation as is was recorded - - The invocation. - The expectation. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the unexpected method call. - - The invocation. - The message. - - - - Logs the expectation as is was recorded - - The invocation. - The expectation. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the unexpected method call. - - The invocation. - The message. - - - - This is a dummy type that is used merely to give DynamicProxy the proxy instance that - it needs to create IProxy's types. - - - - - Interface to find the repository of a mocked object - - - - - Return true if it should call the original method on the object - instead of pass it to the message chain. - - The method to call - - - - Register a method to be called on the object directly - - - - - Register a property on the object that will behave as a simple property - - - - - Check if the method was registered as a property method. - - - - - Do get/set on the property, according to need. - - - - - Do add/remove on the event - - - - - Get the subscribers of a spesific event - - - - - Gets the declaring type of the method, taking into acccount the possible generic - parameters that it was created with. - - - - - Clears the state of the object, remove original calls, property behavior, subscribed events, etc. - - - - - Get all the method calls arguments that were made against this object with the specificed - method. - - - Only method calls in replay mode are counted - - - - - Records the method call - - - - - The unique hash code of this mock, which is not related - to the value of the GetHashCode() call on the object. - - - - - Gets the repository. - - - - - Gets the implemented types by this mocked object - - The implemented. - - - - Gets or sets the constructor arguments. - - The constructor arguments. - - - - Create a new instance of - - - - - Return true if it should call the original method on the object - instead of pass it to the message chain. - - The method to call - - - - Register a method to be called on the object directly - - - - - Register a property on the object that will behave as a simple property - Return true if there is already a value for the property - - - - - Check if the method was registered as a property method. - - - - - Do get/set on the property, according to need. - - - - - Do add/remove on the event - - - - - Get the subscribers of a spesific event - - - - - Gets the declaring type of the method, taking into acccount the possible generic - parameters that it was created with. - - - - - Get all the method calls arguments that were made against this object with the specificed - method. - - - - - Only method calls in replay mode are counted - - - - - Records the method call - - - - - - - Clears the state of the object, remove original calls, property behavior, subscribed events, etc. - - - - - The unique hash code of this proxy, which is not related - to the value of the GetHashCode() call on the object. - - - - - Gets the repository. - - - - - Gets or sets the constructor arguments. - - The constructor arguments. - - - - Gets the implemented types by this mocked object - - The implemented. - - - - Range for expected method calls - - - - - Creates a new instance. - - Min. - Max. - - - - Return the string representation of this range. - - - - - Gets or sets the min. - - - - - - Gets or sets the max. - - - - - - Records all the expectations for a mock and - return a ReplayDynamicMockState when Replay() - is called. - - - - - Records all the expectations for a mock - - - - - Different actions on this mock - - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Verify that this mock expectations have passed. - - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Gets a mock state that match the original mock state of the object. - - - - - Get the options for the last method call - - - - - Set the exception to throw when Verify is called. - This is used to report exception that may have happened but where caught in the code. - This way, they are reported anyway when Verify() is called. - - - - - This method is called to indicate that a property behavior call. - This is done so we generate good error message in the common case of people using - Stubbed properties with Return(). - - - - - Gets the matching verify state for this state - - - - - Get the options for the last method call - - - - - Get the options for the last method call - - - - - Set the exception to throw when Verify is called. - This is used to report exception that may have happened but where caught in the code. - This way, they are reported anyway when Verify() is called. - - - - - This method is called to indicate that a property behavior call. - This is done so we generate good error message in the common case of people using - Stubbed properties with Return(). - - - - - Creates a new instance. - - Repository. - The proxy that generates the method calls - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Verify that this mock expectations have passed. - - - - - Gets a mock state that match the original mock state of the object. - - - - - Asserts the previous method is closed (had an expectation set on it so we can replay it correctly) - - - - - Gets the last expectation. - - - - - Gets the total method calls count. - - - - - Get the options for the last method call - - - - - Gets the matching verify state for this state - - - - - Creates a new instance. - - Repository. - The proxy that generates the method calls - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Gets a mock state that match the original mock state of the object. - - - - - Records all the expectations for a mock and - return a ReplayPartialMockState when Replay() - is called. - - - - - Creates a new instance. - - Repository. - The proxy that generates the method calls - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Gets a mock state that match the original mock state of the object. - - - - - Options for special repeat option - - - - - This method can be called only as many times as the IMethodOptions.Expect allows. - - - - - This method should never be called - - - - - This method can be call any number of times - - - - - This method will call the original method - - - - - This method will call the original method, bypassing the mocking layer - - - - - This method will simulate simple property behavior - - - - - Validate all expectations on a mock and ignores calls to - any method that was not setup properly. - - - - - Validate all expectations on a mock - - - - - The repository for this state - - - - - The proxy object for this state - - - - - Get the options for the last method call - - - - - Creates a new instance. - - The previous state for this method - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Add a method call for this state' mock. - This allows derived method to cleanly get a the setupresult behavior while adding - their own. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Set the exception to throw when Verify is called. - This is used to report exception that may have happened but where caught in the code. - This way, they are reported anyway when Verify() is called. - - - - - not relevant - - - - - Verify that this mock expectations have passed. - - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Gets a mock state that match the original mock state of the object. - - - - - Get the options for the last method call - - - - - Gets the matching verify state for this state - - - - - Creates a new instance. - - The previous state for this method - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Gets a mock state that match the original mock state of the object. - - - - - Validate all expectations on a mock and ignores calls to - any method that was not setup properly. - - - - - Creates a new instance. - - The previous state for this method - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Gets a mock state that match the original mock state of the object. - - - - - Summary description for RhinoInterceptor. - - - - - Creates a new instance. - - - - - Intercept a method call and direct it to the repository. - - - - - Behave like a stub, all properties and events acts normally, methods calls - return default values by default (but can use expectations to set them up), etc. - - - - - Initializes a new instance of the class. - - The proxy that generates the method calls - Repository. - - - - We don't care much about expectations here, so we will remove the exepctation if - it is not closed. - - - - - Verify that we can move to replay state and move - to the reply state. - - - - - - Validate expectations on recorded methods, but in general completely ignoring them. - Similar to except that it would return a - when BackToRecord is called. - - - - - Initializes a new instance of the class. - - The previous state for this method - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Gets a mock state that match the original mock state of the object. - - - - - Rudimetry implementation that simply logs methods calls as text. - - - - - Initializes a new instance of the class. - - The writer. - - - - Logs the expectation as is was recorded - - The invocation. - The expectation. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the unexpected method call. - - The invocation. - The message. - - - - Write rhino mocks log info to the trace - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - if set to true [log recorded]. - if set to true [log replayed]. - if set to true [log unexpected]. - - - - Logs the expectation as is was recorded - - The invocation. - The expectation. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the unexpected method call. - - The invocation. - The message. - - - - Writes log information as stack traces about rhino mocks activity - - - - - Allows to redirect output to a different location. - - - - - Logs the expectation as is was recorded - - The invocation. - The expectation. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the unexpected method call. - - The invocation. - The message. - - - - Validate arguments for methods - - - - - Validate that the passed argument is not null. - - The object to validate - The name of the argument - - If the obj is null, an ArgumentNullException with the passed name - is thrown. - - - - - Validate that the arguments are equal. - - Expected args. - Actual Args. - - - - Validate that the two argument are equals, including validation for - when the arguments are collections, in which case it will validate their values. - - - - - This method is safe for use even if any of the objects is a mocked object - that override equals. - - - - - Throw an object already verified when accessed - - - - - Create a new instance of VerifiedMockState - - The previous mock state, used to get the initial record state - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Verify that this mock expectations have passed. - - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Gets a mock state that match the original mock state of the object. - - - - - Get the options for the last method call - - - - - Set the exception to throw when Verify is called. - This is used to report exception that may have happened but where caught in the code. - This way, they are reported anyway when Verify() is called. - - - - - not relevant - - - - - Gets the matching verify state for this state - - - - - Get the options for the last method call - - - - - Records the actions on all the mocks created by a repository. - - - - - Records the specified call with the specified args on the mocked object. - - - - - Get the expectation for this method on this object with this arguments - - - - - This check the methods that were setup using the SetupResult.For() - or LastCall.Repeat.Any() and that bypass the whole expectation model. - - - - - Gets the all expectations for a mocked object and method combination, - regardless of the expected arguments / callbacks / contraints. - - Mocked object. - Method. - List of all relevant expectation - - - - Gets the all expectations for proxy. - - Mocked object. - List of all relevant expectation - - - - Removes all the repeatable expectations for proxy. - - Mocked object. - - - - Replaces the old expectation with the new expectation for the specified proxy/method pair. - This replace ALL expectations that equal to old expectations. - - Proxy. - Method. - Old expectation. - New expectation. - - - - Adds the recorder and turn it into the active recorder. - - Recorder. - - - - Moves to previous recorder. - - - - - Gets the recorded expectation or null. - - - - - Gets the next expected calls string. - - - - - Moves to parent recorder. - - - - - Set the expectation so it can repeat any number of times. - - - - - Removes the expectation from the recorder - - - - - Clear the replayer to call (and all its chain of replayers) - This also removes it from the list of expectations, so it will never be considered again - - - - - Get the expectation for this method on this object with this arguments - - - - - Gets a value indicating whether this instance has expectations that weren't satisfied yet. - - - true if this instance has expectations; otherwise, false. - - - - - Marker interface used to indicate that this is a partial mock. - - - - - Options for CallOriginalMethod - - - - - No expectation is created, the method will be called directly - - - - - Normal expectation is created, but when the method is later called, it will also call the original method - - - - - Base class for method recorders, handle delegating to inner recorder if needed. - - - - - List of the expected actions on for this recorder - The legal values are: - * Expectations - * Method Recorders - - - - - The current recorder. - - - - - The current replayer; - - - - - The parent recorder of this one, may be null. - - - - - This contains a list of all the replayers that should be ignored - for a spesific method call. A replayer gets into this list by calling - ClearReplayerToCall() on its parent. This list is Clear()ed on each new invocation. - - - - - All the repeatable methods calls. - - - - - Counts the recursion depth of the current expectation search stack - - - - - Creates a new instance. - - - - - Creates a new instance. - - Parent recorder. - Repeatable methods - - - - Records the specified call with the specified args on the mocked object. - - - - - Get the expectation for this method on this object with this arguments - - - - - Gets the all expectations for a mocked object and method combination, - regardless of the expected arguments / callbacks / contraints. - - Mocked object. - Method. - List of all relevant expectation - - - - Gets the all expectations for proxy. - - Mocked object. - List of all relevant expectation - - - - Replaces the old expectation with the new expectation for the specified proxy/method pair. - This replace ALL expectations that equal to old expectations. - - Proxy. - Method. - Old expectation. - New expectation. - - - - Remove the all repeatable expectations for proxy. - - Mocked object. - - - - Set the expectation so it can repeat any number of times. - - - - - Removes the expectation from the recorder - - - - - Adds the recorder and turn it into the active recorder. - - Recorder. - - - - Moves to previous recorder. - - - - - Moves to parent recorder. - - - - - Gets the recorded expectation or null. - - - - - Clear the replayer to call (and all its chain of replayers). - This also removes it from the list of expectations, so it will never be considered again - - - - - Get the expectation for this method on this object with this arguments - - - - - Gets the next expected calls string. - - - - - Handles the real getting of the recorded expectation or null. - - - - - Handle the real execution of this method for the derived class - - - - - Handle the real execution of this method for the derived class - - - - - Handle the real execution of this method for the derived class - - - - - Handle the real execution of this method for the derived class - - - - - Handle the real execution of this method for the derived class - - - - - Handle the real execution of this method for the derived class - - - - - Should this replayer be considered valid for this call? - - - - - This check the methods that were setup using the SetupResult.For() - or LastCall.Repeat.Any() and that bypass the whole expectation model. - - - - - Gets a value indicating whether this instance has expectations that weren't satisfied yet. - - - true if this instance has expectations; otherwise, false. - - - - - Handle the real execution of this method for the derived class - - - - - Ordered collection of methods, methods must arrive in specified order - in order to pass. - - - - - Unordered collection of method records, any expectation that exist - will be matched. - - - - - The parent recorder we have redirected to. - Useful for certain edge cases in orderring. - See: FieldProblem_Entropy for the details. - - - - - Creates a new instance. - - Parent recorder. - Repeatable methods - - - - Creates a new instance. - - - - - Records the specified call with the specified args on the mocked object. - - Mocked object. - Method. - Expectation. - - - - Get the expectation for this method on this object with this arguments - - Invocation for this method - Mocked object. - Method. - Args. - True is the call was recorded, false otherwise - - - - Gets the all expectations for a mocked object and method combination, - regardless of the expected arguments / callbacks / contraints. - - Mocked object. - Method. - List of all relevant expectation - - - - Gets the all expectations for proxy. - - Mocked object. - List of all relevant expectation - - - - Replaces the old expectation with the new expectation for the specified proxy/method pair. - This replace ALL expectations that equal to old expectations. - - Proxy. - Method. - Old expectation. - New expectation. - - - - Handle the real execution of this method for the derived class - - - - - Handles the real getting of the recorded expectation or null. - - - - - Handle the real execution of this method for the derived class - - - - - Gets the next expected calls string. - - - - - Create an exception for an unexpected method call. - - - - - Gets a value indicating whether this instance has expectations that weren't satisfied yet. - - - true if this instance has expectations; otherwise, false. - - - - - Creates a new instance. - - Parent recorder. - Repetable methods - - - - Creates a new instance. - - - - - Handles the real getting of the recorded expectation or null. - - - - - Get the expectation for this method on this object with this arguments - - - - - Gets the next expected calls string. - - - - - Hold an expectation for a method call on an object - - - - - Creates a new instance. - - Proxy. - Method. - Expectation. - - - - Determains if the object equal to this instance - - Obj. - - - - - Gets the hash code. - - - - - - Gets the proxy. - - - - - - Gets the method. - - - - - - Gets the expectation. - - - - - - Holds a pair of mocked object and a method - and allows to compare them against each other. - This allows us to have a distinction between mockOne.MyMethod() and - mockTwo.MyMethod()... - - - - - Creates a new instance. - - Proxy. - Method. - - - - Determains whatever obj equals to this instance. - ProxyMethodPairs are equals when they point to the same /instance/ of - an object, and to the same method. - - Obj. - - - - - Gets the hash code. - - - - - - Gets the proxy. - - - - - - Gets the method. - - - - - - Change the recorder from ordered to unordered and vice versa - - - - - Creates a new instance. - - - - - Disposes this instance. - - - - - Utility class for dealing with messing generics scenarios. - - - - - There are issues with trying to get this to work correctly with open generic types, since this is an edge case, - I am letting the runtime handle it. - - - - - Gets the real type, including de-constructing and constructing the type of generic - methods parameters. - - The type. - The invocation. - - - - - Because we need to support complex types here (simple generics were handled above) we - need to be aware of the following scenarios: - List[T] and List[Foo[T]] - - - - - Utility class for working with method calls. - - - - - Return the string representation of a method call and its arguments. - - The method - The method arguments - Invocation of the method, used to get the generics arguments - Delegate to format the parameter - The string representation of this method call - - - - Return the string representation of a method call and its arguments. - - The invocation of the method, used to get the generic parameters - The method - The method arguments - The string representation of this method call - - - - Delegate to format the argument for the string representation of - the method call. - - - - - Utility to get the default value for a type - - - - - The default value for a type. - Null for reference types and void - 0 for value types. - First element for enums - Note that we need to get the value even for opened generic types, such as those from - generic methods. - - Type. - The invocation. - the default value - - - - Defines constraints and return values for arguments of a mock. - Only use Arg inside a method call on a mock that is recording. - Example: - ExpectCall( - mock.foo( - Arg<int>.Is.GreaterThan(2), - Arg<string>.Is.Anything - )); - Use Arg.Text for string specific constraints - Use Arg<ListClass>.List for list specific constraints - - - - - - Register the predicate as a constraint for the current call. - - The predicate. - default(T) - - Allow you to use code to create constraints - - demo.AssertWasCalled(x => x.Bar(Arg{string}.Matches(a => a.StartsWith("b") && a.Contains("ba")))); - - - - - - Define a complex constraint for this argument by passing several constraints - combined with operators. (Use Is in simple cases.) - Example: Arg<string>.Matches(Is.Equal("Hello") || Text.EndsWith("u")); - - Constraints using Is, Text and List - Dummy to satisfy the compiler - - - - Define a Ref argument. - - Constraints for this argument - value returned by the mock - - - - - Define a out parameter. Use it together with the keyword out and use the - Dummy field available by the return value. - Example: mock.foo( out Arg<string>.Out("hello").Dummy ); - - - - - - - Define a simple constraint for this argument. (Use Matches in simple cases.) - Example: - Arg<int>.Is.Anthing - Arg<string>.Is.Equal("hello") - - - - - Define Constraints on list arguments. - - - - - Use the Arg class (without generic) to define Text constraints - - - - - Evaluate an equal constraint for . - - The object the parameter should equal to - - - - Define constraints on text arguments. - - - - - Used to manage the static state of the Arg<T> class"/> - - - - - Resets the static state - - - - - Returns return values for the out and ref parameters - Note: the array returned has the size of the number of out and ref - argument definitions - - - - - - Returns the constraints for all arguments. - Out arguments have an Is.Anything constraint and are also in the list. - - - - - - What should BackToRecord clear - - - - - Retain all expectations and behaviors and return to mock - - - - - All expectations - - - - - Event subscribers for this instance - - - - - Methods that should be forwarded to the base class implementation - - - - - Properties that should behave like properties - - - - - Remove all the behavior of the object - - - - - This delegate is compatible with the System.Func{T,R} signature - We have to define our own to get compatability with 2.0 - - - - - This class defines a lot of method signatures, which we will use - to allow compatability on net-2.0 - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - Allows expectations to be set on methods that should never be called. - For methods with void return value, you need to use LastCall or - DoNotExpect.Call() with a delegate. - - - - - Sets LastCall.Repeat.Never() on /any/ proxy on /any/ repository on the current thread. - This method if not safe for multi threading scenarios. - - - - - Accepts a delegate that will execute inside the method which - LastCall.Repeat.Never() will be applied to. - It is expected to be used with anonymous delegates / lambda expressions and only one - method should be called. - - - IService mockSrv = mocks.CreateMock(typeof(IService)) as IService; - DoNotExpect.Call(delegate{ mockSrv.Stop(); }); - ... - - - - - Allows to set expectation on methods that has return values. - For methods with void return value, you need to use LastCall - - - - - The method options for the last call on /any/ proxy on /any/ repository on the current thread. - This method if not safe for multi threading scenarios, use . - - - - - Accepts a delegate that will execute inside the method, and then return the resulting - instance. - It is expected to be used with anonymous delegates / lambda expressions and only one - method should be called. - - - IService mockSrv = mocks.CreateMock(typeof(IService)) as IService; - Expect.Call(delegate{ mockSrv.Start(); }).Throw(new NetworkException()); - ... - - - - - Get the method options for the last method call on the mockInstance. - - - - - A delegate that can be used to get better syntax on Expect.Call(delegate { foo.DoSomething(); }); - - - - - Allows to set various options for the last method call on - a specified object. - If the method has a return value, it's recommended to use Expect - - - - - Allows to get an interface to work on the last call. - - The mocked object - Interface that allows to set options for the last method call on this object - - - - Set the return value for the method. - - The object the method will return - IRepeat that defines how many times the method will return this value - - - - Set the return value for the method. This overload is needed for LastCall.Return(null) - - The object the method will return - IRepeat that defines how many times the method will return this value - - - - Throws the specified exception when the method is called. - - Exception to throw - - - - Ignores the arguments for this method. Any argument will be matched - againt this method. - - - - - Add constraints for the method's arguments. - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Call the original method on the class, bypassing the mocking layers, for the last call. - - - - - Call the original method on the class, optionally bypassing the mocking layers, for the last call. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Gets an interface that will raise the last event when called. - - - - - Set the parameter values for out and ref parameters. - This is done using zero based indexing, and _ignoring_ any non out/ref parameter. - - - - - Documentation message for the expectation - - Message - - - - Use the property as a simple property, getting/setting the values without - causing mock expectations. - - - - - Better syntax to define repeats. - - - - - This is a data structure that is used by - to pass - the current method to the relevant delegate - - - - - Initializes a new instance of the class. - - The invocation. - - - - Gets the args for this method invocation - - - - - Gets or sets the return value for this method invocation - - The return value. - - - - Accessor for the current mocker - - - - - The current mocker - - - - - Creates proxied instances of types. - - - Adds optional new usage: - using(mockRepository.Record()) { - Expect.Call(mock.Method()).Return(retVal); - } - using(mockRepository.Playback()) { - // Execute code - } - N.B. mockRepository.ReplayAll() and mockRepository.VerifyAll() - calls are taken care of by Record/Playback - - - - - This is a map of types to ProxyGenerators. - - - - - This is used to record the last repository that has a method called on it. - - - - - this is used to get to the last proxy on this repository. - - - - - For mock delegates, maps the proxy instance from intercepted invocations - back to the delegate that was originally returned to client code, if any. - - - - - All the proxies in the mock repositories - - - - - This is here because we can't put it in any of the recorders, since repeatable methods - have no orderring, and if we try to handle them using the usual manner, we would get into - wierd situations where repeatable method that was defined in an orderring block doesn't - exists until we enter this block. - - - - - Creates a new instance. - - - - - Move the repository to ordered mode - - - - - Move the repository to un-ordered mode - - - - - Creates a mock for the specified type. - - Type. - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a strict mock for the specified type. - - Type. - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a remoting mock for the specified type. - - Type. - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a strict remoting mock for the specified type. - - Type. - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a remoting mock for the specified type. - - - Arguments for the class' constructor, if mocking a concrete class - - - - - Creates a strict remoting mock for the specified type. - - - Arguments for the class' constructor, if mocking a concrete class - - - - - Creates a mock from several types, with strict semantics. - Only may be a class. - - - - - Creates a strict mock from several types, with strict semantics. - Only may be a class. - - - - - Creates a mock from several types, with strict semantics. - Only may be a class. - - The main type to mock. - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class. - - - - Creates a strict mock from several types, with strict semantics. - Only may be a class. - - The main type to mock. - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class. - - - - Creates a mock from several types, with dynamic semantics. - Only may be a class. - - The main type to mock. - Extra interface types to mock. - - - - Creates a mock from several types, with dynamic semantics. - Only may be a class. - - The main type to mock. - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class. - - - - Creates a dynamic mock for the specified type. - - Type. - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a dynamic mock for the specified type. - - Type. - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a dynamic mock for the specified type. - - - Arguments for the class' constructor, if mocking a concrete class - - - - - Creates a mock object that defaults to calling the class methods. - - Type. - Arguments for the class' constructor. - - - - Creates a mock object that defaults to calling the class methods. - - Type. - Extra interface types to mock. - - - - Creates a mock object that defaults to calling the class methods. - - Type. - Extra interface types to mock. - Arguments for the class' constructor. - - - - Creates a mock object using remoting proxies - - Type to mock - must be MarshalByRefObject - Mock object - Proxy mock can mock non-virtual methods, but not static methods - Creates the mock state for this proxy - - - - Cause the mock state to change to replay, any further call is compared to the - ones that were called in the record state. - - the object to move to replay state - - - - Cause the mock state to change to replay, any further call is compared to the - ones that were called in the record state. - - the object to move to replay state - - - - - Move the mocked object back to record state. - Will delete all current expectations! - - - - - Move the mocked object back to record state. - Optionally, can delete all current expectations, but allows more granularity about how - it would behave with regard to the object state. - - - - - Verify that all the expectations for this object were fulfilled. - - the object to verify the expectations for - - - - Get the method options for the last call on - mockedInstance. - - The mock object - Method options for the last call - - - - Maps an invocation proxy back to the mock object instance that was originally - returned to client code which might have been a delegate to this proxy. - - The mock object proxy from the intercepted invocation - The mock object - - - - This is provided to allow advance extention functionality, where Rhino Mocks standard - functionality is not enough. - - The type to mock - Delegate that create the first state of the mocked object (usualy the record state). - Additional types to be implemented, this can be only interfaces - optional arguments for the constructor - - - - - Method: GetMockedObject - Get an IProxy from a mocked object instance, or throws if the - object is not a mock object. - - - - - Method: GetMockedObjectOrNull - Get an IProxy from a mocked object instance, or null if the - object is not a mock object. - - - - - Pops the recorder. - - - - - Pushes the recorder. - - New recorder. - - - - All the mock objects in this repository will be moved - to record state. - - - - - All the mock objects in this repository will be moved - to record state. - - - - - Replay all the mocks from this repository - - - - - Verify all the mocks from this repository - - - - - Gets the proxy generator for a specific type. Having a single ProxyGenerator - with multiple types linearly degrades the performance so this implementation - keeps one ProxyGenerator per type. - - - - - Set the exception to be thrown when verified is called. - - - - - Creates a mock for the spesified type. - - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a strict mock for the spesified type. - - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a dynamic mock for the specified type. - - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a mock object from several types. - - - - - Creates a strict mock object from several types. - - - - - Create a mock object from several types with dynamic semantics. - - - - - Create a mock object from several types with partial semantics. - - - - - Create a mock object from several types with strict semantics. - - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class - - - - Create a strict mock object from several types with strict semantics. - - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class - - - - Create a mock object from several types with dynamic semantics. - - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class - - - - Create a mock object from several types with partial semantics. - - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class - - - - Create a mock object with from a class that defaults to calling the class methods - - Arguments for the class' constructor, if mocking a concrete class - - - - Create a stub object, one that has properties and events ready for use, and - can have methods called on it. It requires an explicit step in order to create - an expectation for a stub. - - The arguments for constructor. - - - - Create a stub object, one that has properties and events ready for use, and - can have methods called on it. It requires an explicit step in order to create - an expectation for a stub. - - The type. - The arguments for constructor. - - - - - Generates a stub without mock repository - - The arguments for constructor. - - - - - Generates the stub without mock repository - - The type. - The arguments for constructor. - - - - Returns true if the passed mock is currently in replay mode. - - The mock to test. - True if the mock is in replay mode, false otherwise. - - - - Generate a mock object without needing the mock repository - - - - - Determines whether the specified proxy is a stub. - - The proxy. - - - - Register a call on a prperty behavior - - - - - - - - - - - - - - - - Gets the recorder. - - - - - - Gets the replayer for this repository. - - - - - - Gets the last proxy which had a method call. - - - - - Delegate: CreateMockState - This is used internally to cleanly handle the creation of different - RecordMockStates. - - - - - Used for [assembly: InternalsVisibleTo(RhinoMocks.StrongName)] - Used for [assembly: InternalsVisibleTo(RhinoMocks.NormalName)] - - - - - Strong name for the Dynamic Proxy assemblies. Used for InternalsVisibleTo specification. - - - - - Normal name for dynamic proxy assemblies. Used for InternalsVisibleTo specification. - - - - - Logs all method calls for methods - - - - - A set of extension methods that adds Arrange Act Assert mode to Rhino Mocks - - - - - Create an expectation on this mock for this action to occur - - - The mock. - The action. - - - - - Reset all expectations on this mock object - - - The mock. - - - - Reset the selected expectation on this mock object - - - The mock. - The options to reset the expectations on this mock. - - - - Cause the mock state to change to replay, any further call is compared to the - ones that were called in the record state. - - the mocked object to move to replay state - - - - Gets the mock repository for this specificied mock object - - - The mock. - - - - - Create an expectation on this mock for this action to occur - - - - The mock. - The action. - - - - - Tell the mock object to perform a certain action when a matching - method is called. - Does not create an expectation for this method. - - - The mock. - The action. - - - - - Tell the mock object to perform a certain action when a matching - method is called. - Does not create an expectation for this method. - - - - The mock. - The action. - - - - - Gets the arguments for calls made on this mock object and the method that was called - in the action. - - - The mock. - The action. - - - Here we will get all the arguments for all the calls made to DoSomething(int) - - var argsForCalls = foo54.GetArgumentsForCallsMadeOn(x => x.DoSomething(0)) - - - - - - Gets the arguments for calls made on this mock object and the method that was called - in the action and matches the given constraints - - - The mock. - The action. - The setup constraints. - - - Here we will get all the arguments for all the calls made to DoSomething(int) - - var argsForCalls = foo54.GetArgumentsForCallsMadeOn(x => x.DoSomething(0)) - - - - - - Asserts that a particular method was called on this mock object - - - The mock. - The action. - - - - Asserts that a particular method was called on this mock object that match - a particular constraint set. - - - The mock. - The action. - The setup constraints. - - - - Asserts that a particular method was NOT called on this mock object - - - The mock. - The action. - - - - Asserts that a particular method was NOT called on this mock object that match - a particular constraint set. - - - The mock. - The action. - The setup constraints. - - - - Finds the approprite implementation type of this item. - This is the class or an interface outside of the rhino mocks. - - The mocked obj. - - - - - Verifies all expectations on this mock object - - The mock object. - - - - Gets the event raiser for the event that was called in the action passed - - The type of the event source. - The mock object. - The event subscription. - - - - - Raise the specified event using the passed arguments. - The even is extracted from the passed labmda - - The type of the event source. - The mock object. - The event subscription. - The sender. - The instance containing the event data. - - - - Raise the specified event using the passed arguments. - The even is extracted from the passed labmda - - The type of the event source. - The mock object. - The event subscription. - The args. - - - - Fake type that disallow creating it. - Should have been System.Type, but we can't use it. - - - - - Setup method calls to repeat any number of times. - - - - - Get the method options and set the last method call to repeat - any number of times. - This also means that the method would transcend ordering - - - - - Get the method options for the last method call on the mockInstance and set it - to repeat any number of times. - This also means that the method would transcend ordering - - - - - Allows easier access to MockRepository, works closely with Mocker.Current to - allow access to a context where the mock repository is automatially verified at - the end of the code block. - - - - - Initialize a code block where Mocker.Current is initialized. - At the end of the code block, all the expectation will be verified. - This overload will create a new MockRepository. - - The code that will be executed under the mock context - - - - Initialize a code block where Mocker.Current is initialized. - At the end of the code block, all the expectation will be verified. - This overload will create a new MockRepository. - - The mock repository to use, at the end of the code block, VerifyAll() will be called on the repository. - The code that will be executed under the mock context - - - - Create a FluentMocker - - The mock repository to use. - - - - A method with no arguments and no return value that will be called under the mock context. - - - - - FluentMocker implements some kind of fluent interface attempt - for saying "With the Mocks [mocks], Expecting (in same order) [things] verify [that]." - - - - - Interface to verify previously defined expectations - - - - - Verifies if a piece of code - - - - - Defines unordered expectations - - A delegate describing the expectations - an IMockVerifier - - - - Defines ordered expectations - - A delegate describing the expectations - an IMockVerifier - - - - Verifies previously defined expectations - - - - diff --git a/sharedlib/Rhino Mocks/acknowledgements.txt b/sharedlib/Rhino Mocks/acknowledgements.txt deleted file mode 100644 index 834b0b0..0000000 --- a/sharedlib/Rhino Mocks/acknowledgements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Rhino Mocks is using Castle Dynamic Proxy (http://www.castleproject.org/dynamicproxy/index.html) to handle proxying the types it needs to mock. -The Dynamic Proxy project has been invaluable resource and made creating Rhino Mocks possible. \ No newline at end of file diff --git a/sharedlib/Rhino Mocks/license.txt b/sharedlib/Rhino Mocks/license.txt deleted file mode 100644 index 33edd59..0000000 --- a/sharedlib/Rhino Mocks/license.txt +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2005 - 2008 Ayende Rahien (ayende@ayende.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Ayende Rahien nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/sharedlib/Spring.Net/Common.Logging.dll b/sharedlib/Spring.Net/Common.Logging.dll deleted file mode 100644 index d7a8f15..0000000 Binary files a/sharedlib/Spring.Net/Common.Logging.dll and /dev/null differ diff --git a/sharedlib/Spring.Net/Spring.Core.dll b/sharedlib/Spring.Net/Spring.Core.dll deleted file mode 100644 index b19141b..0000000 Binary files a/sharedlib/Spring.Net/Spring.Core.dll and /dev/null differ diff --git a/sharedlib/Spring.Net/Spring.Core.pdb b/sharedlib/Spring.Net/Spring.Core.pdb deleted file mode 100644 index 351d462..0000000 Binary files a/sharedlib/Spring.Net/Spring.Core.pdb and /dev/null differ diff --git a/sharedlib/Spring.Net/Spring.Core.xml b/sharedlib/Spring.Net/Spring.Core.xml deleted file mode 100644 index f0d2a59..0000000 --- a/sharedlib/Spring.Net/Spring.Core.xml +++ /dev/null @@ -1,44391 +0,0 @@ - - - - Spring.Core - - - - - An abstract implementation that can - be used as base class for concrete implementations. - - Aleksandar Seovic - Erich Eichinger - - - - Defines a contract that all cache implementations have to fulfill. - - Aleksandar Seovic - Erich Eichinger - - - - Retrieves an item from the cache. - - - Item key. - - - Item for the specified , or null. - - - - - Removes an item from the cache. - - - Item key. - - - - - Removes collection of items from the cache. - - - Collection of keys to remove. - - - - - Removes all items from the cache. - - - - - Inserts an item into the cache. - - - Items inserted using this method have no expiration time - and default cache priority. - - - Item key. - - - Item value. - - - - - Inserts an item into the cache. - - - Items inserted using this method have default cache priority. - - - Item key. - - - Item value. - - - Item's time-to-live. - - - - - Gets the number of items in the cache. - - - - - Gets a collection of all cache item keys. - - - - - Retrieves an item from the cache. - - - Item key. - - - Item for the specified , or null. - - - - - Removes an item from the cache. - - - Item key. - - - - - Removes collection of items from the cache. - - - Collection of keys to remove. - - - - - Removes all items from the cache. - - - - - Inserts an item into the cache. - - - Items inserted using this method use the default - - - Item key. - - - Item value. - - - - - Inserts an item into the cache. - - - If equals , - or is true, this cache - instance's value will be applied. - - - Item key. - - - Item value. - - - Item's time-to-live (TTL). - - - - - Actually does the cache implementation specific insert operation into the cache. - - - Items inserted using this method have default cache priority. - - - Item key. - - - Item value. - - - Item's time-to-live (TTL). - - - - - Gets/Set the Default time-to-live (TTL) for items inserted into this cache. - Used by - - - - - Gets/Sets a value, whether the this cache instance's - shall be applied to all items, regardless of their individual TTL - when is called. - - - - - Gets the number of items in the cache. - - - May be overridden by subclasses for cache-specific efficient implementation. - - - - - Gets a collection of all cache item keys. - - - - - Abstract base class containing shared properties for all cache attributes. - - Aleksandar Seovic - - - - The instance used to parse values. - - - - - - - Creates an attribute instance. - - - - - Creates an attribute instance. - - - The name of the cache to use. - - - An expression string that should be evaluated in order to determine - the cache key for the item. - - - - - Gets or sets the name of the cache to use. - - - The name of the cache to use. - - - - - Gets or sets a SpEL expression that should be evaluated in order - to determine the cache key for the item. - - - An expression string that should be evaluated in order to determine - the cache key for the item. - - - - - Gets an expression instance that should be evaluated in order - to determine the cache key for the item. - - - An expression instance that should be evaluated in order to determine - the cache key for the item. - - - - - Gets or sets a SpEL expression that should be evaluated in order - to determine whether the item should be cached. - - - An expression string that should be evaluated in order to determine - whether the item should be cached. - - - - - Gets an expression instance that should be evaluated in order - to determine whether the item should be cached. - - - An expression instance that should be evaluated in order to determine - whether the item should be cached. - - - - - The amount of time an object should remain in the cache. - - - If no TTL is specified, the default TTL defined by the - cache's policy will be applied. - - - The amount of time object should remain in the cache - formatted to be recognizable by . - - - - - The amount of time an object should remain in the cache (in seconds). - - - If no TTL is specified, the default TTL defined by the - cache's policy will be applied. - - - The amount of time object should remain in the cache (in seconds). - - - - - This attribute should be used to mark methods whose argument(s) - need to be cached. - - -

- This attribute allows application developers to specify that an argument - of the method should be cached, but it will not do any caching by itself. -

-

- In order to actually cache the result, an application developer - must apply a Spring.Aspects.Cache.CacheParameterAdvice to - all of the members that have this attribute defined. -

-

- You can specify this attribute multiple times on the same method in order to - cache several method parameters. -

-
- Aleksandar Seovic -
- - - Creates an attribute instance. - - - - - Creates an attribute instance. - - - The name of the cache to use. - - - An expression string that should be evaluated in order to determine - the cache key for the item. - - - - - This attribute should be used to mark methods whose result - needs to be cached. - - -

- This attribute allows application developers to mark that a result - of the method invocation should be cached, but it will not do any - caching by itself. -

-

- In order to actually cache the result, an application developer - must apply a Spring.Aspects.Cache.CacheResultAdvice to - all of the members that have this attribute defined. -

-
- Aleksandar Seovic -
- - - Creates an attribute instance. - - - - - Creates an attribute instance. - - - The name of the cache to use. - - - An expression string that should be evaluated in order to determine - the cache key for the item. - - - - - This attribute should be used with methods that return an - in order to cache each item separately. - - -

- This attribute allows application developers to specify that each item - from the collection returned by the method should be cached, - but it will not do any caching by itself. -

-

- In order to actually cache the result, an application developer - must apply a Spring.Aspects.Cache.CacheResultAdvice to - all of the members that have this attribute defined. -

-
- Aleksandar Seovic -
- - - Creates an attribute instance. - - - - - Creates an attribute instance. - - - The name of the cache to use. - - - An expression string that should be evaluated in order to determine - the cache key for the item. - - - - - This attribute should be used to mark method that should - invalidate one or more cache items when invoked. - - -

- This attribute allows application developers to specify that some - cache items should be evicted from cache when the method is invoked, - but it will not do any eviction by itself. -

-

- In order to actually evict cache items, an application developer - must apply a Spring.Aspects.Cache.InvalidateCacheAdvice to - all of the members that have this attribute defined. -

-
- Aleksandar Seovic -
- - - Creates an attribute instance. - - - - - Creates an attribute instance. - - - The name of the cache to use. - - - - - Gets or sets the name of the cache to use. - - - The name of the cache to use. - - - - - Gets or sets a SpEL expression that should be evaluated in order - to determine the keys for the items that should be evicted. - - - An expression string that should be evaluated in order - to determine the keys for the items that should be evicted. - - - - - Gets an expression instance that should be evaluated in order - to determine the keys for the items that should be evicted. - - - An expression instance that should be evaluated in order - to determine the keys for the items that should be evicted. - - - - - Gets or sets a SpEL expression that should be evaluated in order - to determine whether items should be evicted. - - - An expression string that should be evaluated in order to determine - whether items should be evicted. - - - - - Gets an expression instance that should be evaluated in order - to determine whether items should be evicted. - - - An expression instance that should be evaluated in order to determine - whether items should be evicted. - - - - - A simple implementation backed by a dictionary that - never expires cache items. - - Aleksandar Seovic - - - - Retrieves an item from the cache. - - - Item key. - - - Item for the specified , or null. - - - - - Removes an item from the cache. - - - Item key. - - - - - Removes collection of items from the cache. - - - Collection of keys to remove. - - - - - Removes all items from the cache. - - - - - Inserts an item into the cache. - - - Item key. - - - Item value. - - - Item's time-to-live (TTL) in milliseconds. - - - - - Gets the number of items in the cache. - - - - - Gets a collection of all cache item keys. - - - - - This class provides skeletal implementations of some - operations. - - -

- The implementations in this class are appropriate when the base - implementation does not allow elements. The methods - , - , and - are based on - the , - , and - methods - respectively but throw exceptions instead of indicating failure via - or returns. -

- An implementation that extends this class must - minimally define a method - which does - not permit the insertion of elements, along with methods - , and - . Typically, - additional methods will be overridden as well. If these requirements - cannot be met, consider instead subclassing - }. -

-
- Doug Lea - Griffin Caprio (.NET) -
- - - A collection designed for holding elements prior to processing. - - -

- Besides basic operations, - queues provide additional insertion, extraction, and inspection - operations. -

-

- Each of these methods exists in two forms: one throws - an exception if the operation fails, the other returns a special - value (either or , depending on the - operation). The latter form of the insert operation is designed - specifically for use with capacity-restricted - implementations; in most implementations, insert operations cannot - fail. -

-

- Queues typically, but do not necessarily, order elements in a - FIFO (first-in-first-out) manner. Among the exceptions are - priority queues, which order elements according to a supplied - comparator, or the elements' natural ordering, and LIFO queues (or - stacks) which order the elements LIFO (last-in-first-out). - Whatever the ordering used, the head of the queue is that - element which would be removed by a call to - or - . In a FIFO queue, all new - elements are inserted at the tail of the queue. Other kinds of queues may - use different placement rules. Every implementation - must specify its ordering properties. -

-

- The method inserts an - element if possible, otherwise returning . This differs from the - method, which can fail to - add an element only by throwing an exception. The - method is designed for - use when failure is a normal, rather than exceptional occurrence, for example, - in fixed-capacity (or "bounded" queues. -

-

- The - methods remove and - return the head of the queue. Exactly which element is removed from the - queue is a function of the queue's ordering policy, which differs from - implementation to implementation. The - and - methods differ only in their - behavior when the queue is empty: the - method throws an exception, - while the method returns - . -

-

- The and - methods return, but do - not remove, the head of the queue. -

-

- The interface does not define the blocking queue - methods, which are common in concurrent programming. -

-

- implementations generally do not allow insertion - of elements, although some implementations, such as - a linked list, do not prohibit the insertion of . - Even in the implementations that permit it, should - not be inserted into a , as is also - used as a special return value by the - method to - indicate that the queue contains no elements. -

-

- implementations generally do not define - element-based versions of methods - and , but instead inherit the - identity based versions from the class object, because element-based equality - is not always well-defined for queues with the same elements but different - ordering properties. -

-

- Based on the back port of JCP JSR-166. -

-
- Doug Lea - Griffin Caprio (.NET) -
- - - Inserts the specified element into this queue if it is possible to do so - immediately without violating capacity restrictions, returning - upon success and throwing an - if no space is - currently available. - - - The element to add. - - - if successful. - - - If the element cannot be added at this time due to capacity restrictions. - - - If the class of the supplied prevents it - from being added to this queue. - - - If the specified element is and this queue does not - permit elements. - - - If some property of the supplied prevents - it from being added to this queue. - - - - - Inserts the specified element into this queue if it is possible to do - so immediately without violating capacity restrictions. - - -

- When using a capacity-restricted queue, this method is generally - preferable to , - which can fail to insert an element only by throwing an exception. -

-
- - The element to add. - - - if the element was added to this queue. - - - If the element cannot be added at this time due to capacity restrictions. - - - If the supplied is - . - - - If some property of the supplied prevents - it from being added to this queue. - -
- - - Retrieves and removes the head of this queue. - - -

- This method differs from - only in that it throws an exception if this queue is empty. -

-
- - The head of this queue - - if this queue is empty -
- - - Retrieves and removes the head of this queue, - or returns if this queue is empty. - - - The head of this queue, or if this queue is empty. - - - - - Retrieves, but does not remove, the head of this queue. - - -

- This method differs from - only in that it throws an exception if this queue is empty. -

-
- - The head of this queue. - - If this queue is empty. -
- - - Retrieves, but does not remove, the head of this queue, - or returns if this queue is empty. - - - The head of this queue, or if this queue is empty. - - - - - Returns if there are no elements in the , otherwise. - - - - - Creates a new instance of the class. - - -

- This is an abstract class, and as such has no publicly - visible constructors. -

-
-
- - - Inserts the specified element into this queue if it is possible - to do so immediately without violating capacity restrictions. - - - The element to add. - - - if successful. - - - If the element cannot be added at this time due to capacity restrictions. - - - - - Retrieves and removes the head of this queue. - - -

- This method differs from - only in that - it throws an exception if this queue is empty. -

-
- - The head of this queue - - - If this queue is empty. - -
- - - Retrieves, but does not remove, the head of this queue. - - -

- This method differs from - only in that it throws an exception if this queue is empty. -

-

- ALso note that this implementation returns the result of - unless the queue - is empty. -

-
- The head of this queue. - - If this queue is empty. - -
- - - Removes all of the elements from this queue. - - -

- The queue will be empty after this call returns. -

-

- This implementation repeatedly invokes - until it - returns . -

-
-
- - - Adds all of the elements in the supplied - to this queue. - - -

- Attempts to - - of a queue to itself result in . - Further, the behavior of this operation is undefined if the specified - collection is modified while the operation is in progress. -

-

- This implementation iterates over the specified collection, - and adds each element returned by the iterator to this queue, in turn. - An exception encountered while trying to add an element (including, - in particular, a element) may result in only some - of the elements having been successfully added when the associated - exception is thrown. -

-
- - The collection containing the elements to be added to this queue. - - - if this queue changed as a result of the call. - - - If the supplied or any one of its elements are . - - - If the collection is the current or - the collection size is greater than the queue capacity. - -
- - - Inserts the specified element into this queue if it is possible to do - so immediately without violating capacity restrictions. - - -

- When using a capacity-restricted queue, this method is generally - preferable to , - which can fail to insert an element only by throwing an exception. -

-
- - The element to add. - - - if the element was added to this queue. - - - If the element cannot be added at this time due to capacity restrictions. - - - If the supplied is - . - - - If some property of the supplied prevents - it from being added to this queue. - -
- - - Retrieves, but does not remove, the head of this queue, - or returns if this queue is empty. - - - The head of this queue, or if this queue is empty. - - - - - Retrieves and removes the head of this queue, - or returns if this queue is empty. - - - The head of this queue, or if this queue is empty. - - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional.-or- index is equal to or greater than the length of array.-or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. 2 - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Returns if there are no elements in the , otherwise. - - - - - Returns the current capacity of this queue. - - - - - Gets the number of elements contained in the . - - - The number of elements contained in the . - - - - - Gets an object that can be used to synchronize access to the . - - - An object that can be used to synchronize access to the . - - - - - Gets a value indicating whether access to the is synchronized (thread safe). - - - true if access to the is synchronized (thread safe); otherwise, false. - - - - - Provides a performance improved hashtable with case-insensitive (string-only! based) key handling. - - Erich Eichinger - - - - Creates a case-insensitive hashtable using . - - - - - Creates a case-insensitive hashtable using the given . - - the to calculate the hashcode - - - - Creates a case-insensitive hashtable using the given , initially - populated with entries from another dictionary. - - the dictionary to copy entries from - the to calculate the hashcode - - - - Initializes a new, empty instance of the class that is serializable using the specified and objects. - - A object containing the source and destination of the serialized stream associated with the . - A object containing the information required to serialize the object. - info is null. - - - - Implements the interface and returns the data needed to serialize the . - - - A object containing the source and destination of the serialized stream associated with the . - A object containing the information required to serialize the . - info is null. - - - - Calculate the hashcode of the given string key, using the configured culture. - - - - - - - Compares two keys - - - - - Creates a shallow copy of the current instance. - - - - - is an - class that supports the creation of new - types where the underlying data - store is an instance. - - -

- You can use any object that implements the - interface to hold set - data. You can define your own, or you can use one of the objects - provided in the framework. The type of - you - choose will affect both the performance and the behavior of the - using it. -

-

- This object overrides the method, - but not the method, because - the class is mutable. - Therefore, it is not safe to use as a key value in a dictionary. -

-

- To make a typed based on your - own , simply derive a new - class with a constructor that takes no parameters. Some - implmentations cannot be defined - with a default constructor. If this is the case for your class, you - will need to override clone as well. -

-

- It is also standard practice that at least one of your constructors - takes an or an - as an argument. -

-
- -
- - - A collection that contains no duplicate elements. - - - - - - A collection that contains no duplicate elements. - - -

- This interface models the mathematical - abstraction. The order of - elements in a set is dependant on (a)the data-structure implementation, and - (b)the implementation of the various - methods, and thus is not - guaranteed. -

-

- overrides the - method to test for "equivalency": - whether the two sets contain the same elements. The "==" and "!=" - operators are not overridden by design, since it is often desirable to - compare object references for equality. -

-

- Also, the method is not - implemented on any of the set implementations, since none of them are - truly immutable. This is by design, and it is the way almost all - collections in the .NET framework function. So as a general rule, don't - store collection objects inside - instances. You would typically want to use a keyed - instead. -

-

- None of the implementations in - this library are guaranteed to be thread-safe in any way unless wrapped - in a . -

-

- The following table summarizes the binary operators that are supported - by the class. -

- - - Operation - Description - Method - - - Union (OR) - - Element included in result if it exists in either A OR - B. - - Union() - - - Intersection (AND) - - Element included in result if it exists in both A AND - B. - - InterSect() - - - Exclusive Or (XOR) - - Element included in result if it exists in one, but not both, - of A and B. - - ExclusiveOr() - - - Minus (n/a) - - Take all the elements in A. Now, if any of them exist in - B, remove them. Note that unlike the other operators, - A - B is not the same as B - A. - - Minus() - - -
-
- - - Performs a "union" of the two sets, where all the elements - in both sets are present. - - -

- That is, the element is included if it is in either - or this set. Neither this set nor the input - set are modified during the operation. The return value is a - clone of this set with the extra elements added in. -

-
- A collection of elements. - - A new containing the union of - this with the specified - collection. Neither of the input objects is modified by the union. - -
- - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. - - -

- That is, the element is included if it exists in both sets. The - Intersect() operation does not modify the input sets. It - returns a clone of this set with the appropriate elements - removed. -

-
- A set of elements. - - The intersection of this set with . - -
- - - Performs a "minus" of this set from the - set. - - -

- This returns a set of all the elements in set - , removing the elements that are also in - this set. The original sets are not modified during this operation. - The result set is a clone of this - containing the elements from - the operation. -

-
- A set of elements. - - A set containing the elements from this set with the elements in - removed. - -
- - - Performs an "exclusive-or" of the two sets, keeping only those - elements that are in one of the sets, but not in both. - - -

- The original sets are not modified during this operation. The - result set is a clone of this set containing the elements - from the exclusive-or operation. -

-
- A set of elements. - - A set containing the result of - ^ this. - -
- - - Returns if this set contains the specified - element. - - The element to look for. - - if this set contains the specified element. - - - - - Returns if the set contains all the - elements in the specified collection. - - A collection of objects. - - if the set contains all the elements in the - specified collection. - - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - - is the object was added, - if the object was already present. - - - - - Adds all the elements in the specified collection to the set if - they are not already present. - - A collection of objects to add to the set. - - is the set changed as a result of this - operation. - - - - - Removes the specified element from the set. - - The element to be removed. - - if the set contained the specified element. - - - - - Remove all the specified elements from this set, if they exist in - this set. - - A collection of elements to remove. - - if the set was modified as a result of this - operation. - - - - - Retains only the elements in this set that are contained in the - specified collection. - - - The collection that defines the set of elements to be retained. - - - if this set changed as a result of this - operation. - - - - - Removes all objects from this set. - - - - - Returns if this set contains no elements. - - - - - Performs a "union" of the two sets, where all the elements - in both sets are present. - - A collection of elements. - - A new containing the union of - this with the specified - collection. Neither of the input objects is modified by the union. - - - - - - Performs a "union" of two sets, where all the elements in both are - present. - - -

- That is, the element is included if it is in either - or . The return - value is a clone of one of the sets ( - if it is not ) with elements of the other set - added in. Neither of the input sets is modified by the operation. -

-
- A set of elements. - A set of elements. - - A set containing the union of the input sets; - if both sets are . - -
- - - Performs a "union" of two sets, where all the elements in both are - present. - - A set of elements. - A set of elements. - - A set containing the union of the input sets; - if both sets are . - - - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. - - A set of elements. - - The intersection of this set with . - - - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. - - -

- That is, the element is included only if it exists in both - and . Neither input - object is modified by the operation. The result object is a - clone of one of the input objects ( - if it is not ) containing the elements from - the intersect operation. -

-
- A set of elements. - A set of elements. - - The intersection of the two input sets; if - both sets are . - -
- - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. - - A set of elements. - A set of elements. - - The intersection of the two input sets; if - both sets are . - - - - - - Performs a "minus" of this set from the - set. - - A set of elements. - - A set containing the elements from this set with the elements in - removed. - - - - - - Performs a "minus" of set from set - . - - -

- This returns a set of all the elements in set - , removing the elements that are also in - set . The original sets are not modified - during this operation. The result set is a clone of set - containing the elements from the operation. -

-
- A set of elements. - A set of elements. - - A set containing - - elements. - if is - . - -
- - - Performs a "minus" of set from set - . - - A set of elements. - A set of elements. - - A set containing - - elements. - if is - . - - - - - - Performs an "exclusive-or" of the two sets, keeping only those - elements that are in one of the sets, but not in both. - - A set of elements. - - A set containing the result of - ^ this. - - - - - - Performs an "exclusive-or" of the two sets, keeping only those - elements that are in one of the sets, but not in both. - - -

- The original sets are not modified during this operation. The - result set is a clone of one of the sets ( - if it is not ) - containing the elements from the exclusive-or operation. -

-
- A set of elements. - A set of elements. - - A set containing the result of - ^ . - if both sets are . - -
- - - Performs an "exclusive-or" of the two sets, keeping only those - elements that are in one of the sets, but not in both. - - A set of elements. - A set of elements. - - A set containing the result of - ^ . - if both sets are . - - - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - - is the object was added, - if the object was already present. - - - - - Adds all the elements in the specified collection to the set if - they are not already present. - - A collection of objects to add to the set. - - is the set changed as a result of this - operation. - - - - - Removes all objects from this set. - - - - - Returns if this set contains the specified - element. - - The element to look for. - - if this set contains the specified element. - - - - - Returns if the set contains all the - elements in the specified collection. - - A collection of objects. - - if the set contains all the elements in the - specified collection. - - - - - Removes the specified element from the set. - - The element to be removed. - - if the set contained the specified element. - - - - - Remove all the specified elements from this set, if they exist in - this set. - - A collection of elements to remove. - - if the set was modified as a result of this - operation. - - - - - Retains only the elements in this set that are contained in the - specified collection. - - - The collection that defines the set of elements to be retained. - - - if this set changed as a result of this - operation. - - - - - Returns a clone of the - instance. - - -

- This will work for derived - classes if the derived class implements a constructor that takes no - arguments. -

-
- A clone of this object. -
- - - Copies the elements in the to - an array. - - -

- The type of array needs to be compatible with the objects in the - , obviously. -

-
- - An array that will be the target of the copy operation. - - - The zero-based index where copying will start. - -
- - - Gets an enumerator for the elements in the - . - - - An over the elements - in the . - - - - - This method will test the - against another for - "equality". - - -

- In this case, "equality" means that the two sets contain the same - elements. The "==" and "!=" operators are not overridden by design. - If you wish to check for "equivalent" - instances, use - Equals(). If you wish to check to see if two references are - actually the same object, use "==" and "!=". -

-
- - A object to compare to. - - - if the two sets contain the same elements. - -
- - - Gets the hashcode for the object. - - - - - Returns if this set contains no elements. - - - - - The number of elements currently contained in this collection. - - - - - Returns if the - is synchronized across - threads. - - -

- Note that enumeration is inherently not thread-safe. Use the - to lock the object during enumeration. -

-
-
- - - An object that can be used to synchronize this collection to make - it thread-safe. - - -

- When implementing this, if your object uses a base object, like an - , or anything that has - a SyncRoot, return that object instead of "this". -

-
- - An object that can be used to synchronize this collection to make - it thread-safe. - -
- - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - - is the object was added, - if the object was already present. - - - - - Adds all the elements in the specified collection to the set if - they are not already present. - - A collection of objects to add to the set. - - is the set changed as a result of this - operation. - - - - - Removes all objects from this set. - - - - - Returns if this set contains the specified - element. - - The element to look for. - - if this set contains the specified element. - - - - - Returns if the set contains all the - elements in the specified collection. - - A collection of objects. - - if the set contains all the elements in the - specified collection; also if the - supplied is . - - - - - Removes the specified element from the set. - - The element to be removed. - - if the set contained the specified element. - - - - - Remove all the specified elements from this set, if they exist in - this set. - - A collection of elements to remove. - - if the set was modified as a result of this - operation. - - - - - Retains only the elements in this set that are contained in the - specified collection. - - - The collection that defines the set of elements to be retained. - - - if this set changed as a result of this - operation. - - - - - Copies the elements in the to - an array. - - -

- The type of array needs to be compatible with the objects in the - , obviously. -

-
- - An array that will be the target of the copy operation. - - - The zero-based index where copying will start. - -
- - - Gets an enumerator for the elements in the - . - - - An over the elements - in the . - - - - - Provides the storage for elements in the - , stored as the key-set - of the object. - - -

- Set this object in the constructor if you create your own - class. -

-
-
- - - The placeholder object used as the value for the - instance. - - - There is a single instance of this object globally, used for all - s. - - - - - Returns if this set contains no elements. - - - - - The number of elements currently contained in this collection. - - - - - Returns if the - is synchronized across - threads. - - - - - - An object that can be used to synchronize this collection to make - it thread-safe. - - - An object that can be used to synchronize this collection to make - it thread-safe. - - - - - - Implements an based on a - hash table. - - -

- This will give the best lookup, add, and remove performance for very - large data-sets, but iteration will occur in no particular order. -

-
- -
- - - Creates a new instance of the class. - - - - - Creates a new instance of the class, and - initializes it based on a collection of elements. - - - A collection of elements that defines the initial set contents. - - - - - Implements an that automatically - changes from a list based implementation to a hashtable based - implementation when the size reaches a certain threshold. - - -

- This is good if you are unsure about whether you data-set will be tiny - or huge. -

- - Because this uses a dual implementation, iteration order is not - guaranteed! - -
- -
- - - Creates a new set instance based on either a list or a hash table, - depending on which will be more efficient based on the data-set - size. - - - - - Creates a new set instance based on either a list or a hash table, - depending on which will be more efficient based on the data-set - size, and initializes it based on a collection of elements. - - - A collection of elements that defines the initial set contents. - - - - - Implements an immutable (read-only) - wrapper. - - -

- Although this class is advertised as immutable, it really isn't. - Anyone with access to the wrapped - can still change the data. So - is not implemented for this , as - is the case for all - implementations in this library. This design decision was based on the - efficiency of not having to clone the wrapped - every time you wrap a mutable - . -

-
-
- - - Constructs an immutable (read-only) - wrapper. - - - The that is to be wrapped. - - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - - is the object was added, - if the object was already present. - - - - - - Adds all the elements in the specified collection to the set if - they are not already present. - - A collection of objects to add to the set. - - is the set changed as a result of this - operation. - - - - - - Removes all objects from this set. - - - - - - Returns if this set contains the specified - element. - - The element to look for. - - if this set contains the specified element. - - - - - Returns if the set contains all the - elements in the specified collection. - - A collection of objects. - - if the set contains all the elements in the - specified collection. - - - - - Removes the specified element from the set. - - The element to be removed. - - if the set contained the specified element. - - - - - - Remove all the specified elements from this set, if they exist in - this set. - - A collection of elements to remove. - - if the set was modified as a result of this - operation. - - - - - - Retains only the elements in this set that are contained in the - specified collection. - - - The collection that defines the set of elements to be retained. - - - if this set changed as a result of this - operation. - - - - - - Copies the elements in the to - an array. - - -

- The type of array needs to be compatible with the objects in the - , obviously. -

-
- - An array that will be the target of the copy operation. - - - The zero-based index where copying will start. - -
- - - Gets an enumerator for the elements in the - . - - - An over the elements - in the . - - - - - Returns a clone of the - instance. - - A clone of this object. - - - - Performs a "union" of the two sets, where all the elements - in both sets are present. - - A collection of elements. - - A new containing the union of - this with the specified - collection. Neither of the input objects is modified by the union. - - - - - - Performs an "intersection" of the two sets, where only the elements - that are present in both sets remain. - - A set of elements. - - The intersection of this set with . - - - - - - Performs a "minus" of this set from the - set. - - A set of elements. - - A set containing the elements from this set with the elements in - removed. - - - - - - Performs an "exclusive-or" of the two sets, keeping only those - elements that are in one of the sets, but not in both. - - A set of elements. - - A set containing the result of - ^ this. - - - - - - Returns if this set contains no elements. - - - - - The number of elements currently contained in this collection. - - - - - Returns if the - is synchronized across - threads. - - -

- Note that enumeration is inherently not thread-safe. Use the - to lock the object during enumeration. -

-
-
- - - An object that can be used to synchronize this collection to make - it thread-safe. - - - An object that can be used to synchronize this collection to make - it thread-safe. - - - - - Simple linked list implementation. - - Simon White - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class that contains all - elements of the specified list. - - - A list of elements that defines the initial contents. - - - - - Removes the object at the specified index. - - The lookup index. - - If the specified is greater than the - number of objects within the list. - - - - - Inserts an object at the specified index. - - The lookup index. - The object to be inserted. - - If the specified is greater than the - number of objects within the list. - - - - - Removes the first instance of the specified object found. - - The object to remove - - - - Returns if this list contains the specified - element. - - The element to look for. - - if this list contains the specified element. - - - - - Removes all objects from the list. - - - - - Returns the index of the first instance of the specified - found. - - The object to search for - - The index of the first instance found, or -1 if the element was not - found. - - - - - Adds the specified object to the end of the list. - - The object to add - The index that the object was added at. - - - - Adds all of the elements of the supplied - list to the end of this list. - - The list of objects to add. - - - - Checks whether the list can be modified. - - - If the list cannot be modified. - - - - - Validates the specified index. - - The lookup index. - - If the index is invalid. - - - - - Returns the node at the specified index. - - The lookup index. - The node at the specified index. - - If the specified is greater than the - number of objects within the list. - - - - - Returns the node (and index) of the first node that contains - the specified value. - - The value to search for. - - The node, or if not found. - - - - - Removes the specified node. - - The node to be removed. - - - - Copies the elements in this list to an array. - - -

- The type of array needs to be compatible with the objects in this - list, obviously. -

-
- - An array that will be the target of the copy operation. - - - The zero-based index where copying will start. - - - If the supplied is . - - - If the supplied is less than zero - or is greater than the length of . - - - If the supplied is of insufficient size. - -
- - - Gets an enumerator for the elements in the - . - - -

- Enumerators are fail fast. -

-
- - An over the elements - in the . - -
- - - Is list read only? - - - if the list is read only. - - - - - Returns the node at the specified index. - - -

- This is the indexer for the - class. -

-
- -
- - - Is the list a fixed size? - - - if the list is a fixed size list. - - - - - Returns if the list is synchronized across - threads. - - - - This implementation always returns . - -

- Note that enumeration is inherently not thread-safe. Use the - to lock the object during enumeration. -

-
-
- - - The number of objects within the list. - - - - - An object that can be used to synchronize this - to make it thread-safe. - - - An object that can be used to synchronize this - to make it thread-safe. - - - - - Implements a based on a list. - - -

- Performance is much better for very small lists than either - or . - However, performance degrades rapidly as the data-set gets bigger. Use a - instead if you are not sure your data-set - will always remain very small. Iteration produces elements in the order they were added. - However, element order is not guaranteed to be maintained by the various - mathematical operators. -

-
-
- - - Creates a new set instance based on a list. - - - - - Creates a new set instance based on a list and initializes it based on a - collection of elements. - - - A collection of elements that defines the initial set contents. - - - - - Thrown when an element is requested from an empty . - - Griffin Caprio - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Creates a new instance of the - class with the - specified message. - - - A message about the exception. - - - - - Creates a new instance of the - class with the - specified message. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - An unbounded priority based on a priority - heap. This queue orders elements according to an order specified - at construction time, which is specified either according to their - natural order (see , or according to a - , depending on which constructor is - used. A priority queue does not permit elements. - A priority queue relying on natural ordering also does not - permit insertion of non-comparable objects (doing so will result - . - -

- The head of this queue is the lowest element - with respect to the specified ordering. If multiple elements are - tied for lowest value, the head is one of those elements -- ties are - broken arbitrarily. - -

- A priority queue is unbounded, but has an internal - capacity governing the size of an array used to store the - elements on the queue. It is always at least as large as the queue - size. As elements are added to a priority queue, its capacity - grows automatically. The details of the growth policy are not - specified. - -

- This class and its enumerator implement all of the - optional methods of the and - interfaces. - The enumerator provided in method - is not guaranteed to traverse the elements of the PriorityQueue in any - particular order. - -

- Note that this implementation is NOT synchronized. - Multiple threads should not access a - instance concurrently if any of the threads modifies the list - structurally. Instead, use the thread-safe PriorityBlockingQueue. -

- Josh Bloch - Griffin Caprio (.NET) -
- - - Priority queue represented as a balanced binary heap: the two children - of queue[n] are queue[2*n] and queue[2*n + 1]. The priority queue is - ordered by comparator, or by the elements' natural ordering, if - comparator is null: For each node n in the heap and each descendant d - of n, n <= d. - - The element with the lowest value is in queue[1], assuming the queue is - nonempty. (A one-based array is used in preference to the traditional - zero-based array to simplify parent and child calculations.) - - queue.length must be >= 2, even if size == 0. - - - - The number of elements in the priority queue. - - - - The comparator, or null if priority queue uses elements' - natural ordering. - - - - - The number of times this priority queue has been - structurally modified. - - - - - Creates a with the default initial capacity - (11) that orders its elements according to their natural - ordering (using ). - - - - - Creates a with the specified initial capacity - that orders its elements according to their natural ordering - (using ). - - the initial capacity for this priority queue. - - if is less than 1. - - - - Creates a with the specified initial capacity - that orders its elements according to the specified comparator. - - the initial capacity for this priority queue. - the comparator used to order this priority queue. - If then the order depends on the elements' natural ordering. - - if is less than 1. - - - - Creates a containing the elements in the - specified collection. The priority queue has an initial - capacity of 110% of the size of the specified collection or 1 - if the collection is empty. If the specified collection is an - instance of a , the priority queue will be sorted - according to the same comparator, or according to its elements' - natural order if the collection is sorted according to its - elements' natural order. Otherwise, the priority queue is - ordered according to its elements' natural order. - - the collection whose elements are to be placed into this priority queue. - if elements of cannot be - compared to one another according to the priority queue's ordering - if or any element with it is - - - - - - Common code to initialize underlying queue array across - constructors below. - - - - - Performs an unsigned bitwise right shift with the specified number - - Number to operate on - Ammount of bits to shift - The resulting number from the shift operation - - - - Establishes the heap invariant assuming the heap - satisfies the invariant except possibly for the leaf-node indexed by k - (which may have a nextExecutionTime less than its parent's). - - - This method functions by "promoting" queue[k] up the hierarchy - (by swapping it with its parent) repeatedly until queue[k] - is greater than or equal to its parent. - - - - - Establishes the heap invariant (described above) in the subtree - rooted at k, which is assumed to satisfy the heap invariant except - possibly for node k itself (which may be greater than its children). - - - This method functions by "demoting" queue[k] down the hierarchy - (by swapping it with its smaller child) repeatedly until queue[k] - is less than or equal to its children. - - - - - Establishes the heap invariant in the entire tree, - assuming nothing about the order of the elements prior to the call. - - - - - Returns the of or - 1, - whichever is smaller. - - base size - percentage to return - of - - - - Initially fill elements of the queue array under the - knowledge that it is sorted or is another , in which - case we can just place the elements in the order presented. - - - - - Initially fill elements of the queue array that is not to our knowledge - sorted, so we must rearrange the elements to guarantee the heap - invariant. - - - - - Removes and returns element located at from queue. (Recall that the queue - is one-based, so 1 <= i <= size.) - - - Normally this method leaves the elements at positions from 1 up to i-1, - inclusive, untouched. Under these circumstances, it returns . - Occasionally, in order to maintain the heap invariant, it must move - the last element of the list to some index in the range [2, i-1], - and move the element previously at position (i/2) to position i. - Under these circumstances, this method returns the element that was - previously at the end of the list and is now at some position between - 2 and i-1 inclusive. - - - - Resize array, if necessary, to be able to hold given index - - - - Inserts the specified element into this queue if it is possible to do - so immediately without violating capacity restrictions. - - -

- When using a capacity-restricted queue, this method is generally - preferable to , - which can fail to insert an element only by throwing an exception. -

-
- - The element to add. - - - if the element was added to this queue. - - - if the specified element cannot be compared - with elements currently in the priority queue according - to the priority queue's ordering. - - - If the element cannot be added at this time due to capacity restrictions. - - - If the supplied is - and this queue does not permit - elements. - - - If some property of the supplied prevents - it from being added to this queue. - -
- - - Retrieves, but does not remove, the head of this queue, - or returns if this queue is empty. - - - The head of this queue, or if this queue is empty. - - - - - Inserts the specified element into this queue if it is possible to do so - immediately without violating capacity restrictions, returning - upon success and throwing an - if no space is - currently available. - - - The element to add. - - - if successful. - - - If the element cannot be added at this time due to capacity restrictions. - - - If the specified element is and this queue does not - permit elements. - - - If some property of the supplied prevents - it from being added to this queue. - - - if the specified element cannot be compared - with elements currently in the priority queue according - to the priority queue's ordering. - - - - - Removes a single instance of the specified element from this - queue, if it is present. - - - - - Returns an over the elements in this queue. - The enumeratoar does not return the elements in any particular order. - - an enumerator over the elements in this queue. - - - - Removes all elements from the priority queue. - The queue will be empty after this call returns. - - - - - Retrieves and removes the head of this queue, - or returns if this queue is empty. - - - The head of this queue, or if this queue is empty. - - - - - Queries the queue to see if it contains the specified - - element to look for. - if the queue contains the , - otherwise. - - - Returns the comparator used to order this collection, or - if this collection is sorted according to its elements natural ordering - (using ). - - - the comparator used to order this collection, or - if this collection is sorted according to its elements natural ordering. - - - - - Save the state of the instance to a stream (that - is, serialize it). - - The length of the array backing the instance is - emitted (int), followed by all of its elements (each an - ) in the proper order. - - the stream - the context - - - - Reconstitute the instance from a stream (that is, - deserialize it). - - the stream - the context - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional.-or- index is equal to or greater than the length of array.-or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. 2 - - - - Copies the elements of the to an , starting at index 0. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - array is null. - index is less than zero. - array is multidimensional.-or- index is equal to or greater than the length of array.-or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. 2 - - - - Gets the Capacity of this queue. Will equal - - - - - Returns the queue count. - - - - - Gets an object that can be used to synchronize access to the . - - - An object that can be used to synchronize access to the . - - - - - Gets a value indicating whether access to the is synchronized (thread safe). - - - true if access to the is synchronized (thread safe); otherwise, false. - - - - - Returns if there are no elements in the , otherwise. - - - - - Index (into queue array) of element to be returned by subsequent call to next. - - - - - Implements an based on a sorted - tree. - - -

- This gives good performance for operations on very large data-sets, - though not as good - asymptotically - as a - . However, iteration occurs - in order. -

-

- Elements that you put into this type of collection must implement - , and they must actually be comparable. - You can't mix and - values, for example. -

-

- This implementation does - not support elements that are . -

-
- -
- - - Creates a new set instance based on a sorted tree. - - - - - Creates a new set instance based on a sorted tree using for ordering. - - - - - Creates a new set instance based on a sorted tree and initializes - it based on a collection of elements. - - - A collection of elements that defines the initial set contents. - - - - - Synchronized that should be returned by synchronized - dictionary implementations in order to ensure that the enumeration is thread safe. - - Aleksandar Seovic - - - - Synchronized that should be returned by synchronized - collections in order to ensure that the enumeration is thread safe. - - Aleksandar Seovic - - - - Synchronized that, unlike hashtable created - using method, synchronizes - reads from the underlying hashtable in addition to writes. - - -

- In addition to synchronizing reads, this implementation also fixes - IEnumerator/ICollection issue described at - http://msdn.microsoft.com/en-us/netframework/aa570326.aspx - (search for SynchronizedHashtable for issue description), by implementing - interface explicitly, and returns thread safe enumerator - implementations as well. -

-

- This class should be used whenever a truly synchronized - is needed. -

-
- Aleksandar Seovic -
- - - Initializes a new instance of - - - - - Initializes a new instance of - - - - - Initializes a new instance of , copying inital entries from - handling keys depending on . - - - - - Creates a instance that - synchronizes access to the underlying . - - the hashtable to be synchronized - - - - Creates a wrapper that synchronizes - access to the passed . - - the hashtable to be synchronized - - - - Adds an element with the provided key and value to the object. - - The to use as the value of the element to add. - The to use as the key of the element to add. - An element with the same key already exists in the object. - key is null. - The is read-only.-or- The has a fixed size. 2 - - - - Removes all elements from the object. - - The object is read-only. 2 - - - - Creates a new object that is a copy of the current instance. - - - A new object that is a copy of this instance. - - - - - Determines whether the object contains an element with the specified key. - - - true if the contains an element with the key; otherwise, false. - - The key to locate in the object. - key is null. 2 - - - - Returns, whether this contains an entry with the specified . - - The key to look for - , if this contains an entry with this - - - - Returns, whether this contains an entry with the specified . - - The valúe to look for - , if this contains an entry with this - - - - Copies the elements of the to an , starting at a particular index. - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - The type of the source cannot be cast automatically to the type of the destination array. - index is less than zero. - array is multidimensional.-or- index is equal to or greater than the length of array.-or- The number of elements in the source is greater than the available space from index to the end of the destination array. 2 - - - - Returns an object for the object. - - - An object for the object. - - - - - Removes the element with the specified key from the object. - - The key of the element to remove. - The object is read-only.-or- The has a fixed size. - key is null. 2 - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Gets a value indicating whether the object is read-only. - - - true if the object is read-only; otherwise, false. - - - - - Gets a value indicating whether the object has a fixed size. - - - true if the object has a fixed size; otherwise, false. - - - - - Gets a value indicating whether access to the is synchronized (thread safe). - - - true if access to the is synchronized (thread safe); otherwise, false. - - - - - Gets an object containing the keys of the object. - - - An object containing the keys of the object. - - - - - Gets an object containing the values in the object. - - - An object containing the values in the object. - - - - - Gets an object that can be used to synchronize access to the . - - - An object that can be used to synchronize access to the . - - - - - Gets the number of elements contained in the . - - - The number of elements contained in the . - - - - - Gets or sets the element with the specified key. - - - The element with the specified key. - - The key of the element to get or set. - The property is set and the object is read-only.-or- The property is set, key does not exist in the collection, and the has a fixed size. - key is null. 2 - - - - Implements a thread-safe wrapper. - - -

- The implementation is extremely conservative, serializing critical - sections to prevent possible deadlocks, and locking on everything. The - one exception is for enumeration, which is inherently not thread-safe. - For this, you have to lock the SyncRoot object for the - duration of the enumeration. -

-
- -
- - - Constructs a thread-safe - wrapper. - - - The object that this object - will wrap. - - - If the supplied ecposes a - SyncRoot value. - - - - - Adds the specified element to this set if it is not already present. - - The object to add to the set. - - is the object was added, - if the object was already present. - - - - - Adds all the elements in the specified collection to the set if - they are not already present. - - A collection of objects to add to the set. - - is the set changed as a result of this - operation. - - - - - Removes all objects from this set. - - - - - Returns if this set contains the specified - element. - - The element to look for. - - if this set contains the specified element. - - - - - Returns if the set contains all the - elements in the specified collection. - - A collection of objects. - - if the set contains all the elements in the - specified collection; also if the - supplied is . - - - - - Removes the specified element from the set. - - The element to be removed. - - if the set contained the specified element. - - - - - Remove all the specified elements from this set, if they exist in - this set. - - A collection of elements to remove. - - if the set was modified as a result of this - operation. - - - - - Retains only the elements in this set that are contained in the - specified collection. - - - The collection that defines the set of elements to be retained. - - - if this set changed as a result of this - operation. - - - - - Copies the elements in the to - an array. - - -

- The type of array needs to be compatible with the objects in the - , obviously. -

-
- - An array that will be the target of the copy operation. - - - The zero-based index where copying will start. - -
- - - Gets an enumerator for the elements in the - . - - - An over the elements - in the . - - - - - Returns a clone of the instance. - - A clone of this object. - - - - Returns if this set contains no elements. - - - - - The number of elements currently contained in this collection. - - - - - Returns if the - is synchronized across - threads. - - - - - - An object that can be used to synchronize this collection to make - it thread-safe. - - - An object that can be used to synchronize this collection to make - it thread-safe. - - - - - - Simple listener that logs application events to the console. - - -

- Intended for use during debugging only. -

-
- Rod Johnson - Griffin Caprio (.NET) - -
- - - A listener for application events. - - Rod Johnson - Griffin Caprio (.NET) - - - - Handle an application event. - - - The source of the event. - - - The event that is to be handled. - - - - - Creates a new instance of the - class. - - - - - Handle an application event. - - - The source of the event. - - - The event that is to be handled. - - - - - Event object sent to listeners registered with an - to inform them of - context lifecycle events. - - Griffin Caprio (.NET) - - - - - - - Encapsulates the data associated with an event raised by an - . - - Rod Johnson - Mark Pollack (.NET) - Griffin Caprio (.NET) - - - - - Creates a new instance of the - class. - - - - - The date and time when the event occured. - - - The date and time when the event occured. - - - - - The system time in milliseconds when the event happened. - - - The system time in milliseconds when the event happened. - - - - - Creates a new instance of the ContextEventArgs class to represent the - supplied context event. - - The type of context event. - - - - Returns a string representation of this object. - - A string representation of this object. - - - - The event type. - - - - - The various context event types. - - - - - The event type when the context is refreshed or created. - - - - - The event type when the context is closed. - - - - - Partial implementation of the - interface. - - -

- Does not mandate the type of storage used for configuration, but does - implement common functionality. Uses the Template Method design - pattern, requiring concrete subclasses to implement - methods. -

-

- In contrast to a plain vanilla - , an - is supposed - to detect special objects defined in its object factory: therefore, - this class automatically registers - s, - s - and s that are - defined as objects in the context. -

-

- An may be also supplied as - an object in the context, with the special, well-known-name of - "messageSource". Else, message resolution is delegated to the - parent context. -

-
- Rod Johnson - Juergan Hoeller - Griffin Caprio (.NET) - - -
- - - Configurable implementation of the - interface. - - -

- This implementation - supports the configuration of resource access protocols and the - corresponding .NET types that know how to handle those protocols. -

-

- Basic protocol-to-resource type mappings are also defined by this class, - while others can be added either internally, by application contexts - extending this class, or externally, by the end user configuring the - context. -

-

- Only one resource type can be defined for each protocol, but multiple - protocols can map to the same resource type (for example, the - "http" and "ftp" protocols both map to the - type. The protocols that are - mapped by default can be found in the following list. -

-

- - - assembly - - - config - - - file - - - http - - - https - - -

-
- Aleksandar Seovic - - - -
- - - Describes an object that can load - s. - - -

- An implementation is - generally required to support the functionality described by this - interface. -

-

- The class is a - standalone implementation that is usable outside an - ; the aforementioned - class is also used by the - class. -

-
- Juergen Hoeller - Mark Pollack (.NET) - - - -
- - - Return an handle for the - specified resource. - - -

- The handle should always be a reusable resource descriptor; this - allows one to make repeated calls to the underlying - . -

-

-

    -
  • - Must support fully qualified URLs, e.g. "file:C:/test.dat". -
  • -
  • - Should support relative file paths, e.g. "test.dat" (this will be - implementation-specific, typically provided by an - implementation). -
  • -
-

- - An handle does not imply an - existing resource; you need to check the value of an - 's - property to determine - conclusively whether or not the resource actually exists. - -
- The resource location. - - An appropriate handle. - - - - -
- - - The separator between the protocol name and the resource name. - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class using the specified default protocol for unqualified resources. - - - - - Returns a that has been - mapped to the protocol of the supplied . - - The name of the resource. - - A new instance for the - supplied . - - - If a - mapping does not exist for the supplied . - - - In the case of any errors arising from the instantiation of the - returned instance. - - - - - - Checks that the supplied starts - with one of the protocol names currently mapped by this - instance. - - The name of the resource. - - if the supplied - starts with one of the known - protocols; if not, or if the supplied - is itself . - - - - - Extracts the protocol name from the supplied - . - - The name of the resource. - - The extracted protocol name or if the - supplied is unqualified (or - is itself ). - - - - - The default protocol to use for unqualified resources. - - -

- The initial value is "file". -

-
-
- - - Provides the means to configure an application context in addition to - the methods exposed on the - interface. - - -

- This interface is to be implemented by most (if not all) - implementations. -

-

- Configuration and lifecycle methods are encapsulated here to avoid - making them obvious to - client code. -

-

- Calling will close this - application context, releasing all resources and locks that the - implementation might hold. This includes disposing all cached - singleton objects. -

- - does not invoke the - attendant on any parent - context. - -
- Juergen Hoeller - Mark Pollack (.NET) - - -
- - - The central interface to Spring.NET's IoC container. - - -

- implementations - provide: - - - - Object factory functionality inherited from the - - and - interfaces. - - - - - The ability to resolve messages, supporting internationalization. - Inherited from the - interface. - - - - - The ability to load file resources in a generic fashion. - Inherited from the - interface. - - - - - Acts an an event registry for supporting loosely coupled eventing - between objecs. Inherited from the - interface. - - - - - The ability to raise events related to the context lifecycle. Inherited - from the - interface. - - - - - Inheritance from a parent context. Definitions in a descendant context - will always take priority. - - - -

-

- In addition to standard object factory lifecycle capabilities, - implementations need - to detect - , - , and - objects and supply - their attendant dependencies accordingly. -

-

- This interface is the central client interface in Spring.NET's IoC - container implementation. As such it does inherit a quite sizeable - number of interfaces; implementations are strongly encouraged to use - composition to satisfy each of the inherited interfaces (where - appropriate of course). -

-
- Rod Johnson - Juergen Hoeller - Mark Pollack (.NET) - - - - -
- - - Extension of the interface - to be implemented by object factories that can enumerate all their object instances, - rather than attempting object lookup by name one by one as requested by clients. - - -

- implementations that preload - all their objects (for example, DOM-based XML factories) may implement this - interface. This interface is discussed in - "Expert One-on-One J2EE Design and Development", by Rod Johnson. -

-

- If this is an , - the return values will not take any - hierarchy into account, but - will relate only to the objects defined in the current factory. - Use the helper class to - get all objects. -

-

- With the exception of - , - the methods and properties in this interface are not designed for frequent - invocation. Implementations may be slow. -

-
- Rod Johnson - Rick Evans (.NET) -
- - - The root interface for accessing a Spring.NET IoC container. - - - - This is the basic client view of a Spring.NET IoC container; further interfaces - such as and - - are available for specific purposes such as enumeration and configuration. - - - This is the root interface to be implemented by objects that can hold a number - of object definitions, each uniquely identified by a - name. An independent instance of any of these objects can be obtained - (the Prototype design pattern), or a single shared instance can be obtained - (a superior alternative to the Singleton design pattern, in which the instance is a - singleton in the scope of the factory). Which type of instance - will be returned depends on the object factory configuration - the API is the same. - The Singleton approach is more useful and hence more common in practice. - - - The point of this approach is that the IObjectFactory is a central registry of - application components, and centralizes the configuring of application components - (no more do individual objects need to read properties files, for example). - See chapters 4 and 11 of "Expert One-on-One J2EE Design and Development" for a - discussion of the benefits of this approach. - - - Normally an IObjectFactory will load object definitions stored in a configuration - source (such as an XML document), and use the - namespace to configure the objects. However, an implementation could simply return - .NET objects it creates as necessary directly in .NET code. There are no - constraints on how the definitions could be stored: LDAP, RDBMS, XML, properties - file etc. Implementations are encouraged to support references amongst objects, - to either Singletons or Prototypes. - - - In contrast to the methods in - , all of the methods - in this interface will also check parent factories if this is an - . If an object is - not found in this factory instance, the immediate parent is asked. Objects in - this factory instance are supposed to override objects of the same name in any - parent factory. - - - Object factories are supposed to support the standard object lifecycle interfaces - as far as possible. The maximum set of initialization methods and their standard - order is: - - - - - - 's - property. - - - - - 's - property. - - - - - - (only applicable if running within an ). - - - - - The - - method of - s. - - - - - 's - method. - - - - - A custom init-method definition. - - - - - The - - method of - s. - - - - -

- - On shutdown of an object factory, the following lifecycle methods apply: - - - - - - 's - method. - - - - - A custom destroy-method definition. - - - - - - Rod Johnson - Juergen Hoeller - Rick Evans (.NET) - - -

- Is this object a singleton? - - - - That is, will - always return the same object? - - - Will ask the parent factory if the object cannot be found in this factory - instance. - - - The name of the object to query. - True if the named object is a singleton. - - If there's no such object definition. - -
- - - Determines whether the specified object name is prototype. That is, will GetObject - always return independent instances? - - This method returning false does not clearly indicate a singleton object. - It indicated non-independent instances, which may correspond to a scoped object as - well. use the IsSingleton property to explicitly check for a shared - singleton instance. - Translates aliases back to the corresponding canonical object name. Will ask the - parent factory if the object can not be found in this factory instance. - - - - The name of the object to query - - true if the specified object name will always deliver independent instances; otherwise, false. - - if there is no object with the given name. - - - - Does this object factory contain an object with the given name? - - - - Will ask the parent factory if the object cannot be found in this factory - instance. - - - The name of the object to query. - True if an object with the given name is defined. - - - - Return the aliases for the given object name, if defined. - - - - Will ask the parent factory if the object cannot be found in this factory - instance. - - - The object name to check for aliases. - The aliases, or an empty array if none. - - If there's no such object definition. - - - - - Return an instance (possibly shared or independent) of the given object name. - - - - This method allows an object factory to be used as a replacement for the - Singleton or Prototype design pattern. - - - Note that callers should retain references to returned objects. There is no - guarantee that this method will be implemented to be efficient. For example, - it may be synchronized, or may need to run an RDBMS query. - - - Will ask the parent factory if the object cannot be found in this factory - instance. - - - The name of the object to return. - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - - - Return an instance (possibly shared or independent) of the given object name. - - - - This method allows an object factory to be used as a replacement for the - Singleton or Prototype design pattern. - - - Note that callers should retain references to returned objects. There is no - guarantee that this method will be implemented to be efficient. For example, - it may be synchronized, or may need to run an RDBMS query. - - - Will ask the parent factory if the object cannot be found in this factory - instance. - - - The name of the object to return. - - The arguments to use if creating a prototype using explicit arguments to - a static factory method. If there is no factory method and the - arguments are not null, then match the argument values by type and - call the object's constructor. - - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the supplied is . - - - - - Return an instance (possibly shared or independent) of the given object name. - - The name of the object to return. - - The the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - - The arguments to use if creating a prototype using explicit arguments to - a factory method. If there is no factory method and the - supplied array is not , then - match the argument values by type and call the object's constructor. - - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the object is not of the required type. - - - If the supplied is . - - - - - - Return an instance (possibly shared or independent) of the given object name. - - - - Provides a measure of type safety by throwing an exception if the object is - not of the required . - - - This method allows an object factory to be used as a replacement for the - Singleton or Prototype design pattern. - - - Note that callers should retain references to returned objects. There is no - guarantee that this method will be implemented to be efficient. For example, - it may be synchronized, or may need to run an RDBMS query. - - - Will ask the parent factory if the object cannot be found in this factory - instance. - - - The name of the object to return. - - the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the object is not of the required type. - - - - - Determine the type of the object with the given name. - - - - More specifically, checks the type of object that - would return. - For an , returns the type - of object that the creates. - - - The name of the object to query. - - The type of the object or if not determinable. - - - - - Determines whether the object with the given name matches the specified type. - - More specifically, check whether a GetObject call for the given name - would return an object that is assignable to the specified target type. - Translates aliases back to the corresponding canonical bean name. - Will ask the parent factory if the bean cannot be found in this factory instance. - - The name of the object to query. - Type of the target to match against. - - true if the object type matches; otherwise, false - if it doesn't match or cannot be determined yet. - - Ff there is no object with the given name - - - - - Return an unconfigured(!) instance (possibly shared or independent) of the given object name. - - The name of the object to return. - - The the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - - The arguments to use if creating a prototype using explicit arguments to - a factory method. If there is no factory method and the - supplied array is not , then - match the argument values by type and call the object's constructor. - - The unconfigured(!) instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the object is not of the required type. - - - If the supplied is . - - - - This method will only instantiate the requested object. It does NOT inject any dependencies! - - - - - Injects dependencies into the supplied instance - using the named object definition. - - - - In addition to being generally useful, typically this method is used to provide - dependency injection functionality for objects that are instantiated outwith the - control of a developer. A case in point is the way that the current (1.1) - ASP.NET classes instantiate web controls... the instantiation takes place within - a private method of a compiled page, and thus cannot be hooked into the - typical Spring.NET IOC container lifecycle for dependency injection. - - - - The following code snippet assumes that the instantiated factory instance - has been configured with an object definition named - 'ExampleNamespace.BusinessObject' that has been configured to set the - Dao property of any ExampleNamespace.BusinessObject instance - to an instance of an appropriate implementation... - - namespace ExampleNamespace - { - public class BusinessObject - { - private IDao _dao; - - public BusinessObject() {} - - public IDao Dao - { - get { return _dao; } - set { _dao = value; } - } - } - } - - with the corresponding driver code looking like so... - - IObjectFactory factory = GetAnIObjectFactoryImplementation(); - BusinessObject instance = new BusinessObject(); - factory.ConfigureObject(instance, "object_definition_name"); - // at this point the dependencies for the 'instance' object will have been resolved... - - - - The object instance that is to be so configured. - - - The name of the object definition expressing the dependencies that are to - be injected into the supplied instance. - - - If there is no object definition for the supplied . - - - If any of the target object's dependencies could not be created. - - - - - Return an instance (possibly shared or independent) of the given object name. - - - - This method allows an object factory to be used as a replacement for the - Singleton or Prototype design pattern. - - - Note that callers should retain references to returned objects. There is no - guarantee that this method will be implemented to be efficient. For example, - it may be synchronized, or may need to run an RDBMS query. - - - Will ask the parent factory if the object cannot be found in this factory - instance. - - - This is the indexer for the - interface. - - - The name of the object to return. - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - - - Check if this object factory contains an object definition with the given name. - - -

- Does not consider any hierarchy this factory may participate in. -

- - Ignores any singleton objects that have been registered by other means - than object definitions. - -
- The name of the object to look for. - - if this object factory contains an object - definition with the given name. - -
- - - Return the names of all objects defined in this factory. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - - - - - Return the names of objects matching the given - (including subclasses), judging from the object definitions. - - -

- Does consider objects created by s, - or rather it considers the type of objects created by - (which means that - s will be instantiated). -

-

- Does not consider any hierarchy this factory may participate in. -

-
- - The (class or interface) to match, or - for all object names. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - -
- - - Return the names of objects matching the given - (including subclasses), judging from the object definitions. - - -

- Does consider objects created by s, - or rather it considers the type of objects created by - (which means that - s will be instantiated). -

-

- Does not consider any hierarchy this factory may participate in. -

-
- - The (class or interface) to match, or - for all object names. - - - Whether to include prototype objects too or just singletons (also applies to - s). - - - Whether to include s too - or just normal objects. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - -
- - - Return the object instances that match the given object - (including subclasses), judging from either object - definitions or the value of - in the case of - s. - - -

- This version of the - method matches all kinds of object definitions, be they singletons, prototypes, or - s. Typically, the results - of this method call will be the same as a call to - IListableObjectFactory.GetObjectsOfType(type,true,true) . -

-
- - The (class or interface) to match. - - - A of the matching objects, - containing the object names as keys and the corresponding object instances - as values. - - - If the objects could not be created. - -
- - - Return the object instances that match the given object - (including subclasses), judging from either object - definitions or the value of - in the case of - s. - - - The (class or interface) to match. - - - Whether to include prototype objects too or just singletons (also applies to - s). - - - Whether to include s too - or just normal objects. - - - A of the matching objects, - containing the object names as keys and the corresponding object instances - as values. - - - If the objects could not be created. - - - - - Return the number of objects defined in the factory. - - - The number of objects defined in the factory. - - - - - Sub-interface implemented by object factories that can be part - of a hierarchy. - - Rod Johnson - Rick Evans (.NET) - - - - Determines whether the local object factory contains a bean of the given name, - ignoring object defined in ancestor contexts. - This is an alternative to ContainsObject, ignoring an object - of the given name from an ancestor object factory. - - The name of the object to query. - - true if objects with the specified name is defined in the local factory; otherwise, false. - - - - - Return the parent object factory, or - if this factory does not have a parent. - - - The parent object factory, or - if this factory does not have a parent. - - - - - Describes an object that can resolve messages. - - -

- This enables the parameterization and internationalization of messages. -

-

- Spring.NET provides one out-of-the-box implementation for production - use: -

    -
  • .
  • -
-

-
- Rod Johnson - Juergen Hoeller - Mark Pollack (.NET) - Aleksandar Seovic (.NET) - -
- - - Resolve the message identified by the supplied - . - - -

- If the lookup is not successful, implementations are permitted to - take one of two actions. -

- - - Throw an exception. - - - - Return the supplied as is. - - - -
- The name of the message to resolve. - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - -
- - - Resolve the message identified by the supplied - . - - -

- If the lookup is not successful, implementations are permitted to - take one of two actions. -

- - - Throw an exception. - - - - Return the supplied as is. - - - -
- The name of the message to resolve. - - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - -
- - - Resolve the message identified by the supplied - . - - - Note that the fallback behavior based on CultureInfo seem to - have a bug that is fixed by installed .NET 1.1 Service Pack 1. -

- If the lookup is not successful, implementations are permitted to - take one of two actions. -

- - - Throw an exception. - - - - Return the supplied as is. - - - -
- The name of the message to resolve. - - The that represents - the culture for which the resource is localized. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - -
- - - Resolve the message identified by the supplied - . - - - Note that the fallback behavior based on CultureInfo seem to - have a bug that is fixed by installed .NET 1.1 Service Pack 1. -

- If the lookup is not successful, implementations are permitted to - take one of two actions. -

- - - Throw an exception. - - - - Return the supplied as is. - - - -
- The name of the message to resolve. - - The that represents - the culture for which the resource is localized. - - - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - -
- - - Resolve the message identified by the supplied - . - - - Note that the fallback behavior based on CultureInfo seem to - have a bug that is fixed by installed .NET 1.1 Service Pack 1. -

- If the lookup is not successful, implementations are permitted to - take one of two actions. -

- - - Throw an exception. - - - - Return the supplied as is. - - - -
- The name of the message to resolve. - The default message if name is not found. - - The that represents - the culture for which the resource is localized. - - - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - -
- - - Resolve the message using all of the attributes contained within - the supplied - argument. - - - The value object storing those attributes that are required to - properly resolve a message. - - - The that represents - the culture for which the resource is localized. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If the message could not be resolved. - - - - - Gets a localized resource object identified by the supplied - . - - -

- This method must use the - - value to obtain a resource. -

-

- Examples of resources that may be resolved by this method include - (but are not limited to) objects such as icons and bitmaps. -

-
- - The name of the resource object to resolve. - - - The resolved object, or if not found. - -
- - - Gets a localized resource object identified by the supplied - . - - -

- Examples of resources that may be resolved by this method include - (but are not limited to) objects such as icons and bitmaps. -

-
- - The name of the resource object to resolve. - - - The with which the - resource is associated. - - - The resolved object, or if not found. - -
- - - Applies resources to object properties. - - -

- Resource key names are of the form objectName.propertyName. -

-
- - An object that contains the property values to be applied. - - - The base name of the object to use for key lookup. - - - The with which the - resource is associated. - -
- - - Encapsulates event publication functionality. - - -

- Serves as a super-interface for the - interface. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Publishes an application context event. - - - The source of the event. May be . - - - The event that is to be raised. - - - - - A registry that manages subscriptions to and the - publishing of events. - - Griffin Caprio - - - - Publishes all events of the source object. - - - The source object containing events to publish. - - - - - Subscribes to all events published, if the subscriber - implements compatible handler methods. - - The subscriber to use. - - - - Subscribes to the published events of all objects of a given - , if the subscriber implements - compatible handler methods. - - The subscriber to use. - - The target to subscribe to. - - - - - Unsubscribes to all events published, if the subscriber - implmenets compatible handler methods. - - The subscriber to use - - - - Unsubscribes to the published events of all objects of a given - , if the subscriber implements - compatible handler methods. - - The subscriber to use. - - The target to unsubscribe from - - - - - Raised in response to an application context event. - - - - - Returns the date and time this context was loaded. - - -

- This is to be set immediately after an - has been - instantiated and its configuration has been loaded. Implementations - are permitted to update this value if the context is reset or - refreshed in some way. -

-
- - The representing when this context - was loaded. - - -
- - - Gets the parent context, or if there is no - parent context. - - -

- If the parent context is , then this context - is the root of any context hierarchy. -

-
- - The parent context, or if there is no - parent. - -
- - - Gets and sets a name for this context. - - - A name for this context. - - - - - Interface defining methods for start/stop lifecycle control. - The typical use case for this is to control asynchronous processing. - - - - Can be implemented by both components (typically a Spring object defined in - a spring and containers - (typically a spring . Containers will - propagate start/stop signals to all components that apply. - - - Juergen Hoeller - Mark Pollack (.NET) - - - - Starts this component. - - Should not throw an exception if the component is already running. - In the case of a container, this will propagate the start signal - to all components that apply. - - - - - Stops this component. - - - Should not throw an exception if the component isn't started yet. - In the case of a container, this will propagate the stop signal - to all components that apply. - - - - - Gets a value indicating whether this component is currently running. - - - In the case of a container, this will return true - only if all components that apply are currently running. - - - true if this component is running; otherwise, false. - - - - - Add an - - that will get applied to the internal object factory of this - application context on refresh, before any of the object - definitions are evaluated. - - -

- To be invoked during context configuration. -

-
- - The factory processor to register. - - -
- - - Load or refresh the persistent representation of the configuration, - which might an XML file, properties file, or relational database schema. - - - If the configuration cannot be loaded. - - - If the object factory could not be initialized. - - - - - Return the internal object factory of this application context. - - -

- Can be used to access specific functionality of the factory. -

- - This is just guaranteed to return an instance that is not - after the context has been refreshed - at least once. - - - Do not use this to post-process the object factory; singletons - will already have been instantiated. Use an - - to intercept the object factory setup process before objects even - get touched. - -
- -
- - - Sets the parent of this application context. - - - - The parent should not be changed: it should only be set - outside a constructor if it isn't available when an instance of - this class is created. - - - - The parent context. - - - - - Name of the .Net config section that contains Spring.Net context definition. - - - - - Default name of the root context. - - - - - The special, well-known-name of the default - in the context. - - -

- If no can be found - in the context using this lookup key, then message resolution - will be delegated to the parent context (if any). -

-
-
- - - The special, well-known-name of the default - in the context. - - -

- If no can be found - in the context using this lookup key, then a default - will be used. -

-
-
- - - The instance for this class. - - - - - The instance we delegate - our implementation of said interface to. - - - - - The instance we - delegate our implementation of said interface to. - - - - - Creates a new instance of the - with no parent context. - - -

- This is an class, and as such exposes - no public constructors. -

-
-
- - - Creates a new instance of the - with no parent context. - - -

- This is an class, and as such exposes - no public constructors. -

-
- Flag specifying whether to make this context case sensitive or not. -
- - - Creates a new instance of the - with the supplied parent context. - - -

- This is an class, and as such exposes - no public constructors. -

-
- The application context name. - Flag specifying whether to make this context case sensitive or not. - The parent application context. -
- - - Adds the given to the list of standard - processors being added to the underlying - - - Each time is called on this context, the context ensures, that - all default s are registered with the underlying . - - The instance. - - - - Closes this context and disposes of any resources (such as - singleton objects in the wrapped - ). - - - - - Subclasses must implement this method to perform the actual - configuration loading. - - -

- This method is invoked by - , - before any other initialization occurs. -

-
- - In the case of errors encountered while refreshing the object factory. - -
- - - Returns the internal object factory of the parent context if it implements - ; else, - returns the parent context itself. - - - The parent context's object factory, or the parent itself. - - - - - Raises an application context event. - - - Any arguments to the event. May be . - - - - - Raises an application context event. - - - The source of the event. - - - Any arguments to the event. May be . - - - - - Modify the application context's internal object factory after its standard - initialization. - - -

- All object definitions will have been loaded, but no objects - will have been instantiated yet. This allows for the registration - of special - s - in certain - implementations. -

-
- - The object factory used by the application context. - - - In the case of errors. - . -
- - - Template method which can be overridden to add context-specific - refresh work. - - -

- Called on initialization of special objects, before instantiation - of singletons. -

-
-
- - - Instantiate and invoke all registered - - objects, respecting any explicit ordering. - - - - Must be called before singleton instantiation. - - - In the case of errors. - - - - Resets the well-known ObjectPostProcessorChecker that logs an info - message when an object is created during IObjectPostProcessor - instantiation, i.e. when an object is not eligible for being - processed by all IObjectPostProcessors. - - - - - Initializes the default event registry for this context. - - - - - Returns the internal message source of the parent context if said - parent context is an , else - simply the parent context itself. - - - The internal message source of the parent context if said - parent context is an , else - simply the parent context itself. - - - - - Initializes the default message source for this context. - - -

- Uses any parent context's message source if one is not available - in this context. -

-
-
- - - Add a new - that will get applied to the internal object factory of this application context - on refresh, before any of the object definitions are evaluated. - - - The factory processor to register. - - - - - Load or refresh the persistent representation of the configuration, - which might an XML file, properties file, or relational database schema. - - - If the configuration cannot be loaded. - - - If the object factory could not be initialized. - - - - - Ensures, that predefined ObjectPostProcessors are registered with this ObjectFactory - - - - - - Starts this component. - - Should not throw an exception if the component is already running. - In the case of a container, this will propagate the start signal - to all components that apply. - - - - - Stops this component. - - - Should not throw an exception if the component isn't started yet. - In the case of a container, this will propagate the stop signal - to all components that apply. - - - - - Return the names of objects matching the given - (including subclasses), judging from the object definitions. - - - The (class or interface) to match, or - for all object names. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - - - - - - Return the names of objects matching the given - (including subclasses), judging from the object definitions. - - - The (class or interface) to match, or - for all object names. - - - Whether to include prototype objects too or just singletons (also applies to - s). - - - Whether to include s too - or just normal objects. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - - - - - - Return the names of all objects defined in this factory. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - - - - - - Return the registered - for the - given object, allowing access to its property values and constructor - argument values. - - The name of the object. - - The registered - . - - - If there is no object with the given name. - - - In the case of errors. - - - - - Return the registered - for the - given object, allowing access to its property values and constructor - argument values. - - The name of the object. - Whether to search parent object factories. - - The registered - . - - - If there is no object with the given name. - - - In the case of errors. - - - - - Return the object instances that match the given object - (including subclasses), judging from either object - definitions or the value of - in the case of - s. - - - The (class or interface) to match. - - - A of the matching objects, - containing the object names as keys and the corresponding object instances - as values. - - - If the objects could not be created. - - - - - - Return the object instances that match the given object - (including subclasses), judging from either object - definitions or the value of - in the case of - s. - - - The (class or interface) to match. - - - Whether to include prototype objects too or just singletons (also applies to - s). - - - Whether to include s too - or just normal objects. - - - A of the matching objects, - containing the object names as keys and the corresponding object instances - as values. - - - If the objects could not be created. - - - - - - Check if this object factory contains an object definition with the given name. - - The name of the object to look for. - - True if this object factory contains an object definition with the given name. - - - - - - Does this object factory contain an object with the given name? - - The name of the object to query. - - if an object with the given name is defined. - - - - - - Return the aliases for the given object name, if defined. - - The object name to check for aliases. - The aliases, or an empty array if none. - - If there's no such object definition. - - - - - - Return an unconfigured(!) instance (possibly shared or independent) of the given object name. - - The name of the object to return. - - The the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - - The arguments to use if creating a prototype using explicit arguments to - a factory method. If there is no factory method and the - supplied array is not , then - match the argument values by type and call the object's constructor. - - The unconfigured(!) instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the object is not of the required type. - - - If the supplied is . - - - - This method will only instantiate the requested object. It does NOT inject any dependencies! - - - - - Return an instance (possibly shared or independent) of the given object name. - - The name of the object to return. - - the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the object is not of the required type. - - - - - - Return an instance (possibly shared or independent) of the given object name. - - The name of the object to return. - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - - - - Return an instance (possibly shared or independent) of the given object name. - - -

- This method allows an object factory to be used as a replacement for the - Singleton or Prototype design pattern. -

-

- Note that callers should retain references to returned objects. There is no - guarantee that this method will be implemented to be efficient. For example, - it may be synchronized, or may need to run an RDBMS query. -

-

- Will ask the parent factory if the object cannot be found in this factory - instance. -

-
- The name of the object to return. - - The arguments to use if creating a prototype using explicit arguments to - a static factory method. If there is no factory method and the - arguments are not null, then match the argument values by type and - call the object's constructor. - - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the supplied is . - -
- - - Return an instance (possibly shared or independent) of the given object name. - - The name of the object to return. - - The the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - - The arguments to use if creating a prototype using explicit arguments to - a factory method. If there is no factory method and the - supplied array is not , then - match the argument values by type and call the object's constructor. - - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the object is not of the required type. - - - If the supplied is . - - - - - - Is this object a singleton? - - The name of the object to query. - True if the named object is a singleton. - - If there's no such object definition. - - - - - - Determines whether the specified object name is prototype. That is, will GetObject - always return independent instances? - - The name of the object to query - - true if the specified object name will always deliver independent instances; otherwise, false. - - This method returning false does not clearly indicate a singleton object. - It indicated non-independent instances, which may correspond to a scoped object as - well. use the IsSingleton property to explicitly check for a shared - singleton instance. - Translates aliases back to the corresponding canonical object name. Will ask the - parent factory if the object can not be found in this factory instance. - - - if there is no object with the given name. - - - - Determines whether the object with the given name matches the specified type. - - More specifically, check whether a GetObject call for the given name - would return an object that is assignable to the specified target type. - Translates aliases back to the corresponding canonical bean name. - Will ask the parent factory if the bean cannot be found in this factory instance. - - The name of the object to query. - Type of the target to match against. - - true if the object type matches; otherwise, false - if it doesn't match or cannot be determined yet. - - Ff there is no object with the given name - - - - - Determine the of the object with the - given name. - - The name of the object to query. - - The of the object, or - if not determinable. - - - - - - Injects dependencies into the supplied instance - using the named object definition. - - - The object instance that is to be so configured. - - - The name of the object definition expressing the dependencies that are to - be injected into the supplied instance. - - - - - - Injects dependencies into the supplied instance - using the supplied . - - - The object instance that is to be so configured. - - - The name of the object definition expressing the dependencies that are to - be injected into the supplied instance. - - - An object definition that should be used to configure object. - - - - - - Determines whether the local object factory contains a bean of the given name, - ignoring object defined in ancestor contexts. - This is an alternative to ContainsObject, ignoring an object - of the given name from an ancestor object factory. - - The name of the object to query. - - true if objects with the specified name is defined in the local factory; otherwise, false. - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - - The that represents - the culture for which the resource is localized. - - - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If no message could be resolved. - - - If the supplied is . - - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - The default message. - - The that represents - the culture for which the resource is localized. - - - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If no message could be resolved. - - - If the supplied is . - - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - - The resolved message if the lookup was successful. - - - If no message could be resolved. - - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - - The resolved message if the lookup was successful. - - - If no message could be resolved. - - - If the supplied is . - - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - - The that represents - the culture for which the resource is localized. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If no message could be resolved. - - - If the supplied is . - - - - - - Resolve the message using all of the attributes contained within - the supplied - argument. - - - The value object storing those attributes that are required to - properly resolve a message. - - - The that represents - the culture for which the resource is localized. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If the message could not be resolved. - - - - - - Gets a localized resource object identified by the supplied - . - - - The name of the resource object to resolve. - - - The with which the - resource is associated. - - - The resolved object, or if not found. - - - - - - Gets a localized resource object identified by the supplied - . - - - The name of the resource object to resolve. - - - The resolved object, or if not found. - - - - - - Gets a localized resource object identified by the supplied - . - - - The name of the resource object to resolve. - - - The with which the - resource is associated. - - - The resolved object, or if not found. - - - - - - Gets a localized resource object identified by the supplied - . - - - The name of the resource object to resolve. - - - The resolved object, or if not found. - - - - - - Applies resources to object properties. - - - An object that contains the property values to be applied. - - - The base name of the object to use for key lookup. - - - The with which the - resource is associated. - - - - - - Publishes all events of the source object. - - - The source object containing events to publish. - - - - - - Subscribes to all events published, if the subscriber - implements compatible handler methods. - - The subscriber to use. - - - - - Subscribes to published events of a all objects of a given - , if the subscriber implements - compatible handler methods. - - The subscriber to use. - - The target to subscribe to. - - - - - - Unsubscribes to all events published, if the subscriber - implmenets compatible handler methods. - - The subscriber to use - - - - Unsubscribes to the published events of all objects of a given - , if the subscriber implements - compatible handler methods. - - The subscriber to use. - - The target to unsubscribe from - - - - - Publishes an application context event. - - -

- -

-
- - The source of the event. May be . - - - The event that is to be raised. - - -
- - - An object that can be used to synchronize access to the - - - - - The timestamp when this context was first loaded. - - - The timestamp (milliseconds) when this context was first loaded. - - - - - Gets a flag indicating whether context should be case sensitive. - - true if object lookups are case sensitive; otherwise, false. - - - - The for this context. - - - If the context has not been initialized yet. - - - - - The for this context. - - - If the context has not been initialized yet. - - - - - Returns the list of the - s - that will be applied to the objects created with this factory. - - -

- The elements of this list are instances of implementations of the - - interface. -

-
- - The list of the - s - that will be applied to the objects created with this factory. - -
- - - Return the internal object factory of this application context. - - - - - Gets the parent context, or if there is no - parent context. - - - The parent context, or if there is no - parent. - - - - - - Gets a value indicating whether this component is currently running. - - - true if this component is running; otherwise, false. - - - In the case of a container, this will return true - only if all components that apply are currently running. - - - - - Gets a dictionary of all singleton beans that implement the - ILifecycle interface in this context. - - A dictionary of ILifecycle objects with object name as key. - - - - Raised in response to an implementation-dependant application - context event. - - - - - The date and time this context was first loaded. - - - The representing when this context - was first loaded. - - - - - A name for this context. - - - A name for this context. - - - - - Return the number of objects defined in the factory. - - - The number of objects defined in the factory. - - - - - - Return an instance (possibly shared or independent) of the given object name. - - The name of the object to return. - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - - - - Return the parent object factory, or if there is none. - - - The parent object factory, or if there is none. - - - - - - Allows for custom modification of new object instances, e.g. - checking for marker interfaces or wrapping them with proxies. - - -

- Application contexts can auto-detect - - objects in their object definitions and apply them before any other - objects get created. Plain object factories allow for programmatic - registration of post-processors. -

-

- Typically, post-processors that populate objects via marker interfaces - or the like will implement - , - and post-processors that wrap objects with proxies will normally implement - . -

-
- Juergen Hoeller - Aleksandar Seovic (.NET) - -
- - - Apply this - to the given new object instance before any object initialization callbacks. - - -

- The object will already be populated with property values. - The returned object instance may be a wrapper around the original. -

-
- - The new object instance. - - - The name of the object. - - - The object instance to use, either the original or a wrapped one. - - - In case of errors. - -
- - - Apply this to the - given new object instance after any object initialization callbacks. - - -

- The object will already be populated with property values. The returned object - instance may be a wrapper around the original. -

-
- - The new object instance. - - - The name of the object. - - - The object instance to use, either the original or a wrapped one. - - - In case of errors. - -
- - - Interface that can be implemented by objects that should be orderable, e.g. in an - . - - -

- The actual order can be interpreted as prioritization, the first object (with the - lowest order value) having the highest priority. -

-
- Juergen Hoeller - Aleksandar Seovic (.Net) -
- - - Return the order value of this object, where a higher value means greater in - terms of sorting. - - -

- Normally starting with 0 or 1, with indicating - greatest. Same order values will result in arbitrary positions for the affected - objects. -

-

- Higher value can be interpreted as lower priority, consequently the first object - has highest priority. -

-
- The order value. -
- - - Abstract implementation of the interface, - implementing common handling of message variants, making it easy - to implement a specific strategy for a concrete . - - -

Subclasses must implement the abstract ResolveObject - method.

-

Note: By default, message texts are only parsed through - String.Format if arguments have been passed in for the message. In case - of no arguments, message texts will be returned as-is. As a consequence, - you should only use String.Format escaping for messages with actual - arguments, and keep all other messages unescaped. -

-

Supports not only IMessageSourceResolvables as primary messages - but also resolution of message arguments that are in turn - IMessageSourceResolvables themselves. -

-

This class does not implement caching of messages per code, thus - subclasses can dynamically change messages over time. Subclasses are - encouraged to cache their messages in a modification-aware fashion, - allowing for hot deployment of updated messages. -

-
- Rod Johnson - Juergen Hoeller - Griffin Caprio (.NET) - Harald Radi (.NET) - - - -
- - - Sub-interface of to be - implemented by objects that can resolve messages hierarchically. - - Rod Johnson - Juergen Hoeller - Mark Pollack (.NET) - - - - - The parent message source used to try and resolve messages that - this object can't resolve. - - -

- If the value of this property is then no - further resolution is possible. -

-
-
- - - holds the logger instance shared with subclasses. - - - - - Initializes this instance. - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If the lookup is not successful throw NoSuchMessageException - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - The that represents - the culture for which the resource is localized. - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - Note that the fallback behavior based on CultureInfo seem to - have a bug that is fixed by installed .NET 1.1 Service Pack 1. -

- If the lookup is not successful, implementations are permitted to - take one of two actions. -

- If the lookup is not successful throw NoSuchMessageException -
-
- - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If the lookup is not successful throw NoSuchMessageException - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - The that represents - the culture for which the resource is localized. - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - Note that the fallback behavior based on CultureInfo seem to - have a bug that is fixed by installed .NET 1.1 Service Pack 1. -

- If the lookup is not successful throw NoSuchMessageException. -

-
-
- - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - The default message if name is not found. - The that represents - the culture for which the resource is localized. - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - Note that the fallback behavior based on CultureInfo seem to - have a bug that is fixed by installed .NET 1.1 Service Pack 1. -

- If the lookup is not successful throw NoSuchMessageException -

-
-
- - - Resolve the message using all of the attributes contained within - the supplied - argument. - - The value object storing those attributes that are required to - properly resolve a message. - The that represents - the culture for which the resource is localized. - - The resolved message if the lookup was successful. - - - If the message could not be resolved. - - - - - Gets a localized resource object identified by the supplied - . - - - The name of the resource object to resolve. - - - The resolved object, or if not found. - - - - - - Gets a localized resource object identified by the supplied - . - - - Note that the fallback behavior based on CultureInfo seem to - have a bug that is fixed by installed .NET 1.1 Service Pack 1. - - - The name of the resource object to resolve. - - - The with which the - resource is associated. - - - The resolved object, or if not found. If - the resource name resolves to null, then in .NET 1.1 the return - value will be String.Empty whereas in .NET 2.0 it will return - null. - - - - - - Applies resources to object properties. - - - An object that contains the property values to be applied. - - - The base name of the object to use for key lookup. - - - The with which the - resource is associated. - - - - - Resolve the given code and arguments as message in the given culture, - returning null if not found. Does not fall back to the code - as default message. Invoked by GetMessage methods. - - The code to lookup up, such as 'calculator.noRateSet'. - array of arguments that will be filled in for params - within the message. - The with which the - resource is associated. - - The resolved message if the lookup was successful. - - - - - Try to retrieve the given message from the parent MessageSource, if any. - - The code to lookup up, such as 'calculator.noRateSet'. - array of arguments that will be filled in for params - within the message. - The with which the - resource is associated. - - The resolved message if the lookup was successful. - - - - - Return a fallback default message for the given code, if any. - - - Default is to return the code itself if "UseCodeAsDefaultMessage" - is activated, or return no fallback else. In case of no fallback, - the caller will usually receive a NoSuchMessageException from GetMessage - - The code to lookup up, such as 'calculator.noRateSet'. - The default message to use, or null if none. - - - - Renders the default message string. The default message is passed in as specified by the - caller and can be rendered into a fully formatted default message shown to the user. - - Default implementation passed he String for String.Format resolving any - argument placeholders found in them. Subclasses may override this method to plug - in custom processing of default messages. - - The default message. - The array of agruments that will be filled in for parameter - placeholders within the message, or null if none. - The with which the - resource is associated. - The rendered default message (with resolved arguments) - - - - Format the given default message String resolving any - agrument placeholders found in them. - - The message to format. - The array of agruments that will be filled in for parameter - placeholders within the message, or null if none. - The with which the - resource is associated. - The formatted message (with resolved arguments) - - - - Search through the given array of objects, find any - MessageSourceResolvable objects and resolve them. - - - Allows for messages to have MessageSourceResolvables as arguments. - - - The array of arguments for a message. - The with which the - resource is associated. - An array of arguments with any IMessageSourceResolvables resolved - - - - Gets the specified resource (e.g. Icon or Bitmap). - - The name of the resource to resolve. - - The to resolve the - code for. - - The resource if found. otherwise. - - - - Applies resources from the given name on the specified object. - - - An object that contains the property values to be applied. - - - The base name of the object to use for key lookup. - - - The with which the - resource is associated. - - - - - Subclasses must implement this method to resolve a message. - - The code to lookup up, such as 'calculator.noRateSet'. - The with which the - resource is associated. - The resolved message from the backing store of message data. - - - - Resolves an object (typically an icon or bitmap). - - -

- Subclasses must implement this method to resolve an object. -

-
- The code of the object to resolve. - - The to resolve the - code for. - - - The resolved object or if not found. - -
- - - Applies resources to object properties. - - -

- Subclasses must implement this method to apply resources - to an arbitrary object. -

-
- - An object that contains the property values to be applied. - - - The base name of the object to use for key lookup. - - - The with which the - resource is associated. - -
- - Gets or Sets a value indicating whether to use the message code as - default message instead of throwing a NoSuchMessageException. - Useful for development and debugging. Default is "false". - - -

Note: In case of a IMessageSourceResolvable with multiple codes - (like a FieldError) and a MessageSource that has a parent MessageSource, - do not activate "UseCodeAsDefaultMessage" in the parent: - Else, you'll get the first code returned as message by the parent, - without attempts to check further codes.

-

To be able to work with "UseCodeAsDefaultMessage" turned on in the parent, - AbstractMessageSource contains special checks - to delegate to the internal GetMessageInternal method if available. - In general, it is recommended to just use "UseCodeAsDefaultMessage" during - development and not rely on it in production in the first place, though.

-

Alternatively, consider overriding the GetDefaultMessage - method to return a custom fallback message for an unresolvable code.

-
- - true if use the message code as default message instead of - throwing a NoSuchMessageException; otherwise, false. - -
- - - The parent message source used to try and resolve messages that - this object can't resolve. - - - -

- If the value of this property is then no - further resolution is possible. -

-
-
- - - Convenient abstract superclass for - implementations that - draw their configuration from XML documents containing object - definitions as understood by an - . - - Rod Johnson - Juergen Hoeller - Griffin Caprio (.NET) - - - - The instance for this class. - - - - - Creates a new instance of the - - class. - - -

- This is an class, and as such exposes - no public constructors. -

-
-
- - - Creates a new instance of the - class - with the given parent context. - - -

- This is an class, and as such exposes - no public constructors. -

-
- The application context name. - Flag specifying whether to make this context case sensitive or not. - The parent context. -
- - - Instantiates and populates the underlying - with the object - definitions yielded up by the - method. - - - In the case of errors encountered while refreshing the object factory. - - - In the case of errors encountered reading any of the resources - yielded by the method. - - - - - - Initialize the object definition reader used for loading the object - definitions of this context. - - -

- The default implementation of this method is a no-op; i.e. it does - nothing. Can be overridden in subclasses to provide custom - initialization of the supplied - ; for example, a derived - class may want to turn off XML validation. -

-
- - The object definition reader used by this context. - -
- - - Load the object definitions with the given - . - - -

- The lifecycle of the object factory is handled by - ; - therefore this method is just supposed to load and / or register - object definitions. -

-
- - The reader containing object definitions. - - In case of object registration errors. - - - In the case of errors encountered reading any of the resources - yielded by the method. - -
- - - Loads the object definitions into the given object factory, typically through - delegating to one or more object definition readers. - - The object factory to lead object definitions into - - - - - - Customizes the internal object factory used by this context. - - Called for each attempt. -

- The default implementation is empty. Can be overriden in subclassses to customize - DefaultListableBeanFatory's standard settings. -

- The newly created object factory for this context -
- - - Create an internal object factory for this context. - - -

- Called for each attempt. - This default implementation creates a - - with the internal object factory of this context's parent serving - as the parent object factory. Can be overridden in subclasse,s - for example to customize DefaultListableBeanFactory's settings. -

-
- The object factory for this context. -
- - - An array of resource locations, referring to the XML object - definition files that this context is to be built with. - - -

- Examples of the format of the various strings that would be - returned by accessing this property can be found in the overview - documentation of with the - class. -

-
- - An array of resource locations, or if none. - -
- - - Subclasses must return their internal object factory here. - - - The internal object factory for the application context. - - - - - - - implementation that passes the application context to object that - implement the - , - , and - interfaces. - - -

- If an object's class implements more than one of the - , - , and - interfaces, then the - order in which the interfaces are satisfied is as follows... - - - - - - - - - - - -

-

- Application contexts will automatically register this with their - underlying object factory. Applications should thus never need to use - this class directly. -

-
- Juergen Hoeller - Griffin Caprio (.NET) -
- - - Creates a new instance of the - class. - - - The that this - instance will work with. - - - - - Apply this - to the given new object instance before any object - initialization callbacks. - - - The new object instance. - - - The name of the object. - - - The the object instance to use, either the original or a wrapped one. - - - In case of errors. - - - - - - Apply this to the - given new object instance after any object initialization - callbacks. - - - The new object instance. - - - The name of the object. - - - The object instance to use, either the original or a wrapped one. - - - In case of errors. - - - - - - Convenient superclass for application objects that want to be aware of - the application context, e.g. for custom lookup of collaborating object - or for context-specific resource access. - - -

- It saves the application context reference and provides an - initialization callback method. Furthermore, it offers numerous - convenience methods for message lookup. -

-

- There is no requirement to subclass this class: it just makes things - a little easier if you need access to the context, e.g. for access to - file resources or to the message source. Note that many application - objects do not need to be aware of the application context at all, - as they can receive collaborating objects via object references. -

-
- Rod Johnson - Juergen Hoeller - Griffin Caprio (.NET) -
- - - To be implemented by any object that wishes to be notified - of the that it runs in. - - -

- Implementing this interface makes sense when an object requires access - to a set of collaborating objects. Note that configuration via object - references is preferable to implementing this interface just for object - lookup purposes. -

-

- This interface can also be implemented if an object needs access to - file resources, i.e. wants to call - , or access to - the . However, it is - preferable to implement the more specific - - interface to receive a reference to the - object in that scenario. -

-

- Note that dependencies can also - be exposed as object properties of the - type, populated via strings with - automatic type conversion performed by an object factory. This obviates - the need for implementing any callback interface just for the purpose - of accessing a specific file resource. -

-

- - is a convenience implementation of this interface for your - application objects. -

-

- For a list of all object lifecycle methods, see the overview for the - interface. -

-
- Rod Johnson - Mark Pollack (.NET) - - - -
- - - Sets the that this - object runs in. - - -

- Normally this call will be used to initialize the object. -

-

- Invoked after population of normal object properties but before an - init callback such as - 's - - or a custom init-method. Invoked after the setting of any - 's - - property. -

-
- - In the case of application context initialization errors. - - - If thrown by any application context methods. - - -
- - - Creates a new instance of the - class. - - -

- This is an class, and as such exposes no - public constructors. -

-
-
- - - Creates a new instance of the - class. - - -

- This is an class, and as such exposes no - public constructors. -

-
- - The that this - object runs in. - -
- - - Intializes the wrapped - . - - -

- This is a template method that subclasses can override for custom - initialization behavior. -

-

- Gets called by the - - instance directly after setting the context instance. -

- - Does not get called on reinitialization of the context. - -
- - In the case of any initialization errors. - - - If thrown by application context methods. - -
- - - The context class that any context passed to the - - must be an instance of. - - - The - . - - - - - Return a for the - application context used by this object, for easy message access. - - - - - Gets or sets the that this - object runs in. - - - When passed an unexpected - implementation - instance that is not compatible with the - defined by the value of the - . - property. Also, thrown when trying to re-initialize with a - different than was - originally used. - - - If thrown by any application context methods. - - - - - - - Creates an instance - using context definitions supplied in a custom configuration and - configures the with that instance. - - - Implementations of the - interface must provide the following two constructors: - - - - A constructor that takes a string array of resource locations. - - - - - A constructor that takes a reference to a parent application context - and a string array of resource locations (and in that order). - - - -

- Note that if the type attribute is not present in the declaration - of a particular context, then a default - - is assumed. This default - - is currently the - ; please note the exact - of this default is an - implementation detail, that, while unlikely, may do so in the future. - to -

-
- -

- This is an example of specifying a context that reads its resources from - an embedded Spring.NET XML object configuration file... -

- - - - -
- - - - - - - - - -

- This is an example of specifying a context that reads its resources from - a custom configuration section within the same application / web - configuration file and uses case insensitive object lookups. -

-

- Please note that you must adhere to the naming - of the various sections (i.e. '<sectionGroup name="spring">' and - '<section name="context">'. -

- - - - -
-
- - - - - - - - - - - - -

- And this is an example of specifying a hierarchy of contexts. The - hierarchy in this case is only a simple parent->child hierarchy, but - hopefully it illustrates the nesting of context configurations. This - nesting of contexts can be arbitrarily deep, and is one way... child - contexts know about their parent contexts, but parent contexts do not - know how many child contexts they have (if any), or have references - to any such child contexts. -

- - - - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mark Pollack - Aleksandar Seovic - Rick Evans - - - - - Creates an instance - using the context definitions supplied in a custom - configuration section. - - -

- This instance is - also used to configure the . -

-
- - The configuration settings in a corresponding parent - configuration section. - - - The configuration context when called from the ASP.NET - configuration system. Otherwise, this parameter is reserved and - is . - - - The for the section. - - - An instance - populated with the object definitions supplied in the configuration - section. - -
- - - Create all child-contexts in the given for the given context. - - The parent context to use - The current configContext - The list of child context elements - - - - Instantiates a new context. - - - - - Gets the context's name specified in the name attribute of the context element. - - The current configContext - The context element - - - - Extracts the context-type from the context element. - If none is specified, returns the parent's type. - - - - - Extracts the case-sensitivity attribute from the context element - - - - - Gets the context specified in the type - attribute of the context element. - - -

- If this attribute is not defined it defaults to the - type. -

-
- - If the context type does not implement the - interface. - -
- - - Returns the array of resources containing object definitions for - this context. - - - - - Returns the array of child contexts for this context. - - - - - The of - created if no type attribute is specified on a context element. - - - - - - Get the context's case-sensitivity to use if none is specified - - -

- Derived handlers may override this property to change their default case-sensitivity. -

-

- Defaults to 'true'. -

-
-
- - - Returns if the context should be lazily - initialized. - - - - - Constants defining the structure and values associated with the - schema for laying out Spring.NET contexts in XML. - - - - - Defines a single - . - - - - - Specifies a context name. - - - - - Specifies if context should be case sensitive or not. Default is true. - - - - - Specifies a . - - -

- Does not have to be fully assembly qualified, but its generally regarded - as better form if the names of one's objects - are specified explicitly. -

-
-
- - - Specifies whether context should be lazy initialized. - - - - - Defines an - - - - - Specifies the URI for an - . - - - - - Provides access to a central registry of - s. - - -

- A singleton implementation to access one or more application contexts. Application - context instances are cached. -

-

Note that the use of this class or similar is unnecessary except (sometimes) for - a small amount of glue code. Excessive usage will lead to code that is more tightly - coupled, and harder to modify or test. Consider refactoring your code to use standard - Dependency Injection techniques or implement the interface IApplicationContextAware to - obtain a reference to an application context.

-
- Mark Pollack - Aleksandar Seovic - -
- - - The shared instance for this class (and derived classes). - - - - - Creates a new instance of the ContextRegistry class. - - -

- Explicit static constructor to tell C# compiler - not to mark type as beforefieldinit. -

-
-
- - - Registers an instance of an - . - - -

- This is usually called via a - inside a .NET - application configuration file. -

-
- The application context to be registered. - - If a context has previously been registered using the same name - -
- - - Returns the root application context. - - -

- The first call to GetContext will create the context - as specified in the .NET application configuration file - under the location spring/context. -

-
- The root application context. -
- - - Returns context based on specified name. - - -

- The first call to GetContext will create the context - as specified in the .NET application configuration file - under the location spring/context. -

-
- The context name. - The specified context, or null, if context with that name doesn't exists. - - If the context name is null or empty - -
- - - Removes all registered - s from this - registry. - - - Raises the event while still holding a lock on - - - - - Allows to check, if a context is already registered - - The context name. - true, if the context is already registered. false otherwise - - - - This event is fired, if ContextRegistry.Clear() is called.
- Clients may register to get informed -
- - This event is fired while still holding a lock on the Registry.
- 'sender' parameter is sent as typeof(ContextRegistry), EventArgs are not used -
-
- - - Gets an object that should be used to synchronize access to ContextRegistry - from the calling code. - - - - - Default implementation of the - interface. - - -

- Provides easy ways to store all the necessary values needed to resolve - messages from an . -

-
- Juergen Hoeller - Griffin Caprio (.NET) - -
- - - Describes objects that are suitable for message resolution in a - . - - -

- Spring.NET's own validation error classes implement this interface. -

-
- Juergen Hoeller - Mark Pollack (.NET) - - -
- - - Return the codes to be used to resolve this message, in the order - that they are to be tried. - - -

- The last code will therefore be the default one. -

-
- - A array of codes which are associated - with this message. - -
- - - Return the array of arguments to be used to resolve this message. - - - An array of objects to be used as parameters to replace - placeholders within the message text. - - - - - Return the default message to be used to resolve this message. - - - The default message, or if there is no - default. - - - - - Creates a new instance of the - class - using a single code. - - The message code to be resolved. - - - - Initializes a new instance of the class. - - The codes to be used to resolve this message - - - - Creates a new instance of the - class - using multiple codes. - - The message codes to be resolved. - - The arguments used to resolve the supplied . - - - - - Creates a new instance of the - class - using multiple codes and a default message. - - The message codes to be resolved. - - The arguments used to resolve the supplied . - - - The default message used if no code could be resolved. - - - - - Creates a new instance of the - class - from another resolvable. - - -

- This is the copy constructor for the - class. -

-
- - The to be copied. - - - If the supplied is . - -
- - - Returns a representation of this - . - - - A representation of this - . - - - - - Calls the visit method on the supplied - to output a version of this class. - - The visitor to use. - - A representation of this - . - - - - - Return the codes to be used to resolve this message, in the order - that they are to be tried. - - - A array of codes which are associated - with this message. - - - - - - Return the array of arguments to be used to resolve this message. - - - An array of objects to be used as parameters to replace - placeholders within the message text. - - - - - - Return the default code for this resolvable. - - - The default code of this resolvable; this will be the last code in - the codes array, or if this instance has no - codes. - - - - - - Return the default message to be used to resolve this message. - - - The default message, or if there is no - default. - - - - - - Default section handler that can handle any configuration section. - - -

- Simply returns the configuration section as an . -

-
- Aleksandar Seovic -
- - - Returns the configuration section as an - - - The configuration settings in a corresponding parent - configuration section. - - - The configuration context when called from the ASP.NET - configuration system. Otherwise, this parameter is reserved and - is a null reference. - - - The for the section. - - Config section as XmlElement. - - - - Empty implementation that - simply delegates all method calls to it's parent - . - - -

- If no parent is available, - no messages will be resolved (and a - will be thrown). -

-

- Used as placeholder by the - class, - if the context definition doesn't define its own - . Not intended for direct use - in applications. -

-
- Juergan Hoeller - Rick Evans (.NET) - -
- - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The parent message source used to try and resolve messages that - this object can't resolve. - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If the message could not be resolved. - - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If the message could not be resolved. - - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - - The that represents - the culture for which the resource is localized. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If the message could not be resolved. - - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - - The that represents - the culture for which the resource is localized. - - - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If the message could not be resolved. - - - - - - Resolve the message identified by the supplied - . - - The name of the message to resolve. - The default message. - - The that represents - the culture for which the resource is localized. - - - The array of arguments that will be filled in for parameters within - the message, or if there are no parameters - within the message. Parameters within a message should be - referenced using the same syntax as the format string for the - method. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If the message could not be resolved. - - - - - - Resolve the message using all of the attributes contained within - the supplied - argument. - - - The value object storing those attributes that are required to - properly resolve a message. - - - The that represents - the culture for which the resource is localized. - - - The resolved message if the lookup was successful (see above for - the return value in the case of an unsuccessful lookup). - - - If the message could not be resolved. - - - If the message could not be resolved. - - - - - - Gets a localized resource object identified by the supplied - . - - - The name of the resource object to resolve. - - - The resolved object, or if not found. - - - - - - Gets a localized resource object identified by the supplied - . - - - The name of the resource object to resolve. - - - The with which the - resource is associated. - - - The resolved object, or if not found. - - - - - - Applies resources to object properties. - - - An object that contains the property values to be applied. - - - The base name of the object to use for key lookup. - - - The with which the - resource is associated. - - - - - - The parent message source used to try and resolve messages that - this object can't resolve. - - - - - - Generic ApplicationContext implementation that holds a single internal - instance and does not - assume a specific object definition format. - - - Implements the interface in order - to allow for aplying any object definition readers to it. - Typical usage is to register a variety of object definitions via the - interface and then call - to initialize those - objects with application context semantics (handling - , auto-detecting - ObjectFactoryPostProcessors, etc). - - In contrast to other IApplicationContext implementations that create a new internal - IObjectFactory instance for each refresh, the internal IObjectFactory of this context - is available right from the start, to be able to register object definitions on it. - may only be called once - Usage examples - - GenericApplicationContext ctx = new GenericApplicationContext(); - - - - Mark Pollack - - - - Interface for registries that hold object definitions, i.e. - - and - - instances. - - -

- Typically implemented by object factories that work with the - - hierarchy internally. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Return the names of all objects defined in this registry. - - - The names of all objects defined in this registry, or an empty array - if none defined - - - - - Check if this registry contains a object definition with the given name. - - - The name of the object to look for. - - - True if this object factory contains an object definition with the - given name. - - - - - Returns the - - for the given object name. - - - The name of the object to find a definition for. - - - The for - the given name (never null). - - - If the object definition cannot be resolved. - - - In case of errors. - - - - - Register a new object definition with this registry. - Must support - - and . - - - The name of the object instance to register. - - - The definition of the object instance to register. - - -

- Must support - and - . -

-
- - If the object definition is invalid. - -
- - - Return the aliases for the given object name, if defined. - - the object name to check for aliases - - -

- Will ask the parent factory if the object cannot be found in this - factory instance. -

-
- - The aliases, or an empty array if none. - - - If there's no such object definition. - -
- - - Given a object name, create an alias. We typically use this method to - support names that are illegal within XML ids (used for object names). - - - The name of the object. - - - The alias that will behave the same as the object name. - - - If there is no object with the given name. - - - If the alias is already in use. - - - - - Return the number of objects defined in the registry. - - - The number of objects defined in the registry. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - if set to true names in the context are case sensitive. - - - - Initializes a new instance of the class. - - The object factory instance to use for this context. - - - - Initializes a new instance of the class. - - The parent application context. - - - - Initializes a new instance of the class. - - The name of the application context. - if set to true names in the context are case sensitive. - The parent application context. - - - - Initializes a new instance of the class. - - The object factory to use for this context - The parent applicaiton context. - - - - Do nothing operation. We hold a single internal ObjectFactory and rely on callers - to register objects throug our public methods (or the ObjectFactory's). - - - In the case of errors encountered while refreshing the object factory. - - - - - Returns the - - for the given object name. - - The name of the object to find a definition for. - - The for - the given name (never null). - - - If the object definition cannot be resolved. - - - In case of errors. - - - - - Register a new object definition with this registry. - Must support - - and . - - The name of the object instance to register. - The definition of the object instance to register. - -

- Must support - and - . -

-
- - If the object definition is invalid. - -
- - - Given a object name, create an alias. We typically use this method to - support names that are illegal within XML ids (used for object names). - - The name of the object. - The alias that will behave the same as the object name. - - If there is no object with the given name. - - - If the alias is already in use. - - - - - Gets the parent context, or if there is no - parent context. Set the parent of this application context also setting - the parent of the interanl ObjectFactory accordingly. - - The parent context - - The parent context, or if there is no - parent. - - - - - - Return the internal object factory of this application context. - - - - - - Gets the underlying object factory of this context, available for - registering object definitions. - - You need to call Refresh to initialize the - objects factory and its contained objects with application context - semantics (autodecting IObjectFactoryPostProcessors, etc). - The internal object factory (as DefaultListableObjectFactory). - - - - Helper class for easy access to messages from an - , providing various - overloaded GetMessage methods. - - -

- Available from - , but also - reusable as a standalone helper to delegate to in application objects. -

-
- Juergen Hoeller - Griffin Caprio (.NET) - - -
- - - Creates a new instance of the - class - that uses the current - for all locale specific lookups. - - - The to use to locate messages. - - - - - Creates a new instance of the - class - - - The to use to locate - messages. - - - The to use for - locale specific messages. - - - - - Retrieve the message for the given code and the default - . - - The code of the message. - The message. - - - - Retrieve the message for the given code and the given - . - - The code of the message. - - The to use for - lookups. - - The message. - - - - Retrieve the message for the given code and the default - . - - The code of the message. - - The arguments for the message, or if none. - - The message. - - If the message could not be found. - - - - - Retrieve the message for the given code and the given - . - - The code of the message. - - The to use for - lookups. - - - The arguments for the message, or if none. - - The message. - - If the message could not be found. - - - - - Retrieve a mesage using the given - . - - - The . - - The message. - - If the message could not be found. - - - - - Retrieve a mesage using the given - in the given - . - - - The . - - - The to use for - lookups. - - The message - - If the message could not be found. - - - - - Visitor class to represent - instances. - - -

- Used in the first instance to supply stringified versions of - instances. -

-

- Other methods can be added here to return different representations, - including XML, CSV, etc.. -

-
- Griffin Caprio (.NET) -
- - - Creates a new instance of the - class. - - - - - Outputs the supplied - as a nicely formatted . - - - The to output. - - - - - Configuration section handler for the (recommended, Spring.NET standard) parsers - config section. - - -

- Spring.NET allows the registration of custom configuration parsers that - can be used to create simplified configuration schemas that better - describe object definitions. -

-

- For example, Spring.NET uses this facility internally in order to - define simplified schemas for various AOP, Data and Services definitions. -

-
- -

- The following example shows how to configure both this section handler - and how to define custom configuration parsers within a Spring.NET - config section. -

- - - - -
- - - - - - - ... - - ... - - - - - Aleksandar Seovic - - - - - Registers parsers specified in the (recommended, Spring.NET standard) - parsers config section with the . - - - The configuration settings in a corresponding parent - configuration section. - - - The configuration context when called from the ASP.NET - configuration system. Otherwise, this parameter is reserved and - is . - - - The for the section. - - - This method always returns , because parsers - are registered as a side-effect of this object's execution and there - is thus no need to return anything. - - - - - An that doesn't do a whole lot. - - -

- is an implementation of - the NullObject pattern. It should be used in those situations where a - needs to be passed (say to a - method) but where the resolution of messages is not required. -

-

- There should not (typically) be a need to instantiate instances of this class; - does not maintan any state - and the instance is - thus safe to pass around. -

-
- Aleksandar Seovic -
- - - The canonical instance of the - class. - - - - - Creates a new instance of the class. - - -

- Consider using - instead. -

-
-
- - - Simply returns the supplied message as-is. - - The code of the message to resolve. - - The to resolve the - code for. - - - The supplied message as-is. - - - - - Always returns . - - The code of the object to resolve. - - The to resolve the - code for. - - - (always). - - - - - Does nothing. - - - An object that contains the property values to be applied. - - - The base name of the object to use for key lookup. - - - The with which the - resource is associated. - - - - - Handler for Spring.NET resourceHandlers config section. - - -

- 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 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. -

-
- -

- 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: -

- - - - -
- - - - - - - - - - - - - - Aleksandar Seovic - - - - - Registers resource handlers that are specified in - the resources config section with the . - - - The configuration settings in a corresponding parent - configuration section. Ignored. - - - The configuration context when called from the ASP.NET - configuration system. Otherwise, this parameter is reserved and - is . - - - The for the section. - - - This method always returns null, because resource handlers are registered - as a sideffect of its execution and there is no need to return anything. - - - - - An implementation that - accesses resources from .resx / .resource files. - - Note that for the method - GetResourceObject if the resource name resolves to null, then in - .NET 1.1 the return value will be String.Empty whereas - in .NET 2.0 it will return null. - Griffin Caprio (.NET) - Mark Pollack (.NET) - Aleksandar Seovic (.NET) - - - - Defines a simple initialization callback for objects that need to to some - post-initialization logic after all of their dependencies have been injected. - - -

- An implementation of the - - method might perform some additional custom initialization (over and above that - performed by the constructor), or merely check that all mandatory properties - have been set (this last example is a very typical use case of this interface). -

- - The use of the - interface - by non-Spring.NET framework code can be avoided (and is generally - discouraged). The Spring.NET container provides support for a generic - initialization method given to the object definition in the object - configuration store (be it XML, or a database, etc). This requires - slightly more configuration (one attribute-value pair in the case of - XML configuration), but removes any dependency on Spring.NET from the - class definition. - -
- Rod Johnson - Rick Evans (.NET) - -
- - - Invoked by an - after it has injected all of an object's dependencies. - - -

- This method allows the object instance to perform the kind of - initialization only possible when all of it's dependencies have - been injected (set), and to throw an appropriate exception in the - event of misconfiguration. -

-

- Please do consult the class level documentation for the - interface for a - description of exactly when this method is invoked. In - particular, it is worth noting that the - - and - callbacks will have been invoked prior to this method being - called. -

-
- - In the event of misconfiguration (such as the failure to set a - required property) or if initialization fails. - -
- - - Creates a new instance of the - class. - - - - - Resolves a given code by searching through each assembly name in - the base names array. - - The code to resolve. - - The to use for lookups. - - The message from the resource set. - - - - Resolves a given code by searching through each assembly name in the array. - - The code to resolve. - - The to use for lookups. - - The object from the resource set. - - - - Uses a System.ComponentModel.ComponentResourceManager - to apply resources to object properties. - Resource key names are of the form objectName.propertyName - - - This feature is not currently supported on version 1.0 of the .NET platform. - - - An object that contains the property values to be applied. - - - The base name of the object to use for the key lookup. - - - The to use for lookups. - If , uses the - value. - - - This feature is not currently supported on version 1.0 of the .NET platform. - - - - - Resolves a code into an object given a base name. - - The to search. - The code to resolve. - - The to use for lookups. - - The object from the resource file. - - - - Returns a representation of the - . - - A representation of the - . - - - - Invoked by an - after it has set all object properties supplied. - - -

- The list may contain objects of type or - . types - are converted to instances using the notation - resourcename, assembly partial name. -

-
- - If the conversion from a to a - can't be performed. - -
- - - The collection of s - in this . - - - - - that allows concrete registration of - objects and messages in code, rather than from external configuration sources. - - -

- Mainly useful for testing. -

-
- Rod Johnson - Griffin Caprio (.NET) -
- - - Creates a new instance of the StaticApplicationContext class. - - - - - Creates a new instance of the StaticApplicationContext class. - - The parent application context. - - - - Do nothing: we rely on callers to update our public methods. - - - - - Register a singleton object with the default object factory. - - The name of the object. - The of the object. - The property values for the singleton instance. - - - - Registers a prototype object with the default object factory. - - The name of the prototype object. - The of the prototype object. - The property values for the prototype instance. - - - - Associate the given message with the given code. - - The lookup code. - - The that the message should be found within. - - The message associated with the lookup code. - - - - Simple implementation of - that allows messages to be held in an object and added programmatically. - - -

- Mainly useful for testing. -

-

- This supports internationalization. -

-
- Rod Johnson - Juergen Hoeller - Griffin Caprio (.NET) - -
- - - Creates a new instance of the - class. - - - - - Returns a format string. - - The code of the message to resolve. - - The to resolve the - code for. - - - A format string or if not found. - - - - - - Resolves an object (typically an icon or bitmap). - - The code of the object to resolve. - - The to resolve the - code for. - - - The resolved object or if not found. - - - - - - Applies resources to object properties. - - -

- Uses a System.ComponentModel.ComponentResourceManager - internally to apply resources to object properties. Resource key - names are of the form objectName.propertyName. -

-

- This feature is not currently supported on version 1.0 of the .NET platform. -

-
- - An object that contains the property values to be applied. - - - The base name of the object to use for key lookup. - - - The with which the - resource is associated. - - - This feature is not currently supported on version 1.0 of the .NET platform. - - -
- - - Associate the supplied with the - supplied . - - The lookup code. - - The to resolve the - code for. - - - The message format associated with this lookup code. - - - - - Associate the supplied with the - supplied . - - The lookup code. - - The to resolve the - code for. - - - The object associated with this lookup code. - - - - - Returns a representation of this - message source. - - - A containing all of this message - source's messages. - - - - - Configuration section handler for the Spring.NET typeAliases - config section. - - -

- Type aliases can be used instead of fully qualified type names anywhere - a type name is expected in a Spring.NET configuration file. -

-

- This includes type names specified within an object definition, as well - as values of the properties or constructor arguments that expect - instances. -

-
- -

- The following example shows how to configure both this section handler and - how to define type aliases within a Spring.NET config section: -

- - - - -
- - - - - - - ... - - ... - - - - - Aleksandar Seovic - - - - - Populates using values specified in - the typeAliases config section. - - - The configuration settings in a corresponding parent - configuration section. - - - The configuration context when called from the ASP.NET - configuration system. Otherwise, this parameter is reserved and - is . - - - The for the section. - - - This method always returns , because the - is populated as a side-effect of this - object's execution and thus there is no need to return anything. - - - - - Configuration section handler for the Spring.NET typeConverters - config section. - - -

- Type converters are used to convert objects from one type into another - when injecting property values, evaluating expressions, performing data - binding, etc. -

-

- They are a very powerful mechanism as they allow Spring.NET to automatically - convert string-based property values from the configuration file into the appropriate - type based on the target property's type or to convert string values submitted - via a web form into a type that is used by your data model when Spring.NET data - binding is used. Because they offer such tremendous help, you should always provide - a type converter implementation for your custom types that you want to be able to use - for injected properties or for data binding. -

-

- The standard .NET mechanism for specifying type converter for a particular type is - to decorate the type with a , passing the type - of the -derived class as a parameter. -

-

- This mechanism will still work and is a preferred way of defining type converters if - you control the source code for the type that you want to define a converter for. However, - this configuration section allows you to specify converters for the types that you don't - control and it also allows you to override some of the standard type converters, such as - the ones that are defined for some of the types in the .NET Base Class Library. -

-
- -

- The following example shows how to configure both this section handler and - how to define type converters within a Spring.NET config section: -

- - - - -
- - - - - - - ... - - ... - - - - - Aleksandar Seovic - - - - - Populates using values specified in - the typeConverters config section. - - - The configuration settings in a corresponding parent - configuration section. - - - The configuration context when called from the ASP.NET - configuration system. Otherwise, this parameter is reserved and - is . - - - The for the section. - - - This method always returns , because the - is populated as a side-effect of - its execution and thus there is no need to return anything. - - - - - An implementation that - reads context definitions from XML based resources. - - -

- Currently, the resources that are supported are the file, - http, ftp, config and assembly resource - types. -

-

- You can provide custom implementations of the - interface and and register them - with any that inherits - from the - - interface. -

- - In case of multiple config locations, later object definitions will - override ones defined in previously loaded resources. This can be - leveraged to deliberately override certain object definitions via an - extra XML file. - -
- -

- Find below some examples of instantiating an - using a - variety of different XML resources. -

- - // an XmlApplicationContext that reads its object definitions from an - // XML file that has been embedded in an assembly... - IApplicationContext context = new XmlApplicationContext - ( - "assembly://AssemblyName/NameSpace/ResourceName" - ); - - // an XmlApplicationContext that reads its object definitions from a - // number of disparate XML resources... - IApplicationContext context = new XmlApplicationContext - ( - // from an XML file that has been embedded in an assembly... - "assembly://AssemblyName/NameSpace/ResourceName", - // and from a (relative) filesystem-based resource... - "file://Objects/services.xml", - // and from an App.config / Web.config resource... - "config://spring/objects" - ); - -
- Rod Johnson - Juergen Hoeller - Griffin Caprio (.NET) - - - -
- - - Creates a new instance of the - class, - loading the definitions from the supplied XML resource locations. - - The created context will be case sensitive. - - Any number of XML based object definition resource locations. - - - - - Creates a new instance of the - class, - loading the definitions from the supplied XML resource locations. - - Flag specifying whether to make this context case sensitive or not. - - Any number of XML based object definition resource locations. - - - - - Creates a new instance of the - class, - loading the definitions from the supplied XML resource locations. - - The application context name. - Flag specifying whether to make this context case sensitive or not. - - Any number of XML based object definition resource locations. - - - - - Creates a new instance of the - class, - loading the definitions from the supplied XML resource locations, - with the given . - - - The parent context (may be ). - - - Any number of XML based object definition resource locations. - - - - - Creates a new instance of the - class, - loading the definitions from the supplied XML resource locations, - with the given . - - Flag specifying whether to make this context case sensitive or not. - - The parent context (may be ). - - - Any number of XML based object definition resource locations. - - - - - Creates a new instance of the - class, - loading the definitions from the supplied XML resource locations, - with the given . - - The application context name. - Flag specifying whether to make this context case sensitive or not. - - The parent context (may be ). - - - Any number of XML based object definition resource locations. - - - - - Creates a new instance of the - class, - loading the definitions from the supplied XML resource locations, - with the given . - - - This constructor is meant to be used by derived classes. By passing =false, it is - the responsibility of the deriving class to call to initialize the context instance. - - if true, is called automatically. - The application context name. - Flag specifying whether to make this context case sensitive or not. - - The parent context (may be ). - - - Any number of XML based object definition resource locations. - - - - - An array of resource locations, referring to the XML object - definition files that this context is to be built with. - - - An array of resource locations, or if none. - - - - - Exception thrown during application context initialization. - Rod Johnson - Mark Pollack (.NET) - - - - Thrown on an unrecoverable problem encountered in the - objects namespace or sub-namespaces, e.g. bad class or field. - - Rod Johnson - Mark Pollack (.NET) - - - - Superclass for all exceptions thrown in the Objects namespace and sub-namespaces. - - Rod Johnson - Mark Pollack (.NET) - - - Creates a new instance of the ObjectsException class. - - - - Creates a new instance of the ObjectsException class. with the specified message. - - - A message about the exception. - - - - - Creates a new instance of the ObjectsException class with the specified message - and root cause. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ObjectsException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Creates a new instance of the FatalObjectException class. - - - - - Creates a new instance of the FatalObjectException class with the - specified message. - - - A message about the exception. - - - - - Creates a new instance of the FatalObjectException class with the - specified message. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the FatalObjectException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Creates a new instance of the - class with the - specified message. - - - A message about the exception. - - - - - Creates a new instance of the - class with the - specified message. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Marks an interface as being an application event listener. - - Griffin Caprio - - - - - Creates a new instance of the - class. - - - - - The callback for application events. - - - - - To be implemented by any object that wishes to be notified - of the associated with it. - - -

- In the current implementation, the - will typically be the - associated that - spawned the implementing object. -

-

- The can usually also be - passed on as an object reference to arbitrary object properties or - constructor arguments, because a - is typically defined as an - object with the well known name "messageSource" in the - associated application context. -

-
- Juergen Hoeller - Rick Evans (.NET) - -
- - - Sets the associated - with this object. - - -

- Invoked after population of normal object properties but - before an initializing callback such as the - - method of the - interface - or a custom init-method. -

-

- It is also invoked before the - - property of any - - implementation. -

-
- - The associated - with this object. - -
- - - Interface to be implemented by any object that wishes to be notified - of the (typically the - ) that it runs in. - - -

- Note that dependencies can also - be exposed as object properties of type - , populated via strings with - automatic type conversion by the object factory. This obviates the - need for implementing any callback interface just for the purpose of - accessing a specific resource. -

-

- You typically need an - when your application object has to access a variety of file resources - whose names are calculated. A good strategy is to make the object use - a default resource loader but still implement the - interface to allow - for overriding when running in an - . -

-
- Juergen Hoeller - Mark Pollack (.NET) - - - -
- - - Sets the - that this object runs in. - - -

- Invoked after population of normal objects properties but - before an init callback such as - 's - - or a custom init-method. Invoked before setting - 's - - property. -

-
-
- - - Thrown when a message cannot be resolved. - - Rod Johnson - Mark Pollack (.NET) - - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class with the - specified message. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being - thrown. - - - The - that contains contextual information about the source or - destination. - - - - - Creates a new instance of the - class. - - - The code that could not be resolved for given culture. - - - The that was used - to search for the code. - - - - - Creates a new instance of the - class. - - - The code that could not be resolved for the current UI culture. - - - - - Convenience base class for - implementations, pre-implementing typical behavior. - - -

- The method will - check whether a or - can be opened; - will always return - ; - and - throw an exception; - and will - return the value of the - property. -

-
- Juergen Hoeller - Rick Evans (.NET) - Aleksandar Seovic (.NET) - -
- - - The central abstraction for Spring.NET's access to resources such as - s. - - -

- This interface encapsulates a resource descriptor that abstracts away - from the underlying type of resource; possible resource types include - files, memory streams, and databases (this list is not exhaustive). -

-

- A can definitely be opened and accessed - for every such resource; if the resource exists in a physical form (for - example, the resource is not an in-memory stream or one that has been - extracted from an assembly or ZIP file), a or - can also be accessed. The actual - behavior is implementation-specific. -

-

- This interface, when used in tandem with the - interface, forms the backbone of - Spring.NET's resource handling. Third party extensions or libraries - that want to integrate external resources with Spring.NET's IoC - container are encouraged expose such resources via this abstraction. -

-

- Interfaces cannot obviously mandate implementation, but derived classes - are strongly encouraged to expose a constructor that takes a - single as it's sole argument (see example). - Exposing such a constructor will make your custom - implementation integrate nicely - with the class. -

-
- Juergen Hoeller - Rick Evans (.NET) - - -
- - - Simple interface for objects that are sources for - s. - - -

- This is the base interface for the abstraction encapsulated by - Spring.NET's interface. -

-
- Juergen Hoeller - Rick Evans (.NET) - -
- - - Return an for this resource. - - - - Clients of this interface must be aware that every access of this - property will create a fresh ; - it is the responsibility of the calling code to close any such - . - - - - An . - - - If the stream could not be opened. - - - - - Creates a resource relative to this resource. - - - The path (always resolved as relative to this resource). - - - The relative resource. - - - If the relative resource could not be created from the supplied - path. - - - If the resource does not support the notion of a relative path. - - - - - Does this resource represent a handle with an open stream? - - -

- If , the - cannot be read multiple times, and must be read and then closed to - avoid resource leaks. -

-

- Will be for all usual resource descriptors. -

-
- - if this resource represents a handle with an - open stream. - - -
- - - Returns the handle for this resource. - - -

- For safety, always check the value of the - property prior to - accessing this property; resources that cannot be exposed as - a will typically return - from a call to the - property. -

-
- - The handle for this resource. - - - If the resource is not available or cannot be exposed as a - . - - - -
- - - Returns a handle for this resource. - - -

- For safety, always check the value of the - property prior to - accessing this property; resources that cannot be exposed as - a will typically return - from a call to the - property. -

-
- - The handle for this resource. - - - If the resource is not available on a filesystem, or cannot be - exposed as a handle. - - - -
- - - Returns a description for this resource. - - -

- The description is typically used for diagnostics and other such - logging when working with the resource. -

-

- Implementations are also encouraged to return this value from their - method. -

-
- - A description for this resource. - -
- - - Does this resource actually exist in physical form? - - -

- An example of a resource that physically exists would be a - file on a local filesystem. An example of a resource that does not - physically exist would be an in-memory stream. -

-
- - if this resource actually exists in physical - form (for example on a filesystem). - - - -
- - - The default special character that denotes the base (home, or root) - path. - - -

- Will be resolved (by those - implementations that support it) to the home (or root) path for - the specific implementation. -

-

- For example, in the case of a web application this will (probably) - resolve to the virtual directory of said web application. -

-
-
- - - Creates a new instance of the - class. - - -

- This is an class, and as such exposes no - public constructors. -

-
-
- - - Creates a new instance of the - class. - - -

- This is an class, and as such exposes no - public constructors. -

-
- - A string representation of the resource. - - - If the supplied is - or contains only whitespace character(s). - -
- - - Strips any protocol name from the supplied - . - - -

- If the supplied does not - have any protocol associated with it, then the supplied - will be returned as-is. -

-
- - - GetResourceNameWithoutProtocol("http://www.mycompany.com/resource.txt"); - // returns www.mycompany.com/resource.txt - - - - The name of the resource. - - - The name of the resource without the protocol name. - -
- - - Resolves the supplied to its value - sans any leading protocol. - - - The name of the resource. - - - The name of the resource without the protocol name. - - - - - - Resolves the presence of the - value - in the supplied into a path. - - -

- The default implementation simply returns the supplied - as is. -

-
- - The name of the resource. - - - The string that is a placeholder for a base path. - - - The name of the resource with any - value having been resolved into an actual path. - -
- - - This implementation returns the - of this resource. - - - - - - Determines whether the specified is - equal to the current . - - -

- This implementation compares values. -

-
- -
- - - Serves as a hash function for a particular type, suitable for use - in hashing algorithms and data structures like a hash table. - - -

- This implementation returns the hashcode of the - property. -

-
- -
- - - Factory Method. Create a new instance of the current resource type using the given resourceName - - - - - The ResourceLoader to be used for resolving relative resources - - - - - Does the supplied relative ? - - - The name of the resource to test. - - - if resource name is relative; - otherwise . - - - - - Creates a new resource that is relative to this resource based on the - supplied . - - -

- This method can accept either a fully qualified resource name or a - relative resource name as it's parameter. -

-

- A fully qualified resource is one that has a protocol prefix and - all elements of the resource name. All other resources are treated - as relative to this resource, and the following rules are used to - locate a relative resource: -

- - - If the starts with '..', - the current resource path is navigated backwards before the - is concatenated to the current - of - this resource. - - - If the starts with '/', the - current resource path is ignored and a new resource name is - appended to the - of - this resource. - - - If the starts with '.' or a - letter, a new path is appended to the current - of - this resource. - - -
- - The name of the resource to create. - - The relative resource. - - If the process of resolving the relative resource yielded an - invalid URI. - - - If this resource does not support the resolution of relative - resources (as determined by the value of the - - property). - - -
- - - Calculates a new resource path based on the supplied - . - - - The relative path to evaluate. - - The newly calculated resource path. - - - - The special character that denotes the base (home, or root) - path. - - -

- Will be resolved (by those - implementations that support it) to the home (or root) path for - the specific implementation. -

-

- For example, in the case of a web application this will (probably) - resolve to the virtual directory of said web application. -

-
- -
- - - Return an for this resource. - - - An . - - - If the stream could not be opened. - - - - - - Returns a description for this resource. - - - A description for this resource. - - - - - - Returns the protocol associated with this resource (if any). - - -

- The value of this property may be if no - protocol is associated with the resource type (for example if the - resource is a memory stream). -

-
- - The protocol associated with this resource (if any). - -
- - - Does this resource represent a handle with an open stream? - - -

- This, the default implementation, always returns - . -

-
- - if this resource represents a handle with an - open stream. - - -
- - - Returns the handle for this resource. - - - - - - Returns a handle for this resource. - - -

- This, the default implementation, always throws a - , assuming that the - resource cannot be resolved to an absolute file path. -

-
- - The handle for this resource. - - - This implementation always throws a - . - - - -
- - - Does this resource actually exist in physical form? - - -

- This implementation checks whether a - can be opened, falling back to whether a - can be opened. -

-

- This will cover both directories and content resources. -

-

- This implementation will also return if - permission to the (file's) path is denied. -

-
- - if this resource actually exists in physical - form (for example on a filesystem). - - - -
- - - Does this support relative - resource retrieval? - - -

- This property is generally to be consulted prior to attempting - to attempting to access a resource that is relative to this - resource (via a call to - ). -

-

- This, the default implementation, always returns - . -

-
- - if this - supports relative resource - retrieval. - -
- - - Gets the root location of the resource. - - -

- Where root resource can be taken to mean that part of the resource - descriptor that doesn't change when a relative resource is looked - up. Examples of such a root location would include a drive letter, - a web server name, an assembly name, etc. -

-
- - The root location of the resource. - - - This, the default implementation, always throws a - . - -
- - - Gets the current path of the resource. - - -

- An example value of this property would be the name of the - directory containing a filesystem based resource. -

-
- - The current path of the resource. - - - This, the default implementation, always throws a - . - -
- - - Gets those characters that are valid path separators for the - resource type. - - -

- An example value of this property would be the - and - values for a - filesystem based resource. -

-

- Any derived classes that override this method are expected to - return a new array for each access of this property. -

-
- - Those characters that are valid path separators for the resource - type. - - - This, the default implementation, always throws a - . - -
- - - An implementation for - resources stored within assemblies. - - -

- This implementation expects any resource name passed to the - constructor to adhere to the following format: -

-

- assembly://assemblyName/namespace/resourceName -

-
- Aleksandar Seovic (.NET) - Federico Spinazzi (.NET) -
- - - Creates a new instance of the - class. - - - The name of the assembly resource. - - - If the supplied did not conform - to the expected format. - - - If the assembly specified in the supplied - was loaded twice with two - different evidences. - - - If the assembly specified in the supplied - could not be found. - - - If the caller does not have the required permission to load - the assembly specified in the supplied - . - - - - - - Does the supplied relative ? - - - The name of the resource to test. - - - if resource name is relative; - otherwise . - - - - - Return an for this resource. - - - An . - - - If the stream could not be opened. - - - If the caller does not have the required permission to load - the underlying assembly's manifest. - - - - - - - Does the embedded resource specified in the value passed to the - constructor exist? - - - if this resource actually exists in physical - form (for example on a filesystem). - - - - - - - - Does this support relative - resource retrieval? - - -

- This implementation does support relative resource retrieval, and - so will always return . -

-
- - if this - supports relative resource - retrieval. - - -
- - - Gets the root location of the resource (the assembly name in this - case). - - - The root location of the resource. - - - - - - Gets the current path of the resource (the namespace in which the - target resource was embedded in this case). - - - The current path of the resource. - - - - - - Gets those characters that are valid path separators for the - resource type. - - - Those characters that are valid path separators for the resource - type. - - - - - - Returns a description for this resource. - - - A description for this resource. - - - - - - Returns the handle for this resource. - - - - - - Used when retrieving information from the standard .NET configuration - files (App.config / Web.config). - - -

- If created with the name of a configuration section, then all methods - aside from the description return , - , or throw an exception. If created with an - , then the - property - will return a corresponding to parse. -

-
- Mark Pollack - Rick Evans -
- - - Creates new instance of the - class. - - - The actual XML configuration section. - - - If the supplied is . - - - - - Creates new instance of the - class. - - - The name of the configuration section. - - - If the supplied is - or contains only whitespace character(s). - - - - - Returns the handle for this resource. - - -

- This implementation always returns . -

-
- - . - - -
- - - Returns a handle for this resource. - - -

- This implementation always returns . -

-
- - . - - -
- - - Returns a description for this resource (the name of the - configuration section in this case). - - - A description for this resource. - - - - - - Does this resource actually exist in physical form? - - -

- This implementation always returns . -

-
- - - - - -
- - - Return an for this resource. - - - An . - - - If the stream could not be opened. - - - - - - Exposes the actual for the - configuration section. - - -

- Introduced to accomodate line info tracking during parsing. -

-
-
- - - A backed resource. - - -

- Supports resolution as both a and a - . -

-

- Also supports the use of the ~ character. If the ~ character - is the first character in a resource path (sans protocol), the ~ - character will be replaced with the value of the - System.AppDomain.CurrentDomain.BaseDirectory property (an example of - this can be seen in the examples below). -

-
- -

- Consider the example of an application that is running (has been launched - from) the C:\App\ directory. The following resource paths will map - to the following resources on the filesystem... -

- - strings.txt C:\App\strings.txt - ~/strings.txt C:\App\strings.txt - file://~/strings.txt C:\App\strings.txt - file://~/../strings.txt C:\strings.txt - ../strings.txt C:\strings.txt - ~/../strings.txt C:\strings.txt - - // note that only a leading ~ character is resolved to the executing directory... - stri~ngs.txt C:\App\stri~ngs.txt - -
- Juergen Hoeller - Leonardo Susatyo (.NET) - Aleksandar Seovic (.NET) -
- - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The name of the file system resource. - - - If the supplied is - or contains only whitespace character(s). - - - - - Creates a new instance of the - class. - - - The name of the file system resource. - - - Supresses initialization of this instance. Used from derived classes. - - - If the supplied is - or contains only whitespace character(s). - - - - - Initializes this instance. - - - - - - Resolves the handle - for the supplied . - - - The name of the file system resource. - - - The handle for this resource. - - - - - Resolves the root location for the supplied . - - - The name of the file system resource. - - - The root location of the resource. - - - - - Resolves the path for the supplied . - - - The name of the file system resource. - - - The current path of the resource. - - - - - Resolves the presence of the - value - in the supplied into a path. - - - The name of the resource. - - - The string that is a placeholder for a base path. - - - The name of the resource with any - value having been resolved into an actual path. - - - - - Does the supplied relative ? - - - The name of the resource to test. - - - if resource name is relative; - otherwise . - - - - - Returns the underlying handle for - this resource. - - - The handle for this resource. - - - - - - Does this support relative - resource retrieval? - - -

- This implementation does support relative resource retrieval, and - so will always return . -

-
- - if this - supports relative resource - retrieval. - - -
- - - Gets the root location of the resource (a drive or UNC file share - name in this case). - - - The root location of the resource. - - - - - - Gets the current path of the resource. - - - The current path of the resource. - - - - - - Gets those characters that are valid path separators for the - resource type. - - - Those characters that are valid path separators for the resource - type. - - - - - - - Return an for this resource. - - - An . - - - If the stream could not be opened. - - - If the underlying file could not be found. - - - - - - Returns a description for this resource. - - - A description for this resource. - - - - - - Returns the handle for this resource. - - - The handle for this resource. - - - If the resource is not available or cannot be exposed as a - . - - - - - - adapter implementation for a - . - - -

- Should only be used if no other - implementation is applicable. -

-

- In contrast to other - implementations, this is an adapter for an already opened - resource - the - therefore always returns . Do not use this class - if you need to keep the resource descriptor somewhere, or if you need - to read a stream multiple times. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Creates a new instance of the - class. - - - The input to use. - - - Where the input comes from. - - - If the supplied is - . - - - - - The input to use. - - - If the underlying has already - been read. - - - - - Returns a description for this resource. - - - A description for this resource. - - - - - - This implementation always returns true - - - - - This implemementation always returns true - - - - - Custom type converter for instances. - - -

- A resource path may contain placeholder variables of the form ${...} - that will be expended to environment variables. -

-

- Currently only supports conversion from a - instance. -

-
- -

- On Win9x boxes, this resource path, ${userprofile}\objects.xml will - be expanded at runtime with the value of the 'userprofile' environment - variable substituted for the '${userprofile}' portion of the path. -

- - // assuming a user called Rick, running on a plain vanilla Windows XP setup... - // this resource path... - - ${userprofile}\objects.xml - - // will become (after expansion)... - - C:\Documents and Settings\Rick\objects.xml - -
- Mark Pollack - - -
- - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class using the specified resourceLoader. - - the underlying IResourceLoader to be used to resolve resources - - - - Returns whether this converter can convert an object of one - to a - - - A - that provides a format context. - - - A that represents the - you want to convert from. - - - if the conversion is possible. - - - - - Convert from a string value to a - instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - An if successful. - - - If the resource name objectained form the supplied - is malformed. - - - In the case of any errors arising from the instantiation of the - returned instance. - - - - - Resolve the given path, replacing placeholder values with - corresponding property values if necessary. - - -

- This implementation resolves environment variables only. -

-
- The original resource path. - The resolved resource path. -
- - - Return the used to - resolve the string. - - - The used to resolve - the string. - - - - - Registry class that allows users to register and retrieve protocol handlers. - - - - Resource handler is an implementation of interface - that should be used to process resources with the specified protocol. - - - They are used throughout the framework to access resources from various - sources. For example, application context loads object definitions from the resources - that are processed using one of the registered resource handlers. - - Following resource handlers are registered by default: - - - Protocol - Handler Type - Description - - - config - - Resolves the resources by loading specified configuration section from the standard .NET config file. - - - file - - Resolves filesystem resources. - - - http - - Resolves remote web resources. - - - https - - Resolves remote web resources via HTTPS. - - - ftp - - Resolves ftp resources. - - - assembly - - Resolves resources that are embedded into an assembly. - - - web - Spring.Core.IO.WebResource, Spring.Web* - Resolves resources relative to the web application's virtual directory. - - - * only available in web applications. - - Users can create and register their own protocol handlers by implementing interface - and mapping custom protocol name to that implementation. See for details - on how to register custom protocol handler. - - - Aleksandar Seovic - - - - Name of the .Net config section that contains definitions - for custom resource handlers. - - - - - Registers standard and user-configured resource handlers. - - - - - Returns resource handler for the specified protocol name. - - - - This method returns object that should be used - to create an instance of the -derived type by passing - resource location as a parameter. - - - Name of the protocol to get the handler for. - Resource handler constructor for the specified protocol name. - If is null. - - - - Returns true if a handler is registered for the specified protocol, - false otherwise. - - Name of the protocol. - - true if a handler is registered for the specified protocol, false otherwise. - - If is null. - - - - Registers resource handler and maps it to the specified protocol name. - - -

- If the mapping already exists, the existing mapping will be - silently overwritten with the new mapping. -

-
- - The protocol to add (or override). - - - The type name of the concrete implementation of the - interface that will handle - the specified protocol. - - - If the supplied is - or contains only whitespace character(s); or - if the supplied is - . - - - If the supplied is not a - that derives from the - interface; or (having passed - this first check), the supplied - does not expose a constructor that takes a single - parameter. - -
- - - Registers resource handler and maps it to the specified protocol name. - - -

- If the mapping already exists, the existing mapping will be - silently overwritten with the new mapping. -

-
- - The protocol to add (or override). - - - The concrete implementation of the - interface that will handle - the specified protocol. - - - If the supplied is - or contains only whitespace character(s); or - if the supplied is - . - - - If the supplied is not a - that derives from the - interface; or (having passed - this first check), the supplied - does not expose a constructor that takes a single - parameter. - -
- - - Allows to create any arbitrary Url format - - - - - A adapter implementation encapsulating a simple string. - - Erich Eichinger - - - - Creates a new instance of the class. - - - - - Creates a new instance of the class. - - - - - Creates a new instance of the class. - - - - - Get the to - for accessing this resource. - - - - - Returns a description for this resource. - - - A description for this resource. - - - - - - This implementation always returns true - - - - - This implemementation always returns true - - - - - Gets the encoding used to create a byte stream of the string. - - - - - Gets the content encapsulated by this . - - - - - A backed resource - on top of - - -

- Obviously supports resolution as a , and also - as a in the case of the "file:" - protocol. -

-
- -

- Some examples of the strings that can be used to initialize a new - instance of the class - include... - - - file:///Config/objects.xml - - - http://www.mycompany.com/services.txt - - -

-
- Juergen Hoeller - Leonardo Susatyo (.NET) - Aleksandar Seovic (.NET) - - - -
- - - Creates a new instance of the - class. - - -

- Some examples of the values that the - can typically be expected to hold include... - - - file:///Config/objects.xml - - - http://www.mycompany.com/services.txt - - -

-
- - A string representation of the resource. - -
- - - Does the supplied relative ? - - - The name of the resource to test. - - - if resource name is relative; - otherwise . - - - - - Returns the instance - used for the resource resolution. - - - A instance. - - - - - - - Return an for this resource. - - - An . - - - If the stream could not be opened. - - - - - - Returns the handle for this resource. - - - The handle for this resource. - - - If the resource is not available or cannot be exposed as a - . - - - - - - Returns a handle for this resource. - - - The handle for this resource. - - - If the resource is not available on a filesystem. - - - - - - Does this support relative - resource retrieval? - - -

- This implementation does support relative resource retrieval, and - so will always return . -

-
- - if this - supports relative resource - retrieval. - - -
- - - Gets the root location of the resource. - - - The root location of the resource. - - - - - - Gets the current path of the resource. - - - The current path of the resource. - - - - - - Gets those characters that are valid path separators for the - resource type. - - - Those characters that are valid path separators for the resource - type. - - - - - - Returns a description for this resource. - - - A description for this resource. - - - - - - Converts string representation of a credential for Web client authentication - into an instance of . - - -

- Find below some examples of the XML formatted strings that this - converter will sucessfully convert. -

- - - - - - -
- Bruno Baia -
- - - Can we convert from the sourcetype - to a instance ? - - -

- Currently only supports conversion from a instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - if the conversion is possible. -
- - - Convert from a value to an - instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A instance if successful. - - - - - A custom for any - primitive numeric type such as , - , , etc. - - -

- Can use a given for - (locale-specific) parsing and rendering. -

-

- This is not meant to be used as a system - but rather as a - locale-specific number converter within custom controller code, to - parse user-entered number strings into number properties of objects, - and render them in a UI form. -

-
- Juergen Hoeller - Simon White (.NET) -
- - - Creates a new instance of the - class. - - - The primitive numeric to convert to. - - - The to use for - (locale-specific) parsing and rendering - - - Is an empty string allowed to be converted? If - , an empty string value will be converted to - numeric 0. - - Id the supplied is not a primitive - . - - - - - - Returns whether this converter can convert an object of one - to a - - -

- Currently only supports conversion from a - instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - - if the conversion is possible. - -
- - - Converts the specified object (a string) to the required primitive - type. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - A primitive representation of the string value. - - - - Converter for instances. - - Juergen Hoeller - Mark Pollack (.NET) - - - - Creates a new instance of the - class. - - - - - Returns whether this converter can convert an object of one - to a - - -

- Currently only supports conversion from a - instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - True if the conversion is possible. -
- - - Convert from a string value to a instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A if successful. - - - - - Custom implementation for - objects. - - -

- Handles conversion from an XML formatted string to a - object - (see below for an example of the expected XML format). -

-

- This converter must be registered before it will be available. Standard - converters in this namespace are automatically registered by the - class. -

-
- -

- Find below some examples of the XML formatted strings that this - converter will sucessfully convert. Note that the name of the top level - (document) element is quite arbitrary... it is only the content that - matters (and which must be in the format - <add key="..." value="..."/>. For your continued sanity - though, you may wish to standardize on the top level name of - 'dictionary' (although you are of course free to not do so). -

- - - - - - -

- The following example uses a different top level (document) element - name, but is equivalent to the first example. -

- - - - - - -
- Rod Johnson - Juergen Hoeller - Simon White (.NET) -
- - - Creates a new instance of the - class. - - - - - Returns whether this converter can convert an object of one - to a - - - -

- Currently only supports conversion from an - XML formatted instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - True if the conversion is possible. -
- - - Convert from a string value to a - instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A - if successful. - - - - - Converts string representation of a regular expression into an instance of . - - Aleksandar Seovic - - - - Can we convert from the sourcetype to a ? - - -

- Currently only supports conversion from a instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - if the conversion is possible. -
- - - Convert from a value to an - instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A if successful. - - - - - Converts string representation of the registry key - into instance. - - Aleksandar Seovic - - - - Can we convert from a the sourcetype to a ? - - -

- Currently only supports conversion from a instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - if the conversion is possible. -
- - - Convert from a value to an - instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A array if successful. - - - - - Generates partial registry key name. - - - Key elements. - - - Index of the last element to use. - - - Friendly key name containing key element from - 0 to , inclusive. - - - - - Returns for the specified - root hive name. - - - Root hive name. - - - Registry key for the specified name. - - - - - Converts a two part string, (resource name, assembly name) - to a ResourceManager instance. - - - - - This constant represents the name of the folder/assembly containing global resources. - - - - - Creates a new instance of the - class. - - - - - Returns whether this converter can convert an object of one - to a - - - -

- Currently only supports conversion from a - instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - True if the conversion is possible. -
- - - Convert from a string value to a - instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A - if successful. - - If the specified does not denote a valid resource - - - - Converter for from a comma separated - list of RBG values. - - -

- Please note that this class does not implement converting - to a comma separated list of RBG values from a - . -

-
- Federico Spinazzi -
- - - Returns whether this converter can convert an object of one - to a - . - - -

- Currently only supports conversion from a - instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - if the conversion is possible. -
- - - Converts the specified object (a string) a - instance. - - - A - that provides a format context. - - - The to use - as the current culture: currently ignored. - - - The value that is to be converted, in "R,G,B", "A,R,G,B", or - symbolic color name (). - - - A representation of the string value. - - - If the input string is not in a supported format, or is not one of the - predefined system colors (). - - - - - A custom for - runtime type references. - - -

- Currently only supports conversion to and from a - . -

-
- Rick Evans (.NET) -
- - - Creates a new instance of the - class. - - - - - Returns whether this converter can convert an object of one - to the - of this converter. - - -

- Currently only supports conversion from a - instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - True if the conversion is possible. -
- - - Returns whether this converter can convert the object to the specified - . - - - A - that provides a format context. - - - A that represents the - you want to convert to. - - True if the conversion is possible. - - - - Converts the given value to the type of this converter. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - An that represents the converted value. - - - - - Converts the given value object to the specified type, - using the specified context and culture information. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - The to convert the - parameter to. - - - An that represents the converted value. - - - - - Converter for to directly set a - property. - - Jurgen Hoeller - Mark Pollack (.NET) - - - - Create a new StreamConverter using the default - . - - - - - Create a new StreamConverter using the given - . - - - The to use. - - - - Returns whether this converter can convert an object of one - to a - - -

- Currently only supports conversion from a - instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - True if the conversion is possible. -
- - - Convert from a string value to a instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A if successful. - - - - - Converts a separated to a - array. - - -

- Defaults to using the , (comma) as the list separator. Note that the value - of the current is - not used. -

-

- If you want to provide your own list separator, you can set the value of the - - property to the value that you want. Please note that this value will be used - for all future conversions in preference to the default list separator. -

-

- Please note that the individual elements of a string will be passed - through as is (i.e. no conversion or trimming of surrounding - whitespace will be performed). -

-

- This should be - automatically registered with any - implementations. -

-
- - - public class StringArrayConverterExample - { - public static void Main() - { - StringArrayConverter converter = new StringArrayConverter(); - - string csvWords = "This,Is,It"; - string[] frankBoothWords = converter.ConvertFrom(csvWords); - - // the 'frankBoothWords' array will have 3 elements, namely - // "This", "Is", "It". - - // please note that extraneous whitespace is NOT trimmed off - // in the current implementation... - string csv = " Cogito ,ergo ,sum "; - string[] descartesWords = converter.ConvertFrom(csv); - - // the 'descartesWords' array will have 3 elements, namely - // " Cogito ", "ergo ", "sum ". - // notice how the whitespace has NOT been trimmed. - } - } - - - -
- - - Can we convert from a the sourcetype to a array? - - -

- Currently only supports conversion from a instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - if the conversion is possible. -
- - - Convert from a value to a - array. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A array if successful. - - - - - The value that will be used as the list separator when performing - conversions. - - - A 'single' string character that will be used as the list separator - when performing conversions. - - - If the supplied value is not and is an empty - string, or has more than one character. - - - - - Converter for instances. - - Bruno Baia - - - - Creates a new instance of the - class. - - - - - Convert from a string value to a instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A if successful. - - - - - Utility methods that are used to convert objects from one type into another. - - Aleksandar Seovic - - - - Convert the value to the required (if necessary from a string). - - The proposed change value. - - The we must convert to. - - Property name, used for error reporting purposes... - - If there is an internal error. - - The new value, possibly the result of type conversion. - - - - Utility method to create a property change event. - - - The full name of the property that has changed. - - The property old value - The property new value - - A new . - - - - - Registry class that allows users to register and retrieve type converters. - - Aleksandar Seovic - - - - Name of the .Net config section that contains Spring.Net type aliases. - - - - - Registers standard and configured type converters. - - - - - Returns for the specified type. - - Type to get the converter for. - a type converter for the specified type. - If is null. - - - - Registers for the specified type. - - Type to register the converter for. - Type converter to register. - If either of arguments is null. - - - - Registers for the specified type. - - - This is a convinience method that accepts the names of both - type to register converter for and the converter itself, - resolves them using , creates an - instance of type converter and calls overloaded - method. - - Type name of the type to register the converter for (can be a type alias). - Type name of the type converter to register (can be a type alias). - If either of arguments is null or empty string. - - If either of arguments fails to resolve to a valid . - - - If type converter does not derive from or if it cannot be instantiated. - - - - - Converts between instances of and their string representations. - - Erich Eichinger - - - - Can we convert from the sourcetype to a ? - - -

- Currently only supports conversion from a instance. -

-
- - A that provides a format context. - - - A that represents the you want to convert from. - - if the conversion is possible. -
- - - Convert from a value to an instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A if successful, otherwise. - - The conversion cannot be performed. - - - - Returns whether this converter can convert the object to the specified type, using the specified context. - - An that provides a format context. - A that represents the type you want to convert to. - - true if this converter can perform the conversion; otherwise, false. - - - At the moment only conversion to string is supported. - - - - - Converts the given value object to the specified type, using the specified context and culture information. - - - - An that represents the converted value. - - - A . If null is passed, the current culture is assumed. - An that provides a format context. - The to convert the value parameter to. - The to convert. - The conversion cannot be performed. - The destinationType parameter is null. - - - - Converter for instances. - - Juergen Hoeller - Mark Pollack (.NET) - - - - Creates a new instance of the - class. - - - - - Returns whether this converter can convert an object of one - to a - - -

- Currently only supports conversion from a - instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - True if the conversion is possible. -
- - - Convert from a string value to a instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A if successful. - - - - - Resolves (instantiates) a by it's (possibly - assembly qualified) name, and caches the - instance against the type name. - - Rick Evans - Bruno Baia - Erich Eichinger - - - - Resolves a by name. - - -

- The rationale behind the creation of this interface is to centralise - the resolution of type names to instances - beyond that offered by the plain vanilla - method call. -

-
- Rick Evans -
- - - Resolves the supplied to a - - instance. - - - The (possibly partially assembly qualified) name of a - . - - - A resolved instance. - - - If the supplied could not be resolved - to a . - - - - - The cache, mapping type names ( instances) against - instances. - - - - - Creates a new instance of the class. - - - The that this instance will delegate - actual resolution to if a - cannot be found in this instance's cache. - - - If the supplied is . - - - - - Resolves the supplied to a - - instance. - - - The (possibly partially assembly qualified) name of a - . - - - A resolved instance. - - - If the supplied could not be resolved - to a . - - - - - Holder for the generic arguments when using type parameters. - - -

- Type parameters can be applied to classes, interfaces, - structures, methods, delegates, etc... -

-
-
- - - The generic arguments prefix. - - - - - The generic arguments suffix. - - - - - The character that separates a list of generic arguments. - - - - - Creates a new instance of the GenericArgumentsHolder class. - - - The string value to parse looking for a generic definition - and retrieving its generic arguments. - - - - - Returns an array of unresolved generic arguments types. - - -

- A empty string represents a type parameter that - did not have been substituted by a specific type. -

-
- - An array of strings that represents the unresolved generic - arguments types or an empty array if not generic. - -
- - - The (unresolved) generic type name portion - of the original value when parsing a generic type. - - - - - The (unresolved) generic method name portion - of the original value when parsing a generic method. - - - - - Is the string value contains generic arguments ? - - -

- A generic argument can be a type parameter or a type argument. -

-
-
- - - Is generic arguments only contains type parameters ? - - - - - Resolves a generic by name. - - Bruno Baia - - - - Resolves a by name. - - Rick Evans - Aleksandar Seovic - Bruno Baia - - - - Resolves the supplied to a - instance. - - - The unresolved (possibly partially assembly qualified) name - of a . - - - A resolved instance. - - - If the supplied could not be resolved - to a . - - - - - Uses - to load an and then the attendant - referred to by the - parameter. - - -

- is - deprecated in .NET 2.0, but is still used here (even when this class is - compiled for .NET 2.0); - will - still resolve (non-.NET Framework) local assemblies when given only the - display name of an assembly (the behaviour for .NET Framework assemblies - and strongly named assemblies is documented in the docs for the - method). -

-
- - The assembly and type to be loaded. - - - A , or . - - - - -
- - - Uses - to load the attendant referred to by - the parameter. - - - The type to be loaded. - - - A , or . - - - - - Creates a new instance - from the given - - - - - Creates a new instance - from the given with the given inner - - - - - Resolves the supplied generic to a - instance. - - - The unresolved (possibly generic) name of a . - - - A resolved instance. - - - If the supplied could not be resolved - to a . - - - - - Holds data about a and it's - attendant . - - - - - The string that separates a name - from the name of it's attendant - in an assembly qualified type name. - - - - - Creates a new instance of the TypeAssemblyHolder class. - - - The unresolved name of a . - - - - - The (unresolved) type name portion of the original type name. - - - - - The (unresolved, possibly partial) name of the attandant assembly. - - - - - Is the type name being resolved assembly qualified? - - - - - Provides access to a central registry of aliased s. - - -

- Simplifies configuration by allowing aliases to be used instead of - fully qualified type names. -

-

- Comes 'pre-loaded' with a number of convenience alias' for the more - common types; an example would be the 'int' (or 'Integer' - for Visual Basic.NET developers) alias for the - type. -

-
- Aleksandar Seovic - -
- - - Name of the .Net config section that contains Spring.Net type aliases. - - - - - The alias around the 'int' type. - - - - - The alias around the 'Integer' type (Visual Basic.NET style). - - - - - The alias around the 'int[]' array type. - - - - - The alias around the 'Integer()' array type (Visual Basic.NET style). - - - - - The alias around the 'decimal' type. - - - - - The alias around the 'Decimal' type (Visual Basic.NET style). - - - - - The alias around the 'decimal[]' array type. - - - - - The alias around the 'Decimal()' array type (Visual Basic.NET style). - - - - - The alias around the 'char' type. - - - - - The alias around the 'Char' type (Visual Basic.NET style). - - - - - The alias around the 'char[]' array type. - - - - - The alias around the 'Char()' array type (Visual Basic.NET style). - - - - - The alias around the 'long' type. - - - - - The alias around the 'Long' type (Visual Basic.NET style). - - - - - The alias around the 'long[]' array type. - - - - - The alias around the 'Long()' array type (Visual Basic.NET style). - - - - - The alias around the 'short' type. - - - - - The alias around the 'Short' type (Visual Basic.NET style). - - - - - The alias around the 'short[]' array type. - - - - - The alias around the 'Short()' array type (Visual Basic.NET style). - - - - - The alias around the 'unsigned int' type. - - - - - The alias around the 'unsigned long' type. - - - - - The alias around the 'ulong[]' array type. - - - - - The alias around the 'uint[]' array type. - - - - - The alias around the 'unsigned short' type. - - - - - The alias around the 'ushort[]' array type. - - - - - The alias around the 'double' type. - - - - - The alias around the 'Double' type (Visual Basic.NET style). - - - - - The alias around the 'double[]' array type. - - - - - The alias around the 'Double()' array type (Visual Basic.NET style). - - - - - The alias around the 'float' type. - - - - - The alias around the 'Single' type (Visual Basic.NET style). - - - - - The alias around the 'float[]' array type. - - - - - The alias around the 'Single()' array type (Visual Basic.NET style). - - - - - The alias around the 'DateTime' type. - - - - - The alias around the 'DateTime' type (C# style). - - - - - The alias around the 'DateTime' type (Visual Basic.NET style). - - - - - The alias around the 'DateTime[]' array type. - - - - - The alias around the 'DateTime[]' array type. - - - - - The alias around the 'DateTime()' array type (Visual Basic.NET style). - - - - - The alias around the 'bool' type. - - - - - The alias around the 'Boolean' type (Visual Basic.NET style). - - - - - The alias around the 'bool[]' array type. - - - - - The alias around the 'Boolean()' array type (Visual Basic.NET style). - - - - - The alias around the 'string' type. - - - - - The alias around the 'string' type (Visual Basic.NET style). - - - - - The alias around the 'string[]' array type. - - - - - The alias around the 'string[]' array type (Visual Basic.NET style). - - - - - The alias around the 'object' type. - - - - - The alias around the 'object' type (Visual Basic.NET style). - - - - - The alias around the 'object[]' array type. - - - - - The alias around the 'object[]' array type (Visual Basic.NET style). - - - - - The alias around the 'int?' type. - - - - - The alias around the 'int?[]' array type. - - - - - The alias around the 'decimal?' type. - - - - - The alias around the 'decimal?[]' array type. - - - - - The alias around the 'char?' type. - - - - - The alias around the 'char?[]' array type. - - - - - The alias around the 'long?' type. - - - - - The alias around the 'long?[]' array type. - - - - - The alias around the 'short?' type. - - - - - The alias around the 'short?[]' array type. - - - - - The alias around the 'unsigned int?' type. - - - - - The alias around the 'unsigned long?' type. - - - - - The alias around the 'ulong?[]' array type. - - - - - The alias around the 'uint?[]' array type. - - - - - The alias around the 'unsigned short?' type. - - - - - The alias around the 'ushort?[]' array type. - - - - - The alias around the 'double?' type. - - - - - The alias around the 'double?[]' array type. - - - - - The alias around the 'float?' type. - - - - - The alias around the 'float?[]' array type. - - - - - The alias around the 'bool?' type. - - - - - The alias around the 'bool?[]' array type. - - - - - Registers standard and user-configured type aliases. - - - - - Registers an alias for the specified . - - -

- This overload does eager resolution of the - referred to by the parameter. It will throw a - if the referred - to by the parameter cannot be resolved. -

-
- - A string that will be used as an alias for the specified - . - - - The (possibly partially assembly qualified) name of the - to register the alias for. - - - If either of the supplied parameters is or - contains only whitespace character(s). - - - If the referred to by the supplied - cannot be loaded. - -
- - - Registers short type name as an alias for - the supplied . - - - The to register. - - - If the supplied is . - - - - - Registers an alias for the supplied . - - - The alias for the supplied . - - - The to register the supplied under. - - - If the supplied is ; or if - the supplied is or - contains only whitespace character(s). - - - - - Resolves the supplied to a . - - - The alias to resolve. - - - The the supplied was - associated with, or if no - was previously registered for the supplied . - - - If the supplied is or - contains only whitespace character(s). - - - - - Returns a flag specifying whether TypeRegistry contains - specified alias or not. - - - Alias to check. - - - true if the specified type alias is registered, - false otherwise. - - - - - Helper methods with regard to type resolution. - - -

- Not intended to be used directly by applications. -

-
- Bruno Baia -
- - - Creates a new instance of the class. - - -

- This is a utility class, and as such exposes no public constructors. -

-
-
- - - Resolves the supplied type name into a - instance. - - -

- If you require special resolution, do - not use this method, but rather instantiate - your own . -

-
- - The (possibly partially assembly qualified) name of a - . - - - A resolved instance. - - - If the type cannot be resolved. - -
- - - Resolves a string array of interface names to - a array. - - - An array of valid interface names. Each name must include the full - interface and assembly name. - - An array of interface s. - - If any of the interfaces can't be loaded. - - - If any of the s specified is not an interface. - - - If (or any of its elements ) is - . - - - - - Match a method against the given pattern. - - the pattern to match against. - the method to match. - - if the method matches the given pattern; otherwise . - - - If the supplied is invalid. - - - - - Exception thrown when the ObjectFactory cannot load the specified type of a given object. - - Mark Pollack - - - - Thrown on an unrecoverable problem encountered in the - objects namespace or sub-namespaces, e.g. bad class or field. - - Rod Johnson - Mark Pollack (.NET) - - - - Superclass for all exceptions thrown in the Objects namespace and sub-namespaces. - - Rod Johnson - Mark Pollack (.NET) - - - Creates a new instance of the ObjectsException class. - - - - Creates a new instance of the ObjectsException class. with the specified message. - - - A message about the exception. - - - - - Creates a new instance of the ObjectsException class with the specified message - and root cause. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ObjectsException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Creates a new instance of the FatalObjectException class. - - - - - Creates a new instance of the FatalObjectException class with the - specified message. - - - A message about the exception. - - - - - Creates a new instance of the FatalObjectException class with the - specified message. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the FatalObjectException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Initializes a new instance of the class. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Initializes a new instance of the class. - - The resource description that the object definition came from. - Name of the object requested - Name of the object type. - The root cause. - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Populates a with - the data needed to serialize the target object. - - - The to populate - with data. - - - The destination (see ) - for this serialization. - - - - - Gets he name of the object we are trying to load. - - The name of the object. - - - - Gets the name of the object type we are trying to load. - - The name of the object type. - - - - Gets the resource description that the object definition came from - - The resource description. - - - - A implementation that represents - a composed collection of instances. - - - - - The criteria for an arbitrary filter. - - Rick Evans - - - - Does the supplied satisfy the criteria - encapsulated by this instance? - - - The datum to be checked by this criteria instance. - - - if the supplied - satisfies the criteria encapsulated by this instance; - if not, or the supplied - is . - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - A user-defined (child) criteria that will be composed into this instance. - - - - - Does the supplied satisfy the criteria encapsulated by - this instance? - - The data to be checked by this criteria instance. - - True if the supplied satisfies the criteria encapsulated - by this instance; false if not or the supplied is null. - - - - - Adds the supplied into the criteria - composed within this instance. - - - The to be added. - - - - - The list of composing this - instance. - - - - - Factory class to conceal any default implementation. - - Rod Johnson - Simon White (.NET) - - - - Creates a new instance of the - implementation provided by this factory. - - - A new instance of the - implementation provided by this factory. - - - - - Interface to be implemented by objects that can return information about - the current call stack. - - -

- Useful in AOP (as an expression of the AspectJ cflow concept) but not AOP-specific. -

-
- Rod Johnson - Aleksandar Seovic (.Net) -
- - - Detects whether the caller is under the supplied , - according to the current stacktrace. - - - The to look for. - - - if the caller is under the supplied . - - - - - Detects whether the caller is under the supplied - and , according to the current stacktrace. - - - The to look for. - - The name of the method to look for. - - if the caller is under the supplied - and . - - - - - Does the current stack trace contain the supplied ? - - The token to match against. - - if the current stack trace contains the supplied - . - - - - - Creates a new instance of the - class. - - - - - Detects whether the caller is under the supplied , - according to the current stacktrace. - - - - - - Detects whether the caller is under the supplied - and , according to the current stacktrace. - - -

- Matches the whole method name. -

-
- -
- - - Does the current stack trace contain the supplied ? - - -

- This leaves it up to the caller to decide what matches, but is obviously less of - an abstraction because the caller must know the exact format of the underlying - stack trace. -

-
- -
- - - Provides methods to support various naming and other conventions used throughout the framework. - Mainly for internal use within the framework. - - Rob Harrop - Juergen Hoeller - Mark Pollack (.NET) - - - Convert Strings in attribute name format (lowercase, hyphens separating words) - into property name format (camel-cased). For example, transaction-manager is - converted into transactionManager. - - - - - Convenience class that exposes a signature that matches the - delegate. - - -

- Useful when filtering members via the - mechanism. -

-
- Rick Evans -
- - - Creates a new instance of the - class. - - - - - Returns true if the supplied instance - satisfies the supplied (which must be an - implementation). - - - The instance that will be checked to see if - it matches the supplied . - - - The criteria against which to filter the supplied - instance. - - - True if the supplied instance - satisfies the supplied (which must be an - implementation); false if not or the - supplied is not an - implementation or is null. - - - - - Interface that can be implemented by exceptions etc that are error coded. - - -

- The error code is a , rather than a number, so it can - be given user-readable values, such as "object.failureDescription". -

-
- Rod Johnson - Aleksandar Seovic (.Net) -
- - - Return the error code associated with this failure. - - -

- The GUI can render this anyway it pleases, allowing for I18n etc. -

-
- - The error code associated with this failure, - or the empty string instance if not error-coded. - -
- - - Thrown in response to referring to an invalid property (most often via reflection). - - Rick Evans - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - - - Creates a new instance of the - class. - - - The that is (or rather was) the source of the - offending property. - - - The name of the offending property. - - - - - Creates a new instance of the - class. - - - The that is (or rather was) the source of the - offending property. - - - The name of the offending property. - - - A message about the exception. - - - - - Creates a new instance of the InvalidPropertyException class. - - - The that is (or rather was) the source of the - offending property. - - - The name of the offending property. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Populates a with - the data needed to serialize the target object. - - - The to populate - with data. - - - The destination (see ) - for this serialization. - - - - - The that is (or rather was) the source of the - offending property. - - - - - The name of the offending property. - - - - - Criteria that is satisfied if the number of generic arguments to a given - matches an arbitrary number. - - -

- This class supports checking the generic arguments count of both - generic methods and constructors. -

-
- Bruno Baia -
- - - Creates a new instance of the - class. - - -

- This constructor sets the - - property to zero (0). -

-
-
- - - Creates a new instance of the - class. - - - The number of generic arguments that a - must have to satisfy this criteria. - - - If the supplied is less - than zero. - - - - - Does the supplied satisfy the criteria encapsulated by - this instance? - - The datum to be checked by this criteria instance. - - True if the supplied satisfies the criteria encapsulated - by this instance; false if not or the supplied is null. - - - - - The number of generic arguments that a - must have to satisfy this criteria. - - - If the supplied value is less than zero. - - - - - Thrown when a method (typically a property getter or setter invoked via reflection) - throws an exception, analogous to a . - - Rod Johnson - Mark Pollack (.NET) - - - - Superclass for exceptions related to a property access, such as a - mismatch or a target invocation exception. - - Rod Johnson - Mark Pollack (.NET) - - - - Populates a with - the data needed to serialize the target object. - - - The to populate - with data. - - - The destination (see ) - for this serialization. - - - - - Create a new instance of the PropertyAccessException class. - - - A message about the exception. - - Describes the change attempted on the property. - - - - Create a new instance of the PropertyAccessException class. - - - A message about the exception. - - Describes the change attempted on the property. - - The root exception that is being wrapped. - - - - - Creates a new instance of the PropertyAccessException class. - - - - - Creates a new instance of the PropertyAccessException class. - - - A message about the exception. - - - - - Creates a new instance of the PropertyAccessExceptionsException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the PropertyAccessExceptionsException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Returns the PropertyChangeEventArgs that resulted in the problem. - - - - - The string error code used to classify the error. - - - - - Creates a new instance of the MethodInvocationException class. - - - - - Creates a new instance of the MethodInvocationException class. - - - A message about the exception. - - - - - Creates a new instance of the MethodInvocationException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Constructor to use when an exception results from a - . - - - The raised by the invoked property. - - - The that - resulted in an exception. - - - - - Creates a new instance of the MethodInvocationException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - The error code string for this exception. - - - - - Criteria that is satisfied if the method Name of an - instance matches a - supplied string pattern. - - - - Supports the following simple pattern styles: - "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. - - - Bruno Baia - - - - Creates a new instance of the - class. - - -

- This constructor sets the - - property to * (any method name). -

-
-
- - - Creates a new instance of the - class. - - The pattern that names - must match against in order to satisfy this criteria. - - If the supplied is null or resolve to an empty string. - - - - - Does the supplied satisfy the criteria encapsulated by - this instance? - - The datum to be checked by this criteria instance. - - True if the supplied satisfies the criteria encapsulated - by this instance; false if not or the supplied is null. - - - - - The number of parameters that a - must have to satisfy this criteria. - - - If the supplied value is null or resolve to an empty string. - - - - - Helper class that encapsulates the specification of a method parameter, i.e. - a MethodInfo or ConstructorInfo plus a parameter index. - Useful as a specification object to pass along. - - Juergen Hoeller - Rob Harrop - Mark Pollack (.NET) - - - - Initializes a new instance of the class for the given - MethodInfo. - - The MethodInfo to specify a parameter for. - Index of the parameter. - - - - Initializes a new instance of the class. - - The ConstructorInfo to specify a parameter for. - Index of the parameter. - - - - Create a new MethodParameter for the given method or donstructor. - This is a convenience constructor for scenarios where a - Method or Constructor reference is treated in a generic fashion. - - The method or constructor to specify a parameter for. - Index of the parameter. - the corresponding MethodParameter instance - - - - Parameters the name of the method/constructor parameter. - - the parameter name. - - - - Gets the type of the method/constructor parameter. - - The type of the parameter. (never null) - - - - Gets the wrapped MethodInfo, if any. Note Either MethodInfo or ConstructorInfo is available. - - The MethodInfo, or null if none. - - - - Gets wrapped ConstructorInfo, if any. Note Either MethodInfo or ConstructorInfo is available. - - The ConstructorInfo, or null if none - - - - Criteria that is satisfied if the number of parameters to a given - matches an arbitrary number. - - -

- This class supports checking the parameter count of both methods and - constructors. -

-

- Default parameters, etc need to taken into account. -

-
- Rick Evans -
- - - Creates a new instance of the - class. - - -

- This constructor sets the - - property to zero (0). -

-
-
- - - Creates a new instance of the - class. - - - The number of parameters that a - must have to satisfy this criteria. - - - If the supplied is less - than zero. - - - - - Does the supplied satisfy the criteria encapsulated by - this instance? - - The datum to be checked by this criteria instance. - - True if the supplied satisfies the criteria encapsulated - by this instance; false if not or the supplied is null. - - - - - The number of parameters that a - must have to satisfy this criteria. - - - If the supplied value is less than zero. - - - - - Criteria that is satisfied if the of each of the - parameters of a given matches each - of the parameter s of a given - . - - -

- If no array is passed to the overloaded constructor, - any method that has no parameters will satisfy an instance of this - class. The same effect could be achieved by passing the - array to the overloaded constructor. -

-
- Rick Evans -
- - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - -

- If the supplied array is null, then this - constructor uses the array. -

-
- - The array that this criteria will use to - check parameter s. - -
- - - Does the supplied satisfy the criteria encapsulated by - this instance? - - -

- This implementation respects the inheritance chain of any parameter - s... i.e. methods that have a base type (or - interface) that is assignable to the in the - same corresponding index of the parameter types will satisfy this - criteria instance. -

-
- The datum to be checked by this criteria instance. - - True if the supplied satisfies the criteria encapsulated - by this instance; false if not or the supplied is null. - -
- - - Criteria that is satisfied if the return of a given - matches a given . - - Rick Evans - - - - The return to match against if no - is provided explictly. - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The that the return type of a given - must match in order to satisfy - this criteria. - - - - - Does the supplied satisfy the criteria encapsulated by - this instance? - - The datum to be checked by this criteria instance. - - True if the supplied satisfies the criteria encapsulated - by this instance; false if not or the supplied is null. - - - - - The that the return type of a given - must match in order to satisfy - this criteria. - - - - - Thrown in response to a failed attempt to read a property. - - -

- Typically thrown when attempting to read the value of a write-only - property via reflection. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - - - Creates a new instance of the - class. - - - The that is (or rather was) the source of the - offending property. - - - The name of the offending property. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Thrown in response to a failed attempt to write a property. - - Mark Pollack (.NET) - - - - Creates a new instance of the NotWritablePropertyException class. - - - - - Creates a new instance of the NotWritablePropertyException class. - - - A message about the exception. - - - - - Creates a new instance of the NotWritablePropertyException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the NotWritablePropertyException class. - - - The that is (or rather was) the source of the - offending property. - - - The name of the offending property. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the NotWritablePropertyException class - summarizing what property was not writable. - - - The name of the property that is not writable. - - - The in which the property is not writable. - - - - - Creates new NotWritablePropertyException with a root cause. - - - The name of the property that is not writable. - - - The in which the property is not writable. - - - The root cause indicating why the property was not writable. - - - - - Creates a new instance of the NotWritablePropertyException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Thrown in response to encountering a value - when traversing a nested path expression. - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - The of the object where the property was not found. - - The name of the property not found. - - - - Creates a new instance of the - class. - - - The of the object where the property was not found. - - The name of the property not found. - A message about the exception. - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Populates a with - the data needed to serialize the target object. - - - The to populate - with data. - - - The destination (see ) - for this serialization. - - - - - The name of the offending property. - - - - - The of the class where the property was last looked for. - - - - - Comparator implementation for objects, sorting by - order value ascending (resp. by priority descending). - - -

- Non- objects are treated as greatest order values, - thus ending up at the end of a list, in arbitrary order (just like same order values of - objects). -

-
- Juergen Hoeller - Aleksandar Seovic (.Net) -
- - - Compares two objects and returns a value indicating whether one is less than, - equal to or greater than the other. - - -

- Uses direct evaluation instead of - to avoid unnecessary boxing. -

-
- The first object to compare. - The second object to compare. - - -1 if first object is less then second, 1 if it is greater, or 0 if they are equal. - -
- - - Handle the case when both objects have equal sort order priority. By default returns 0, - but may be overriden for handling special cases. - - The first object to compare. - The second object to compare. - - -1 if first object is less then second, 1 if it is greater, or 0 if they are equal. - - - - - Provides additional data for the PropertyChanged event. - - -

- Provides some additional properties over and above the name of the - property that has changed (which is inherited from the - base class). - This allows calling code to determine whether or not a property has - actually changed (i.e. a PropertyChanged event may have been - raised, but the value itself may be equivalent). -

-
- -
- - - Create a new instance of the - class. - - - The name of the property that was changed. - The old value of the property. - the new value of the property. - - - - Get the old value for the property. - - - - - - Get the new value of the property. - - - - - - A base class for all - implementations that are regular expression based. - - Rick Evans - - - - The default pattern... matches absolutely anything. - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The regular expression pattern to be applied. - - - - - Does the supplied satisfy the criteria encapsulated by - this instance? - - The datum to be checked by this criteria instance. - - True if the supplied satisfies the criteria encapsulated - by this instance; false if not or the supplied is null. - - - - - Convenience method that calls the - - on the supplied . - - The input to match against. - True if the matches. - - - - The regular expression pattern to be applied. - - - - - The regular expression options to be applied. - - - - - The regular expression to be applied. - - - - - Criteria that is satisfied if the Name property of an - instance matches a - supplied regular expression pattern. - - Rick Evans - - - - The default event name pattern... matches pretty much any event name. - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The pattern that names - must match against in order to satisfy this criteria. - - - - - Does the supplied satisfy the criteria encapsulated by - this instance? - - The datum to be checked by this criteria instance. - - True if the supplied satisfies the criteria encapsulated - by this instance; false if not or the supplied is null. - - - - - Criteria that is satisfied if the Name property of an - instance matches a - supplied regular expression pattern. - - Rick Evans - - - - The default method name pattern... matches pretty much any method name. - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The pattern that names - must match against in order to satisfy this criteria. - - - - - Does the supplied satisfy the criteria encapsulated by - this instance? - - The datum to be checked by this criteria instance. - - True if the supplied satisfies the criteria encapsulated - by this instance; false if not or the supplied is null. - - - - - Exception thrown on a mismatch when trying to set a property - or resolve an argument to a method invocation. - - Rod Johnson - Juergen Hoeller - Mark Pollack (.NET) - - - - Creates a new instance of the TypeMismatchException class. - - - - - Creates a new instance of the TypeMismatchException class. - - - A message about the exception. - - - - - Creates a new instance of the TypeMismatchException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the TypeMismatchException class describing the - property and required type that could not used to set a property on the target object. - - - The description of the property that was to be changed. - - The target conversion type. - - - - Creates a new instance of the TypeMismatchException class describing the - property, required type, and underlying exception that could not be used - to set a property on the target object. - - - The description of the property that was to be changed. - - The target conversion type. - The underlying exception. - - - - Creates a new instance of the TypeMismatchException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - The string error code used to classify the exception. - - - - - Abstract base class for implementations. - - Aleksandar Seovic - - - - An interface that defines the methods that have to be implemented by all data bindings. - - Aleksandar Seovic - - - - Binds source object to target object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - - - Binds source object to target object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - Variables that should be used during expression evaluation. - - - - - Binds target object to source object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - - - Binds target object to source object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - Variables that should be used during expression evaluation. - - - - - Sets error message that should be displayed in the case - of a non-fatal binding error. - - - Resource ID of the error message. - - - List of error providers message should be added to. - - - - - The name of the always filled error provider - - - - - Gets or sets a flag specifying whether this binding is valid. - - - true if this binding evaluated without errors; - false otherwise. - - - - - Marks this binding's state as invalid for this validationErrors collection. - Returns false if is null. - - - false, if validationErrors is null - - - - Initializes a new instance of the class. - - - - - Binds source object to target object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - - - Binds target object to source object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - - - Binds source object to target object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - Variables that should be used during expression evaluation. - - - - - Binds target object to source object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - Variables that should be used during expression evaluation. - - - - - Sets error message that should be displayed in the case - of a non-fatal binding error. - - - Resource ID of the error message. - - - List of error providers message should be added to. - - - - - Determines whether the specified is equal to the current . - - - true if the specified is equal to the current ; otherwise, false. - - The to compare with the current . 2 - - - - Serves as a hash function for a particular type. is suitable for use in hashing algorithms and data structures like a hash table. - - - A hash code for the current . - - - - - Gets the unique ID of this binding instance. - - - - - Gets or sets the . - - The binding direction. - - - - Gets the error message. - - The error message. - - - - Gets the error providers. - - - - - Abstract base class for simple, one-to-one implementations. - - Aleksandar Seovic - - - - Initialize a new instance of without any - - - - - Initialize a new instance of with the - specified . - - - - - Binds source object to target object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - Variables that should be used during expression evaluation. - - - - - Concrete implementation if source to target binding. - - - The source object. - - - The target object. - - - Variables that should be used during expression evaluation. - - - - - Binds target object to source object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - Variables that should be used during expression evaluation. - - - - - Concrete implementation of target to source binding. - - - The source object. - - - The target object. - - - Variables that should be used during expression evaluation. - - - - - Gets the source value for the binding. - - - Source object to extract value from. - - - Variables for expression evaluation. - - - The source value for the binding. - - - - - Sets the source value for the binding. - - - The source object to set the value on. - - - The value to set. - - - Variables for expression evaluation. - - - - - Gets the target value for the binding. - - - Source object to extract value from. - - - Variables for expression evaluation. - - - The target value for the binding. - - - - - Sets the target value for the binding. - - - The target object to set the value on. - - - The value to set. - - - Variables for expression evaluation. - - - - - Gets or sets the to use. - - The formatter to use. - - - - Base implementation of the . - - Aleksandar Seovic - - - - An interface that has to be implemented by all data binding containers. - - Aleksandar Seovic - - - - Adds the binding. - - - Binding definition to add. - - - Added instance. - - - - - Adds the binding with a default - binding direction of . - - - This is a convinience method for adding SimpleExpressionBinding, - one of the most often used binding types, to the bindings list. - - - The source expression. - - - The target expression. - - - Added instance. - - - - - Adds the binding. - - - This is a convinience method for adding SimpleExpressionBinding, - one of the most often used binding types, to the bindings list. - - - The source expression. - - - The target expression. - - - Binding direction. - - - Added instance. - - - - - Adds the binding with a default - binding direction of . - - - This is a convinience method for adding SimpleExpressionBinding, - one of the most often used binding types, to the bindings list. - - - The source expression. - - - The target expression. - - - to use for value formatting and parsing. - - - Added instance. - - - - - Adds the binding. - - - This is a convinience method for adding SimpleExpressionBinding, - one of the most often used binding types, to the bindings list. - - - The source expression. - - - The target expression. - - - Binding direction. - - - to use for value formatting and parsing. - - - Added instance. - - - - - Gets a value indicating whether this data binding container - has bindings. - - - true if this data binding container has bindings; - false otherwise. - - - - - Creates a new instance of . - - - - - Adds the binding. - - - Binding definition to add. - - - Added instance. - - - - - Adds the binding with a default - binding direction of . - - - The source expression. - - - The target expression. - - - Added instance. - - - - - Adds the binding. - - - The source expression. - - - The target expression. - - - Binding direction. - - - Added instance. - - - - - Adds the binding with a default - binding direction of . - - - The source expression. - - - The target expression. - - - to use for value formatting and parsing. - - - Added instance. - - - - - Adds the binding. - - - The source expression. - - - The target expression. - - - Binding direction. - - - to use for value formatting and parsing. - - - Added instance. - - - - - Binds source object to target object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - - - Binds source object to target object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - Variables that should be used during expression evaluation. - - - - - Binds target object to source object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - - - Binds target object to source object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - Variables that should be used during expression evaluation. - - - - - Implemented as a NOOP for containers. - of a non-fatal binding error. - - - Resource ID of the error message. - - - List of error providers message should be added to. - - - - - Gets a list of bindings for this container. - - - A list of bindings for this container. - - - - - Gets a value indicating whether this instance has bindings. - - - true if this instance has bindings; otherwise, false. - - - - - BaseBindingManager keeps track of all registered bindings and - represents an entry point for the binding and unbinding process. - - Aleksandar Seovic - - - - Initializes a new instance of the class. - - - - - Enumeration that defines possible values for data binding direction. - - Aleksandar Seovic - - - - Specifies that value from the control property should be bound to a data model. - - - - - Specifies that value from the data model should be bound to control property. - - - - - Specifies that binding is bidirectional. - - - - - Represents an ErrorMessage specific to a binding instance. - - Erich Eichinger - - - - Represents a single validation error message. - - Aleksandar Seovic - Goran Milosavljevic - - - - Default constructor. - - - - - Initializes a new instance of the class. - - Error message resource identifier. - Parameters that should be used for message resolution. - - - - Initializes a new instance of the class copying values from another instance. - - Another Error message instance to copy values from. - - - - This property is reserved, apply the - - to the class instead. - - - An - that describes the XML representation of the object that - is produced by the - - method and consumed by the - - method. - - - - - - Generates an object from its XML representation. - - - The stream - from which the object is deserialized. - - - - - Converts an object into its XML representation. - - - The stream - to which the object is serialized. - - - - - Resolves the message against specified . - - Message source to resolve this error message against. - Resolved error message. - - - - Determines whether the specified is equal to the current . - - - true if the specified is equal to the current ; otherwise, false. - - The to compare with the current . 2 - - - - Serves as a hash function for a particular type. is suitable for use in hashing algorithms and data structures like a hash table. - - - A hash code for the current . - - - - - Gets or sets the resource identifier for this message. - - The resource identifier for this message. - - - - Gets or sets the message parameters. - - The message parameters. - - - - Initializes a new instance of the class. - - the id of the binding this error message is associated with - the message id - optional parameters to this message - - - - Generates an object from its XML representation. - - - The stream - from which the object is deserialized. - - - - - Converts an object into its XML representation. - - - The stream - to which the object is serialized. - - - - - Determines whether the specified is equal to the current . - - - true if the specified is equal to the current ; otherwise, false. - - The to compare with the current . 2 - - - - Serves as a hash function for a particular type. is suitable for use in hashing algorithms and data structures like a hash table. - - - A hash code for the current . - - - - - Get the ID of the binding this message instance relates to. - - - - - Interface that should be implemented by data bound objects, such as - web pages, user controls, windows forms, etc. - - Aleksandar Seovic - - - - Gets the binding manager. - - The binding manager. - - - - implementation that allows - data binding between collections that implement - interface. - - Aleksandar Seovic - - - - Binds source object to target object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - Variables that should be used during expression evaluation. - - - - - Binds target object to source object. - - - The source object. - - - The target object. - - - Validation errors collection that type conversion errors should be added to. - - - Variables that should be used during expression evaluation. - - - - - Simple, expression-based implementation of that - binds source to target one-to-one. - - Aleksandar Seovic - - - - Initializes a new instance of the class. - - - The source expression. - - - The target expression. - - - - - Initializes a new instance of the class. - - - The source expression. - - - The target expression. - - - The formatter to use. - - - - - Gets the source value for the binding. - - - Source object to extract value from. - - - Variables for expression evaluation. - - - The source value for the binding. - - - - - Sets the source value for the binding. - - - The source object to set the value on. - - - The value to set. - - - Variables for expression evaluation. - - - - - Gets the target value for the binding. - - - Source object to extract value from. - - - Variables for expression evaluation. - - - The target value for the binding. - - - - - Sets the target value for the binding. - - - The target object to set the value on. - - - The value to set. - - - Variables for expression evaluation. - - - - - Gets the source expression. - - The source expression. - - - - Gets the target expression. - - The target expression. - - - - Implementation of the average aggregator. - - Aleksandar Seovic - - - - Defines an interface that should be implemented - by all collection processors and aggregators. - - - - - Processes a list of source items and returns a result. - - - The source list to process. - - - An optional processor arguments array. - - - The processing result. - - - - - Returns the average of the numeric values in the source collection. - - - The source collection to process. - - - Ignored. - - - The average of the numeric values in the source collection. - - - - - Converts all elements in the input list to a given target type. - - Erich Eichinger - - - - Processes a list of source items and returns a result. - - - The source list to process. - - - An optional processor arguments array. - - - The processing result. - - - - - Implementation of the count aggregator. - - Aleksandar Seovic - - - - Returns the number of items in the source collection. - - - The source collection to process. - - - Ignored. - - - The number of items in the source collection, - or zero if the collection is empty or null. - - - - - Implementation of the distinct processor. - - Aleksandar Seovic - - - - Returns distinct items from the collection. - - - The source collection to process. - - - 0: boolean flag specifying whether to include null - in the results or not. Default is false, which means that - null values will not be included in the results. - - - A collection containing distinct source collection elements. - - - If there is more than one argument, or if the single optional argument - is not Boolean. - - - - - Implementation of the maximum aggregator. - - Aleksandar Seovic - - - - Returns the largest item in the source collection. - - - The source collection to process. - - - Ignored. - - - The largest item in the source collection. - - - - - Implementation of the minimum aggregator. - - Aleksandar Seovic - - - - Returns the smallest item in the source collection. - - - The source collection to process. - - - Ignored. - - - The smallest item in the source collection. - - - - - Implementation of the non-null processor. - - Aleksandar Seovic - - - - Returns non-null items from the collection. - - - The source collection to process. - - - Ignored. - - - A collection containing non-null source collection elements. - - - - - Implementation of the 'order by' processor. - - Aleksandar Seovic - Erich Eichinger - - - - Sorts the source collection using custom sort criteria. - - - Please note that your compare function needs to take care about - proper conversion of types to be comparable! - - - The source collection to sort. - - - Sort criteria to use. - - - A sorted array containing collection elements. - - - - - Reverts order of elements in the list - - Erich Eichinger - - - - Processes a list of source items and returns a result. - - - The source list to process. - - - An optional processor arguments array. - - - The processing result. - - - - - Implementation of the sort processor. - - Aleksandar Seovic - - - - Sorts the source collection. - - - Please not that this processor requires that collection elements - are of a uniform type and that they implement - interface. -

- If you want to perform custom sorting based on element properties - you should consider using instead. - - - The source collection to sort. - - - Ignored. - - - An array containing sorted collection elements. - - - If collection is not empty and it is - neither nor . - - - -

- Implementation of the sum aggregator. - - Aleksandar Seovic -
- - - Returns the sum of the numeric values in the source collection. - - - The source collection to process. - - - Ignored. - - - The sum of the numeric values in the source collection. - - - - - Represents parsed method node in the navigation expression. - - Aleksandar Seovic - - - - Base type for nodes that accept arguments. - - Aleksandar Seovic - - - - Base type for all expression nodes. - - Aleksandar Seovic - - - - For internal purposes only. Use for expression node implementations. - - - This class is only required to enable serialization of parsed Spring expressions since antlr.CommonAST - unfortunately is not marked as [Serializable].
-
- Note:Since SpringAST implements , deriving classes - have to explicitely override if they need to persist additional - data during serialization. -
-
- - - The global SpringAST node factory - - - - - Create an instance - - - - - Create an instance from a token - - - - - initialize this instance from an AST - - - - - initialize this instance from an IToken - - - - - initialize this instance from a token type number and a text - - - - - sets the text of this node - - - - - gets the text of this node - - - - - Create a new instance from SerializationInfo - - - - - populate SerializationInfo from this instance - - - - - gets or sets the token type of this node - - - - - gets or sets the text of this node - - - - - Interface that all navigation expression nodes have to implement. - - Aleksandar Seovic - - - - Returns expression value. - - Value of the expression. - - - - Returns expression value. - - Object to evaluate expression against. - Value of the expression. - - - - Returns expression value. - - Object to evaluate expression against. - Expression variables map. - Value of the expression. - - - - Sets expression value. - - Object to evaluate expression against. - New value for the last node of the expression. - - - - Sets expression value. - - Object to evaluate expression against. - Expression variables map. - New value for the last node of the expression. - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns node's value. - - Node's value. - - - - Returns node's value for the given context. - - Object to evaluate node against. - Node's value. - - - - Returns node's value for the given context. - - Object to evaluate node against. - Expression variables map. - Node's value. - - - - This is the entrypoint into evaluating this expression. - - - - - Called internally during expression evaluation - - Object to evaluate node against. - Current expression evaluation context. - - - - - Returns node's value for the given context. - - Node's value. - - - - Sets node's value for the given context. - - Object to evaluate node against. - New value for this node. - - - - Sets node's value for the given context. - - Object to evaluate node against. - Expression variables map. - New value for this node. - - - - This is the entrypoint into evaluating this expression. - - - - - Called internally during expression evaluation. - - - - - Sets node's value for the given context. - - -

- This is a default implementation of Set method, which - simply throws . -

-

- This was done in order to avoid redundant Set method implementations, - because most of the node types do not support value setting. -

-
-
- - - Returns a string representation of this node instance. - - - - - Holds the state during evaluating an expression. - - - - - Gets/Sets the root context of the current evaluation - - - - - Gets/Sets the current context of the current evaluation - - - - - Gets/Sets global variables of the current evaluation - - - - - Gets/Sets local variables of the current evaluation - - - - - Initializes a new EvaluationContext instance. - - The root context for this evaluation - dictionary of global variables used during this evaluation - - - - Switches current ThisContext. - - - - - Switches current LocalVariables. - - - - - Gets the type of the - - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Initializes the node. - - - - - Asserts the argument count. - - The required count. - - - - Resolves the arguments. - - Current expression evaluation context. - An array of argument values - - - - Resolves the named arguments. - - Current expression evaluation context. - A dictionary of argument name to value mappings. - - - - Resolves the argument. - - Argument position. - Current expression evaluation context. - Resolved argument value. - - - - Resolves the named argument. - - Argument name. - Current expression evaluation context. - Resolved named argument value. - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Creates new instance of the type defined by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed assignment node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Assigns value of the right operand to the left one. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed attribute node in the navigation expression. - - Aleksandar Seovic - - - - Represents parsed method node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Creates new instance of the type defined by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Determines the type of object that should be instantiated. - - - The type name to resolve. - - - The type of object that should be instantiated. - - - If the type cannot be resolved. - - - - - Initializes this node by caching necessary constructor and property info. - - - - - - - Sets the named arguments (properties). - - Instance to set property values on. - Argument (property) name to value mappings. - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Tries to determine attribute type based on the specified - attribute type name. - - - Attribute type name to resolve. - - - Resolved attribute type. - - - If type cannot be resolved. - - - - - Base class for unary operators. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Gets the left operand. - - The left operand. - - - - Gets the right operand. - - The right operand. - - - - Represents parsed boolean literal node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the boolean literal node. - - - This is the entrypoint into evaluating this expression. - - Node's value. - - - - Represents parsed node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns node's value for the given context. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed default node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns left operand if it is not null, or the right operand if it is. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Container object for the parsed expression. - - -

- Preparing this object once and reusing it many times for expression - evaluation can result in significant performance improvements, as - expression parsing and reflection lookups are only performed once. -

-
- Aleksandar Seovic -
- - - Initializes a new instance of the class - by parsing specified expression string. - - Expression to parse. - - - - Registers lambda expression under the specified . - - Function name to register expression as. - Lambda expression to register. - Variables dictionary that the function will be registered in. - - - - Initializes a new instance of the class - by parsing specified primary expression string. - - Primary expression to parse. - - - - Initializes a new instance of the class - by parsing specified property expression string. - - Property expression to parse. - - - - Initializes a new instance of the class. - - - - - Create a new instance from SerializationInfo - - - - - Evaluates this expression for the specified root object and returns - value of the last node. - - Context to evaluate expressions against. - Current expression evaluation context. - Value of the last node. - - - - Evaluates this expression for the specified root object and sets - value of the last node. - - Context to evaluate expressions against. - Current expression evaluation context. - Value to set last node to. - If navigation expression is empty. - - - - Evaluates this expression for the specified root object and returns - of the last node, if possible. - - Context to evaluate expression against. - Expression variables map. - Value of the last node. - - - - Contains a list of reserved variable names. - You must not use any variable names with the reserved prefix! - - - - - Variable Names using this prefix are reserved for internal framework use - - - - - variable name of the currently processed object factory, if any - - - - - Converts string representation of expression into an instance of . - - Aleksandar Seovic - - - - Can we convert from a the sourcetype to a ? - - -

- Currently only supports conversion from a instance. -

-
- - A - that provides a format context. - - - A that represents the - you want to convert from. - - if the conversion is possible. -
- - - Convert from a value to an - instance. - - - A - that provides a format context. - - - The to use - as the current culture. - - - The value that is to be converted. - - - A array if successful. - - - - - Utility class that enables easy expression evaluation. - - -

- This class allows users to get or set properties, execute methods, and evaluate - logical and arithmetic expressions. -

-

- Methods in this class parse expression on every invocation. - If you plan to reuse the same expression many times, you should prepare - the expression once using the static method, - and then call to evaluate it. -

-

- This can result in significant performance improvements as it avoids expression - parsing and node resolution every time it is called. -

-

-

-
- Aleksandar Seovic -
- - - Parses and evaluates specified expression. - - Root object. - Expression to evaluate. - Value of the last node in the expression. - - - - Parses and evaluates specified expression. - - Root object. - Expression to evaluate. - Expression variables map. - Value of the last node in the expression. - - - - Parses and specified expression and sets the value of the - last node to the value of the newValue parameter. - - Root object. - Expression to evaluate. - Value to set last node to. - - - - Parses and specified expression and sets the value of the - last node to the value of the newValue parameter. - - Root object. - Expression to evaluate. - Expression variables map. - Value to set last node to. - - - - Represents parsed expression list node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a result of the last expression in a list. - - Context to evaluate expressions against. - Current expression evaluation context. - Result of the last expression in a list - - - - Represents parsed function node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Evaluates function represented by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Result of the function evaluation. - - - - Represents parsed hexadecimal integer literal node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the hexadecimal integer literal node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed indexer node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns node's value for the given context. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Sets node's value for the given context. - - Context to evaluate expressions against. - Current expression evaluation context. - New value for this node. - - - - Utility method that is needed by ObjectWrapper and AbstractAutowireCapableObjectFactory. - - Context to resolve property against. - Expression variables map. - PropertyInfo for this node. - - - - Represents parsed integer literal node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the integer literal node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents lambda expression. - - Aleksandar Seovic - - - - caches argumentNames of this instance - - - - - caches body expression of this lambda function - - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Assigns value of the right operand to the left one. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Returns Lambda Expression's value for the given context. - - Context to evaluate expressions against. - Current expression evaluation context. - A dictionary containing argument map for this lambda expression. - Node's value. - - - - Gets argument names for this lambda expression. - - - - - Represents parsed list initializer node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Creates new instance of the list defined by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents local function node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Evaluates function represented by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Result of the function evaluation. - - - - Represents parsed variable node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns value of the local variable represented by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Sets value of the local variable represented by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - New value for this node. - - - - Represents parsed map entry node. - - Aleksandar Seovic - - - - Creates a new instance of . - - - - - Create a new instance from SerializationInfo - - - - - Creates new instance of the map entry defined by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed map initializer node in the navigation expression. - - Aleksandar Seovic - - - - Creates a new instance of . - - - - - Create a new instance from SerializationInfo - - - - - Creates new instance of the map defined by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed method node in the navigation expression. - - Aleksandar Seovic - - - - Static constructor. Initializes a map of special collection processor methods. - - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns node's value for the given context. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Gets the best method given the name, argument values, for a given type. - - The type on which to search for the method. - Name of the method. - The binding flags. - The arg values. - Best matching method or null if none found. - - - - Represents parsed named argument node in the expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns the value of the named argument defined by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed null literal node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the null literal node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents arithmetic addition operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the arithmetic addition operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents logical AND operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical AND operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents logical BETWEEN operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical IN operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - - true if the left operand is contained within the right operand, false otherwise. - - - - - Represents arithmetic division operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the arithmetic division operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents logical equality operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical equality operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents logical "greater than" operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical "greater than" operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents logical "greater than or equal" operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical "greater than or equal" operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents logical IN operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical IN operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - - true if the left operand is contained within the right operand, false otherwise. - - - - - Represents logical IS operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical IS operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - - true if the left operand is contained within the right operand, false otherwise. - - - - - Represents logical "less than" operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical "less than" operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents logical "less than or equal" operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical "less than or equal" operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents VB-style logical LIKE operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical LIKE operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - - true if the left operand matches the right operand, false otherwise. - - - - - Represents logical MATCHES operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical MATCHES operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - - true if the left operand matches the right operand, false otherwise. - - - - - Represents arithmetic modulus operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the arithmetic modulus operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents arithmetic multiplication operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the arithmetic multiplication operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents logical NOT operator. - - Aleksandar Seovic - - - - Base class for unary operators. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Gets the operand. - - The operand. - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical NOT operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents logical inequality operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical inequality operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents logical OR operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the logical OR operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents arithmetic exponent operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the arithmetic exponent operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents arithmetic subtraction operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the arithmetic subtraction operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents unary minus operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the unary plus operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents unary plus operator. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the unary plus operator node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed projection node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a containing results of evaluation - of projection expression against each node in the context. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents node that navigates to object's property or public field. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Initializes the node. - - The parent. - - - - Attempts to resolve property or field. - - - Type to search for a property or a field. - - - Property or field name. - - - Binding flags to use. - - - Resolved property or field accessor, or null - if specified cannot be resolved. - - - - - Returns node's value for the given context. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Sets node's value for the given context. - - Context to evaluate expressions against. - Current expression evaluation context. - New value for this node. - - - - Retrieves property or field value. - - Context to evaluate expressions against. - Current expression evaluation context. - Property or field value. - - - - Sets property value, doing any type conversions that are necessary along the way. - - Context to evaluate expressions against. - Current expression evaluation context. - New value for this node. - - - - Sets property or field value using either dynamic or standard reflection. - - Object to evaluate node against. - New value for this node, converted to appropriate type. - - - - In the case of read only collections or custom collections that are not assignable from - IList, try to add to the collection. - - Context to evaluate expressions against. - Current expression evaluation context. - New value for this node. - true if was able add to IList, IDictionary, or ISet - - - - Utility method that is needed by ObjectWrapper and AbstractAutowireCapableObjectFactory. - We try as hard as we can, but there are instances when we won't be able to obtain PropertyInfo... - - Context to resolve property against. - PropertyInfo for this node. - - - - Gets a value indicating whether this node represents a property. - - - true if this node is a property; otherwise, false. - - - - - Gets a value indicating whether this node represents a field. - - - true if this node is a field; otherwise, false. - - - - - Represents parsed named argument node in the expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns the value of the named argument defined by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Overrides getText to allow easy way to get fully - qualified identifier. - - - Fully qualified identifier as a string. - - - - - Represents parsed real literal node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the real literal node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents a reference to a Spring-managed object. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the integer literal node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed selection node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns the first context item that matches selection expression. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed selection node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns the last context item that matches selection expression. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed selection node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a containing results of evaluation - of selection expression against each node in the context. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed string literal node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the string literal node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Exception thrown when detecting invalid SpEL syntax - - Erich Eichinger - - - - TODO - - - - - TODO - - - - - - - - - - - - - - - - - - - - Gets a message that provides details on the syntax error. - - - - - The expression that caused the error - - - - - Represents ternary expression node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns a value for the string literal node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed type node in the navigation expression. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns node's value for the given context. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Represents parsed variable node. - - Aleksandar Seovic - - - - Create a new instance - - - - - Create a new instance from SerializationInfo - - - - - Returns value of the variable represented by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - Node's value. - - - - Sets value of the variable represented by this node. - - Context to evaluate expressions against. - Current expression evaluation context. - New value for this node. - - - - Implementation of that can be used to - format and parse boolean values. - - Erich Eichinger - - - - Interface that should be implemented by all formatters. - - - - Formatters assume that source value is a string, and make no assumptions - about the target value's type, which means that Parse method can return - object of any type. - - - Aleksandar Seovic - - - - Formats the specified value. - - The value to format. - Formatted . - - - - Parses the specified value. - - The value to parse. - Parsed . - - - - Initializes a new instance of the class - using default values - - - - - Initializes a new instance of the class - - - - - Formats the specified boolean value. - - The value to format. - Formatted boolean value. - If is null. - If is not of type . - - - - Parses the specified boolean value according to settings of and - - The boolean value to parse. - Parsed boolean value as a . - If does not match or . - - - - Set/Get value to control casesensitivity of - - - Defaults to true - - - - - Set/Get value to recognize as boolean "true" value - - - Defaults to - - - - - Set/Get value to recognize as boolean "false" value - - - Defaults to - - - - - Implementation of that can be used to - format and parse currency values. - - - - CurrencyFormatter uses currency related properties of the - to format and parse currency values. - - - If you use one of the constructors that accept culture as a parameter - to create an instance of CurrencyFormatter, default NumberFormatInfo - for the specified culture will be used. - - - You can also use properties exposed by the CurrencyFormatter in order - to override some of the default currency formatting parameters. - - - Aleksandar Seovic - - - - Initializes a new instance of the class - using default for the current thread's culture. - - - - - Initializes a new instance of the class - using default for the specified culture. - - The culture name. - - - - Initializes a new instance of the class - using default for the specified culture. - - The culture. - - - - Initializes a new instance of the class - using specified . - - - The instance that defines how - currency values are formatted. - - - - - Formats the specified currency value. - - The value to format. - Formatted currency . - If is null. - If is not a number. - - - - Parses the specified currency value. - - The currency value to parse. - Parsed currency value as a . - - - - Gets or sets the currency decimal digits. - - The currency decimal digits. - - - - - Gets or sets the currency decimal separator. - - The currency decimal separator. - - - - - Gets or sets the currency group sizes. - - The currency group sizes. - - - - - Gets or sets the currency group separator. - - The currency group separator. - - - - - Gets or sets the currency symbol. - - The currency symbol. - - - - - Gets or sets the currency negative pattern. - - The currency negative pattern. - - - - - Gets or sets the currency positive pattern. - - The currency positive pattern. - - - - - Implementation of that can be used to - format and parse values. - - - - DateTimeFormatter uses properties of the - to format and parse values. - - - If you use one of the constructors that accept culture as a parameter - to create an instance of DateTimeFormatter, default DateTimeFormatInfo - for the specified culture will be used. - - - You can also use properties exposed by the DateTimeFormatter in order - to override some of the default formatting parameters. - - - Aleksandar Seovic - - - - Initializes a new instance of the class - using default for the current thread's culture. - - Date/time format string. - - - - Initializes a new instance of the class - using default for the specified culture. - - Date/time format string. - The culture name. - - - - Initializes a new instance of the class - using default for the specified culture. - - Date/time format string. - The culture. - - - - Formats the specified value. - - The value to format. - Formatted value. - If is null. - If is not an instance of . - - - - Parses the specified value. - - The string to parse. - Parsed value. - - - - Provides base functionality for filtering values before they actually get parsed/formatted. - - Erich Eichinger - - - - Creates a new instance of this FilteringFormatter. - - an optional underlying formatter - - If no underlying formatter is specified, the values - get passed through "as-is" after being filtered - - - - - Parses the specified value. - - The value to parse. - Parsed . - - - - Formats the specified value. - - The value to format. - Formatted . - - - - Allows to rewrite a value before it gets parsed by the underlying formatter - - - - - Allows to change a value before it gets formatted by the underlying formatter - - - - - Implementation of that can be used to - format and parse floating point numbers. - - - - This formatter allows you to format and parse numbers that conform - to number style (leading and trailing - white space, leading sign, decimal point, exponent). - - - Aleksandar Seovic - - - - Default format string. - - - - - Initializes a new instance of the class, - using default format string of '{0:F}' and current thread's culture. - - - - - Initializes a new instance of the class, - using specified format string and current thread's culture. - - The format string. - - - - Initializes a new instance of the class, - using default format string of '{0:F}' and specified culture. - - The culture. - - - - Initializes a new instance of the class, - using specified format string and current thread's culture. - - The format string. - The culture name. - - - - Initializes a new instance of the class, - using specified format string and culture. - - The format string. - The culture. - - - - Formats the specified float value. - - The value to format. - Formatted floating point number. - If is null. - If is not a number. - - - - Parses the specified float value. - - The float value to parse. - Parsed float value as a . - - - - Replaces input strings with a given default value, - if they are null or contain whitespaces only, - - Erich Eichinger - - - - Creates a new instance of this HasTextFilteringFormatter using null as default value. - - an optional underlying formatter - - If no underlying formatter is specified, the values - get passed through "as-is" after being filtered - - - - - Creates a new instance of this HasTextFilteringFormatter. - - the default value to be returned, if input text doesn't contain text - an optional underlying formatter - - If no underlying formatter is specified, the values - get passed through "as-is" after being filtered - - - - - If value contains no text, it will be replaced by a defaultValue. - - - - - Implementation of that can be used to - format and parse integer numbers. - - - - This formatter allows you to format and parse numbers that conform - to number style (leading and trailing - white space, leading sign). - - - Aleksandar Seovic - - - - Initializes a new instance of the class, - using default format string of '{0:D}'. - - - - - Initializes a new instance of the class, - using specified format string. - - - - - Formats the specified integer value. - - The value to format. - Formatted integer number. - If is null. - If is not an integer number. - - - - Parses the specified integer value. - - The integer value to parse. - Parsed number value as a . - - - - Implementation of that simply calls . - - - This formatter is a no-operation implementation. - - Erich Eichinger - - - - Initializes a new instance of the class. - - - - - Converts the passed value to a string by calling . - - The value to convert. - to string converted value. - - - - Returns the passed string "as is". - - The value to return. - The value passed into this method. - - - - Implementation of that can be used to - format and parse numbers. - - - - NumberFormatter uses number-related properties of the - to format and parse numbers. - - - This formatter works with both integer and decimal numbers and allows - you to format and parse numbers that conform to - number style (leading and trailing white space and/or sign, thousands separator, - decimal point) - - - If you use one of the constructors that accept culture as a parameter - to create an instance of NumberFormatter, default NumberFormatInfo - for the specified culture will be used. - - - You can also use properties exposed by the NumberFormatter in order - to override some of the default number formatting parameters. - - - Aleksandar Seovic - - - - Initializes a new instance of the class - using default for the current thread's culture. - - - - - Initializes a new instance of the class - using default for the specified culture. - - The culture name. - - - - Initializes a new instance of the class - using default for the specified culture. - - The culture. - - - - Initializes a new instance of the class - using specified . - - - The instance that defines how - numbers are formatted and parsed. - - - - - Formats the specified number value. - - The value to format. - Formatted number . - If is null. - If is not a number. - - - - Parses the specified number value. - - The number value to parse. - Parsed number value as a . - - - - Gets or sets the number of decimal digits. - - The number of decimal digits. - - - - - Gets or sets the decimal separator. - - The decimal separator. - - - - - Gets or sets the number group sizes. - - The number group sizes. - - - - - Gets or sets the number group separator. - - The number group separator. - - - - - Gets or sets the negative pattern. - - The number negative pattern. - - - - - Implementation of that can be used to - format and parse numbers. - - - - PercentFormatter uses percent-related properties of the - to format and parse percentages. - - - If you use one of the constructors that accept culture as a parameter - to create an instance of PercentFormatter, default NumberFormatInfo - for the specified culture will be used. - - - You can also use properties exposed by the PercentFormatter in order - to override some of the default number formatting parameters. - - - Aleksandar Seovic - - - - Initializes a new instance of the class - using default for the current thread's culture. - - - - - Initializes a new instance of the class - using default for the specified culture. - - The culture name. - - - - Initializes a new instance of the class - using default for the specified culture. - - The culture. - - - - Initializes a new instance of the class - using specified . - - - The instance that defines how - numbers are formatted and parsed. - - - - - Formats the specified percentage value. - - The value to format. - Formatted percentage. - If is null. - If is not a number. - - - - Parses the specified percentage value. - - The percentage value to parse. - Parsed percentage value as a . - - - - Gets or sets the number of decimal digits. - - The number of decimal digits. - - - - - Gets or sets the decimal separator. - - The decimal separator. - - - - - Gets or sets the percent group sizes. - - The percent group sizes. - - - - - Gets or sets the percent group separator. - - The percent group separator. - - - - - Gets or sets the negative pattern. - - The percent negative pattern. - - - - - Gets or sets the positive pattern. - - The percent positive pattern. - - - - - Gets or sets the percent symbol. - - The percent symbol. - - - - - Gets or sets the per mille symbol. - - The per mille symbol. - - - - - Loads a list of resources that should be applied from the .NET . - - -

- This implementation will iterate over all resource managers - within the message source and return a list of all the resources whose name starts with '$this'. -

-

- All other resources will be ignored, but you can retrieve them by calling one of - GetMessage methods on the message source directly. -

-
- Aleksandar Seovic -
- - - Abstract base class that all localizers should extend - - -

- This class contains the bulk of the localizer logic, including implementation - of the ApplyResources methods that are defined in - interface. -

-

- All specific localizers need to do is inherit this class and implement - GetResources method that will return a list of - objects that should be applied to a specified target. -

-

- Custom implementations can use whatever type of resource storage they want, - such as standard .NET resource sets, custom XML files, database, etc. -

-
- Aleksandar Seovic -
- - - Defines an interface that localizers have to implement. - - -

- Localizers are used to automatically apply resources to object's members - using reflection. -

-
- Aleksandar Seovic -
- - - Applies resources of the specified culture to the specified target object. - - Target object to apply resources to. - instance to retrieve resources from. - Resource culture to use for resource lookup. - - - - Applies resources to the specified target object, using current thread's culture to resolve resources. - - Target object to apply resources to. - instance to retrieve resources from. - - - - Gets or sets the resource cache instance. - - The resource cache instance. - - - - Applies resources of the specified culture to the specified target object. - - Target object to apply resources to. - instance to retrieve resources from. - Resource culture to use for resource lookup. - - - - Applies resources to the specified target object, using current thread's uiCulture to resolve resources. - - Target object to apply resources to. - instance to retrieve resources from. - - - - Returns a list of instances that should be applied to the target. - - Target to get a list of resources for. - instance to retrieve resources from. - Resource locale. - A list of resources to apply. - - - - Loads resources from the storage and creates a list of instances that should be applied to the target. - - Target to get a list of resources for. - instance to retrieve resources from. - Resource locale. - A list of resources to apply. - - - - Gets or sets the resource cache instance. - - The resource cache instance. - - - - Loads resources from the storage and creates a list of instances that should be applied to the target. - - - This feature is not currently supported on version 1.0 of the .NET platform. - - Target to get a list of resources for. - instance to retrieve resources from. - Resource locale. - A list of resources to apply. - - - - implementation - that simply returns the - value of the - - property (if said property value is not ), or the - of the current thread if it is - . - - Aleksandar Seovic - - - - Strategy interface for - resolution. - - Aleksandar Seovic - - - - Resolves the - from some context. - - -

- The 'context' is determined by the appropriate implementation class. - An example of such a context might be a thread local bound - , or a - sourced from an HTTP - session. -

-
- - The that should be used - by the caller. - -
- - - Sets the . - - -

- This is an optional operation and does not need to be implemented - such that it actually does anything useful (i.e. it can be a no-op). -

-
- - The new or - to clear the current . - -
- - - Returns the default . - - -

- It tries to get the - from the value of the - - property and falls back to the of the - current thread if the - - is . -

-
- - The default - -
- - - Resolves the - from some context. - - -

- The 'context' in this implementation is the - value of the - - property (if said property value is not ), or the - of the current thread if it is - . -

-
- - The that should be used - by the caller. - -
- - - Sets the . - - - The new or - to clear the current . - - - - - - - The default . - - - The default . - - - - - Abstract base class that all resource cache implementations should extend. - - Aleksandar Seovic - - - - Defines an interface that resource cache adapters have to implement. - - Aleksandar Seovic - - - - Gets the list of resources from cache. - - Target to get a list of resources for. - Resource culture. - A list of cached resources for the specified target object and culture. - - - - Puts the list of resources in the cache. - - Target to cache a list of resources for. - Resource culture. - A list of resources to cache. - A list of cached resources for the specified target object and culture. - - - - Gets the list of resources from the cache. - - Target to get a list of resources for. - Resource culture. - A list of cached resources for the specified target object and culture. - - - - Puts the list of resources in the cache. - - Target to cache a list of resources for. - Resource culture. - A list of resources to cache. - A list of cached resources for the specified target object and culture. - - - - Crates resource cache key for the specified target object and culture. - - Target object to apply resources to. - Resource culture to use for resource lookup. - - - - Gets the list of resources from cache. - - Cache key to use for lookup. - A list of cached resources for the specified target object and culture. - - - - Puts the list of resources in the cache. - - Cache key to use for the specified resources. - A list of resources to cache. - A list of cached resources for the specified target object and culture. - - - - Resource cache implementation that doesn't cache resources. - - Aleksandar Seovic - - - - Gets the list of resources from cache. - - Cache key to use for lookup. - Always returns null. - - - - Puts the list of resources in the cache. - - Cache key to use for the specified resources. - A list of resources to cache. - - - - Holds mapping between control property and it's value - as read from the resource file. - - Aleksandar Seovic - - - - Creates instance of resource mapper. - - Target property. - Resource value. - - - - Gets parsed target property expression. See - for more information on object navigation expressions. - - - - - Value of the resource that target property should be set to. - - - - - Utility class to aid in the manipulation of events and delegates. - - Griffin Caprio - - - - Returns a new instance of the requested . - - -

- Often used to wire subscribers to event publishers. -

-
- - The of delegate to create. - - - The target subscriber object that contains the delegate implementation. - - - referencing the delegate method on the subscriber. - - - A delegate handler that can be added to an events list of handlers, or called directly. - -
- - - Queries the input type for a signature matching the input - signature. - - - Typically used to query a potential subscriber to see if they implement an event handler. - - to match against - to query - - matching input - signature, or if there is no match. - - - - - Creates a new instance of the EventManipulationUtilities class. - - -

- This is a utility class, and as such has no publicly visible constructors. -

-
-
- - - Default implementation of the - interface. - - Griffin Caprio - - - - Creates a new instance of the EventRegistry class. - - - - - Adds the input object to the list of publishers. - - - This publishes all events of the source object to any object - wishing to subscribe - - The source object to publish. - - - - Subscribes to all events published, if the subscriber implements - compatible handler methods. - - The subscriber to use. - - - - Subscribes to published events of all objects of a given type, if the - subscriber implements compatible handler methods. - - The subscriber to use. - - The target to subscribe to. - - - - - Unsubscribes to all events published, if the subscriber - implmenets compatible handler methods. - - The subscriber to use - - - - Unsubscribes to the published events of all objects of a given - , if the subscriber implements - compatible handler methods. - - The subscriber to use. - The target to unsubscribe from - - - - The list of event publishers. - - The list of event publishers. - - - - To be implemented by any object that wishes to receive a reference to - an . - - -

- This interface only applies to objects that have been instantiated - within the context of an - . This interface does - not typically need to be implemented by application code, but is rather - used by classes internal to Spring.NET. -

-
- Mark Pollack - Rick Evans -
- - - Set the - associated with the - that created this - object. - - -

- This property will be set by the relevant - after all of this - object's dependencies have been resolved. This object can use the - supplied - immediately to publish or subscribe to one or more events. -

-
-
- - - Marks a property as being 'required': that is, the setter property - must be configured to be dependency-injected with a value. - - Consult the SDK documentation for , - which, by default, checks for the presence of this annotation. - - Rob Harrop - Mark Pollack - - - - A implementation that enforces required properties to have been configured. - Required properties are detected through an attribute, by default, Spring's - attribute. - - - The motivation for the existence of this IObjectPostProcessor is to allow - developers to annotate the setter properties of their own classes with an - arbitrary attribute to indicate that the container must check - for the configuration of a dependency injected value. This neatly pushes - responsibility for such checking onto the container (where it arguably belongs), - and obviates the need (in part) for a developer to code a method that - simply checks that all required properties have actually been set. - - Please note that an 'init' method may still need to implemented (and may - still be desirable), because all that this class does is enforce that a - 'required' property has actually been configured with a value. It does - not check anything else... In particular, it does not check that a - configured value is not null. - - - Rob Harrop - Juergen Hoeller - Mark Pollack (.NET) - - - - Adapter that implements all methods on - as no-ops, which will not change normal processing of each object instantiated - by the container. Subclasses may override merely those methods that they are - actually interested in. - - - Note that this base class is only recommendable if you actually require - functionality. If all you need - is plain functionality, prefer a straight - implementation of that (simpler) interface. - - Rod Johnson - Juergen Hoeller - Mark Pollack (.NET) - - - - Extension of the interface, - adding a callback for predicting the eventual type of a processed object. - - This interface is a special purpose interface, mainly for - internal use within the framework. In general, application-provided - post-processors should simply implement the plain - interface or derive from the - class. New methods might be added to this interface even in point releases. - - - Juergen Hoeller - Mark Pollack (.NET) - - - - Subinterface of - - that adds a before-instantiation callback. - - -

- Typical use cases might include being used to suppress the default - instantiation of specific target objects, perhaps in favour of creating - proxies with special Spring.Aop.ITargetSources (pooling targets, - lazily initializing targets, etc). -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Apply this - - before the target object gets instantiated. - - -

- The returned object may be a proxy to use instead of the target - object, effectively suppressing the default instantiation of the - target object. -

-

- If the object is returned by this method is not - , the object creation process will be - short-circuited. The returned object will not be processed any - further; in particular, no further - - callbacks will be applied to it. This mechanism is mainly intended - for exposing a proxy instead of an actual target object. -

-

- This callback will only be applied to object definitions with an - object class. In particular, it will not be applied to - objects with a "factory-method" (i.e. objects that are to be - instantiated via a layer of indirection anyway). -

-
- - The of the target object that is to be - instantiated. - - - The name of the target object. - - - The object to expose instead of a default instance of the target - object. - - - In the case of any errors. - - - -
- - - Perform operations after the object has been instantiated, via a constructor or factory method, - but before Spring property population (from explicit properties or autowiring) occurs. - - The object instance created, but whose properties have not yet been set - Name of the object. - true if properties should be set on the object; false if property population - should be skipped. Normal implementations should return true. Returning false will also - prevent any subsequent InstantiationAwareObjectPostProcessor instances from being - invoked on this object instance. - - - - Post-process the given property values before the factory applies them - to the given object. - - Allows for checking whether all dependencies have been - satisfied, for example based on a "Required" annotation on bean property setters. - Also allows for replacing the property values to apply, typically through - creating a new MutablePropertyValues instance based on the original PropertyValues, - adding or removing specific values. - - - The property values that the factory is about to apply (never null). - he relevant property infos for the target object (with ignored - dependency types - which the factory handles specifically - already filtered out) - The object instance created, but whose properties have not yet - been set. - Name of the object. - The actual property values to apply to the given object (can be the - passed-in PropertyValues instances0 or null to skip property population. - - - - Predicts the type of the object to be eventually returned from this - processors callback. - - The raw Type of the object. - Name of the object. - The type of the object, or null if not predictable. - in case of errors - - - - Determines the candidate constructors to use for the given object. - - The raw Type of the object. - Name of the object. - The candidate constructors, or null if none specified - in case of errors - - - - Predicts the type of the object to be eventually returned from this - processors PostProcessBeforeInstantiation callback. - - The raw Type of the object. - Name of the object. - The type of the object, or null if not predictable. - in case of errors - - - - Determines the candidate constructors to use for the given object. - - The raw Type of the object. - Name of the object. - The candidate constructors, or null if none specified - in case of errors - - - - Apply this - - before the target object gets instantiated. - - -

- The returned object may be a proxy to use instead of the target - object, effectively suppressing the default instantiation of the - target object. -

-

- If the object is returned by this method is not - , the object creation process will be - short-circuited. The returned object will not be processed any - further; in particular, no further - - callbacks will be applied to it. This mechanism is mainly intended - for exposing a proxy instead of an actual target object. -

-

- This callback will only be applied to object definitions with an - object class. In particular, it will not be applied to - objects with a "factory-method" (i.e. objects that are to be - instantiated via a layer of indirection anyway). -

-
- - The of the target object that is to be - instantiated. - - - The name of the target object. - - - The object to expose instead of a default instance of the target - object. - - - In the case of any errors. - - - -
- - - Perform operations after the object has been instantiated, via a constructor or factory method, - but before Spring property population (from explicit properties or autowiring) occurs. - - The object instance created, but whose properties have not yet been set - Name of the object. - true if properties should be set on the object; false if property population - should be skipped. Normal implementations should return true. Returning false will also - prevent any subsequent InstantiationAwareObjectPostProcessor instances from being - invoked on this object instance. - - - - Post-process the given property values before the factory applies them - to the given object. - - Allows for checking whether all dependencies have been - satisfied, for example based on a "Required" annotation on bean property setters. - Also allows for replacing the property values to apply, typically through - creating a new MutablePropertyValues instance based on the original PropertyValues, - adding or removing specific values. - - - The property values that the factory is about to apply (never null). - he relevant property infos for the target object (with ignored - dependency types - which the factory handles specifically - already filtered out) - The object instance created, but whose properties have not yet - been set. - Name of the object. - The actual property values to apply to the given object (can be the - passed-in PropertyValues instances0 or null to skip property population. - - - - Apply this - to the given new object instance before any object initialization callbacks. - - -

- The object will already be populated with property values. - The returned object instance may be a wrapper around the original. -

-
- - The new object instance. - - - The name of the object. - - - The object instance to use, either the original or a wrapped one. - - - In case of errors. - -
- - - Apply this to the - given new object instance after any object initialization callbacks. - - -

- The object will already be populated with property values. The returned object - instance may be a wrapper around the original. -

-
- - The new object instance. - - - The name of the object. - - - The object instance to use, either the original or a wrapped one. - - - In case of errors. - -
- - - Cache for validated object names, skipping re-validation for the same object - - - - - Post-process the given property values before the factory applies them - to the given object. Checks for the attribute specified by this PostProcessor's RequiredAttributeType. - - The property values that the factory is about to apply (never null). - The relevant property infos for the target object (with ignored - dependency types - which the factory handles specifically - already filtered out) - The object instance created, but whose properties have not yet - been set. - Name of the object. - - The actual property values to apply to the given object (can be the - passed-in PropertyValues instances or null to skip property population. - - If a required property value has not been specified - in the configuration metadata. - - - - Determines whether the supplied property is required to have a value, that is to be dependency injected. - - - This implementation looks for the existence of a "required" attribute on the supplied PropertyInfo and that - the property has a setter method. - - The target PropertyInfo - - true if the supplied property has been marked as being required;; otherwise, false if - not or if the supplied property does not have a setter method - - - - - Builds an exception message for the given list of invalid properties. - - The list of names of invalid properties. - Name of the object. - The exception message - - - - Sets the type of the required attribute, to be used on a property setter - - - The default required attribute type is the Spring-provided attribute. - This setter property exists so that developers can provide their own - (non-Spring-specific) annotation type to indicate that a property value is required. - - The type of the required attribute. - - - - Base class that provides common functionality needed for several IObjectFactoryPostProcessor - implementations - - Mark Pollack - - - - Allows for custom modification of an application context's object - definitions, adapting the object property values of the context's - underlying object factory. - - -

- Application contexts can auto-detect - IObjectFactoryPostProcessor objects in their object definitions and - apply them before any other objects get created. -

-

- Useful for custom config files targeted at system administrators that - override object properties configured in the application context. -

-

- See PropertyResourceConfigurer and its concrete implementations for - out-of-the-box solutions that address such configuration needs. -

-
- Juergen Hoeller - Rick Evans (.Net) -
- - - Modify the application context's internal object factory after its - standard initialization. - - -

- All object definitions will have been loaded, but no objects will have - been instantiated yet. This allows for overriding or adding properties - even to eager-initializing objects. -

-
- - The object factory used by the application context. - - - In case of errors. - -
- - - Modify the application context's internal object factory after its - standard initialization. - - The object factory used by the application context. - -

- All object definitions will have been loaded, but no objects will have - been instantiated yet. This allows for overriding or adding properties - even to eager-initializing objects. -

-
- - In case of errors. - -
- - - Resolves the supplied into a - instance. - - The object that is to be resolved into a - instance. - The error context source. - The error context string. - A resolved . - -

- This (default) implementation supports resolving - s and s. - Only override this method if you want to key your type alias - on something other than s - and s. -

-
- - If the supplied is , - or the supplied cannot be resolved. - -
- - - Return the order value of this object, with a higher value meaning - greater in terms of sorting. - - The order value. - - - - - Simple template superclass for - implementations that allows for the creation of a singleton or a prototype - instance (depending on a flag). - - - If the value of the - - property is (this is the default), this class - will create a single instance of it's object upon initialization and - subsequently return the singleton instance; else, this class will - create a new instance each time (prototype mode). Subclasses must - implement the - - template method to actually create objects. - - Juergen Hoeller - Keith Donald - Simon White (.NET) - - - - Interface to be implemented by objects used within an - that are themselves - factories. - - -

- If an object implements this interface, it is used as a factory, - not directly as an object. s - can support singletons and prototypes - ()... - please note that an - itself can only ever be a singleton. It is a logic error to configure an - itself to be a prototype. -

- - An object that implements this interface cannot be used as a normal object. - -
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) -
- - - Return an instance (possibly shared or independent) of the object - managed by this factory. - - - - If this method is being called in the context of an enclosing IoC container and - returns , the IoC container will consider this factory - object as not being fully initialized and throw a corresponding (and most - probably fatal) exception. - - - - An instance (possibly shared or independent) of the object managed by - this factory. - - - - - Return the of object that this - creates, or - if not known in advance. - - - - - Is the object managed by this factory a singleton or a prototype? - - - - - Invoked by an - after it has injected all of an object's dependencies. - - - In the event of misconfiguration (such as the failure to set a - required property) or if initialization fails. - - - - - - Return an instance (possibly shared or independent) of the object - managed by this factory. - - - An instance (possibly shared or independent) of the object managed by - this factory. - - - - - - Template method that subclasses must override to construct - the object returned by this factory. - - - Invoked once immediately after the initialization of this - in the case of - a singleton; else, on each call to the - - method. - - - If an exception occured during object creation. - - - A distinct instance of the object created by this factory. - - - - - Performs cleanup on any cached singleton object. - - -

- Only makes sense in the context of a singleton object. -

-
- - -
- - - Is the object managed by this factory a singleton or a prototype? - - -

- Please note that changing the value of this property after - this factory object instance has been created by an enclosing - Spring.NET IoC container really is a programming error. This - property should really only be set once, prior to the invocation - of the - - callback method. -

-
- -
- - - Return the of object that this - creates, or - if not known in advance. - - - - - - The various autowiring modes. - - Rick Evans - - - - Do not autowire. - - - - - Autowire by name. - - - - - Autowire by . - - - - - Autowiring by constructor. - - - - - The autowiring strategy is to be determined by introspection - of the object's . - - - - - Implementation of that - resolves variable name against command line arguments. - - Aleksandar Seovic - - - - Defines contract that different variable sources have to implement. - - -

- The "variable sources" are objects containing name-value pairs - that allow a variable value to be retrieved for the given name.

-

- Out of the box, Spring.NET supports a number of variable sources, - that allow users to obtain variable values from .NET config files, - Java-style property files, environment, registry, etc.

-

- Users can always write their own variable sources implementations, - that will allow them to load variable values from the database or - other proprietary data source.

-
- - - - - - - Aleksandar Seovic -
- - - Resolves variable value for the specified variable name. - - - The name of the variable to resolve. - - - The variable value if able to resolve, null otherwise. - - - - - Default constructor. - Initializes command line arguments from the environment. - - - - - Constructor that allows arguments to be passed externally. - Useful for testing. - - - - - Resolves variable value for the specified variable name. - - - The name of the variable to resolve. - - - The variable value if able to resolve, null otherwise. - - - - - Initializes command line arguments dictionary. - - - - - Gets or sets a prefix that should be used to - identify arguments to extract values from. - - - A prefix that should be used to identify arguments - to extract values from. Defaults to slash ("/"). - - - - - Gets or sets a character that should be used to - separate argument name from its value. - - - A character that should be used to separate argument - name from its value. Defaults to colon (":"). - - - - - Implementation of that - resolves variable name against name-value sections in - the standard .NET configuration file. - - Aleksandar Seovic - - - - Initializes a new instance of - - - - - Initializes a new instance of from the given - - - - - Initializes a new instance of from the given - - - - - Resolves variable value for the specified variable name. - - - The name of the variable to resolve. - - - The variable value if able to resolve, null otherwise. - - - - - Initializes properties based on the specified - property file locations. - - - - - Gets or sets a list of section names variables should be loaded from. - - - All sections specified need to be handled by the - in order to be processed successfully. - - - A list of section names variables should be loaded from. - - - - - Convinience property. Gets or sets a single section - to read properties from. - - - The section specified needs to be handled by the - in order to be processed successfully. - - - A section to read properties from. - - - - - Various utility methods for .NET style .config files. - - -

- Currently supports reading custom configuration sections and returning them as - objects. -

-
- Simon White - Mark Pollack -
- - - Reads the specified configuration section into a - . - - The resource to read. - The section name. - - A newly populated - . - - - If any errors are encountered while attempting to open a stream - from the supplied . - - - If any errors are encountered while loading or reading (this only applies to - v1.1 and greater of the .NET Framework) the actual XML. - - - If any errors are encountered while loading or reading (this only applies to - v1.0 of the .NET Framework). - - - If the configuration section was otherwise invalid. - - - - - Reads the specified configuration section into the supplied - . - - The resource to read. - The section name. - - The collection that is to be populated. May be - . - - - A newly populated - . - - - If any errors are encountered while attempting to open a stream - from the supplied . - - - If any errors are encountered while loading or reading (this only applies to - v1.1 and greater of the .NET Framework) the actual XML. - - - If any errors are encountered while loading or reading (this only applies to - v1.0 of the .NET Framework). - - - If the configuration section was otherwise invalid. - - - - - Reads the specified configuration section into the supplied - . - - The resource to read. - The section name. - - The collection that is to be populated. May be - . - - - If a key already exists, is its value to be appended to the current - value or replaced? - - - The populated - . - - - If any errors are encountered while attempting to open a stream - from the supplied . - - - If any errors are encountered while loading or reading (this only applies to - v1.1 and greater of the .NET Framework) the actual XML. - - - If any errors are encountered while loading or reading (this only applies to - v1.0 of the .NET Framework). - - - If the configuration section was otherwise invalid. - - - - - Read from the specified configuration from the supplied XML - into a - . - - - - Does not support section grouping. The supplied XML - must already be loaded. - - - - The to read from. - - - The configuration section name to read. - - - A newly populated - . - - - If any errors are encountered while reading (this only applies to - v1.1 and greater of the .NET Framework). - - - If any errors are encountered while reading (this only applies to - v1.0 of the .NET Framework). - - - If the configuration section was otherwise invalid. - - - - - Populates the supplied with values from - a .NET application configuration file. - - - The - to add any key-value pairs to. - - - The configuration section name in the a .NET application configuration - file. - - - If a key already exists, is its value to be appended to the current - value or replaced? - - - if the supplied - was found. - - - - - Creates a new instance of the ConfigurationReader class. - - -

- This is a utility class, and as such has no publicly visible - constructors. -

-
-
- - - Implementation of that - resolves variable name connection strings defined in - the standard .NET configuration file. - - -

- When the <connectionStrings> configuration section is processed by this class, - two variables are defined for each connection string: one for connection string and - the second one for the provider name.

-

- Variable names are generated by appending '.connectionString' and '.providerName' - literals to the value of the name attribute of the connection string element. - For example:

-
-            
-               
-            
-            
-

- will result in two variables being created: myConn.connectionString and myConn.providerName. - You can reference these variables within your object definitions, just like any other variable.

-
- Aleksandar Seovic -
- - - Resolves variable value for the specified variable name. - - - The name of the variable to resolve. - - - The variable value if able to resolve, null otherwise. - - - - - Initializes properties based on the specified - property file locations. - - - - - Holder for constructor argument values for an object. - - -

- Supports values for a specific index or parameter name (case - insensitive) in the constructor argument list, and generic matches by - . -

-
- Juergen Hoeller - Rick Evans (.NET) - -
- - - Can be used as an argument filler for the - - overload when one is not looking for an argument by index. - - - - - Creates a new instance of the - - class. - - - - - Creates a new instance of the - - class. - - - The - to be used to populate this instance. - - - - - Copy all given argument values into this object. - - - The - to be used to populate this instance. - - - - - Add argument value for the given index in the constructor argument list. - - - The index in the constructor argument list. - - - The argument value. - - - - - Add argument value for the given index in the constructor argument list. - - The index in the constructor argument list. - The argument value. - - The of the argument - . - - - - - Add argument value for the given name in the constructor argument list. - - The name in the constructor argument list. - The argument value. - - If the supplied is - or is composed wholly of whitespace. - - - - - Get argument value for the given index in the constructor argument list. - - The index in the constructor argument list. - - The required of the argument. - - - The - - for the argument, or if none set. - - - - - Get argument value for the given name in the constructor argument list. - - The name in the constructor argument list. - - The - - for the argument, or if none set. - - - - - Does this set of constructor arguments contain a named argument matching the - supplied name? - - - - The comparison is performed in a case-insensitive fashion. - - - The named argument to look up. - - if this set of constructor arguments - contains a named argument matching the supplied - name. - - - - - Add generic argument value to be matched by type. - - - The argument value. - - - - - Add generic argument value to be matched by type. - - The argument value. - - The of the argument - . - - - - - Look for a generic argument value that matches the given - . - - - The to match. - - - The - - for the argument, or if none set. - - - - - Look for a generic argument value that matches the given - . - - - The to match. - - - A of - - objects that have already been used in the current resolution - process and should therefore not be returned again; this allows one - to return the next generic argument match in the case of multiple - generic argument values of the same type. - - - The - - for the argument, or if none set. - - - - - Look for an argument value that either corresponds to the given index - in the constructor argument list or generically matches by - . - - - The index in the constructor argument list. - - - The to match. - - - The - - for the argument, or if none is set. - - - - - Look for an argument value that either corresponds to the given index - in the constructor argument list or generically matches by - . - - - The index in the constructor argument list. - - - The to match. - - - A of - - objects that have already been used in the current resolution - process and should therefore not be returned again; this allows one - to return the next generic argument match in the case of multiple - generic argument values of the same type. - - - The - - for the argument, or if none is set. - - - - - Look for an argument value that either corresponds to the given index - in the constructor argument list or generically matches by - . - - - The name of the argument in the constructor argument list. May be - , in which case generic matching by - is assumed. - - - The to match. - - - The - - for the argument, or if none is set. - - - - - Look for an argument value that either corresponds to the given index - in the constructor argument list or generically matches by - . - - - The name of the argument in the constructor argument list. May be - , in which case generic matching by - is assumed. - - - The to match. - - - A of - - objects that have already been used in the current resolution - process and should therefore not be returned again; this allows one - to return the next generic argument match in the case of multiple - generic argument values of the same type. - - - The - - for the argument, or if none is set. - - - - - Look for an argument value that either corresponds to the given index - in the constructor argument list, or to the named argument, or - generically matches by . - - - The index of the argument in the constructor argument list. May be - negative, to denote the fact that we are not looking for an - argument by index (see - . - - - The name of the argument in the constructor argument list. May be - . - - - The to match. - - - A of - - objects that have already been used in the current resolution - process and should therefore not be returned again; this allows one - to return the next generic argument match in the case of multiple - generic argument values of the same type. - - - The - - for the argument, or if none is set. - - - - - Return the map of indexed argument values. - - - An with - indices as keys and - s - as values. - - - - - Return the map of named argument values. - - - An with - named arguments as keys and - s - as values. - - - - - Return the set of generic argument values. - - - A of - s. - - - - - Return the number of arguments held in this instance. - - - - - Returns true if this holder does not contain any argument values, - neither indexed ones nor generic ones. - - - - - Holder for a constructor argument value, with an optional - attribute indicating the target - of the actual constructor argument. - - - - - Creates a new instance of the ValueHolder class. - - - The value of the constructor argument. - - - - - Creates a new instance of the ValueHolder class. - - - The value of the constructor argument. - - - The of the argument - . Can also be one of the common - aliases (int, bool, - float, etc). - - - - - A that represents the current - . - - - A that represents the current - . - - - - - Gets and sets the value for the constructor argument. - - -

- Only necessary for manipulating a registered value, for example in - s. -

-
-
- - - Return the of the constructor - argument. - - - - - - implementation that allows for convenient registration of custom - s. - - - - The use of this class is typically not required; the .NET - mechanism of associating a - with a - via the use of the - is the - recommended (and standard) way. This class primarily exists to cover - those cases where third party classes to which one does not have the - source need to be exposed to the type conversion mechanism. - -

- Because the - - class implements the - - interface, instances of this class that have been exposed in the - scope of an - will - automatically be picked up by the application context and made - available to the IoC container whenever type conversion is required. If - one is using a - - object definition within the scope of an - , no such automatic - pickup of the - - is performed (custom converters will have to be added manually using the - - method). For most application scenarios, one will get better - mileage using the - abstraction. -

-
- -

- The following examples all assume XML based configuration, and use - inner object definitions to define the custom - objects (nominally to - avoid polluting the object name space, but also because the - configuration simply reads better that way). -

- - - - - - - - - - - - - - - - -

- The following example illustrates a complete (albeit naieve) use case - for this class, including a custom - implementation, said - converters domain class, and the XML configuration that hooks the - converter in place and makes it available to a Spring.NET container for - use during object resolution. -

-

- The domain class is a simple data-only object that contains the data - required to send an email message (such as the host and user account - name). A developer would prefer to use a string of the form - UserName=administrator,Password=r1l0k1l3y,Host=localhost to - configure the mail settings and just let the container take care of the - conversion. -

- - namespace ExampleNamespace - { - public sealed class MailSettings - { - private string _userName; - private string _password; - private string _host; - - public string Host - { - get { return _host; } - set { _host = value; } - } - - public string UserName - { - get { return _userName; } - set { _userName = value; } - } - - public string Password - { - get { return _password; } - set { _password = value; } - } - } - - public sealed class MailSettingsConverter : TypeConverter - { - public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) - { - if (typeof (string) == sourceType) - { - return true; - } - return base.CanConvertFrom(context, sourceType); - } - - public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) - { - string text = value as string; - if(text != null) - { - MailSettings mailSettings = new MailSettings(); - string[] tokens = text.Split(','); - for (int i = 0; i < tokens.Length; ++i) - { - string token = tokens[i]; - string[] settings = token.Split('='); - typeof(MailSettings).GetProperty(settings[0]) - .SetValue(mailSettings, settings[1], null); - } - return mailSettings; - } - return base.ConvertFrom(context, culture, value); - } - } - - // a very naieve class that uses the MailSettings class... - public sealed class ExceptionLogger - { - private MailSettings _mailSettings; - - public MailSettings MailSettings { - { - set { _mailSettings = value; } - } - - public void Log(object value) - { - Exception ex = value as Exception; - if(ex != null) - { - // use _mailSettings instance... - } - } - } - } - -

- The attendant XML configuration for the above classes would be... -

- - - - - - - - - - - - - - - - Juergen Hoeller - Simon White (.NET) - - - - - - - Registers any custom converters with the supplied - . - - - The object factory to register the converters with. - - - In case of errors. - - - - - Resolves the supplied into a - instance. - - - The object that is to be resolved into a - instance. - - - A resolved instance. - - - If the supplied is , - or the supplied cannot be resolved. - - - - - The custom converters to register. - - -

- The uses the type name - of the class that requires conversion as the key, and an - instance of the - that will effect - the conversion. Alternatively, the actual - of the class that requires conversion - can be used as the key. -

-
- -

- - IDictionary converters = new Hashtable(); - converters.Add( "System.Date", new MyCustomDateConverter() ); - // a System.Type instance can also be used as the key... - converters.Add( typeof(Color), new MyCustomRBGColorConverter() ); - -

-
-
- - - implementation that - creates delegates. - - -

- Supports the creation of s for both - instance and methods. -

-
- Rick Evans -
- - - Callback method called once all factory properties have been set. - - - In the event of misconfiguration (such as failure to set an essential - property) or if initialization fails. - - - - - - Creates the delegate. - - - If an exception occured during object creation. - - The object returned by this factory. - - - - - The of - created by this factory. - - -

- Returns the - if accessed prior to the method - being called. -

-
-
- - - The of the - created by this factory. - - - - - The name of the method that is to be invoked by the created - delegate. - - - - - The target if the - refers to a method. - - - - - The target object if the - refers to an instance method. - - - - - Descriptor for a specific dependency that is about to be injected. - Wraps a constructor parameter, a method parameter or a field, - allowing unified access to their metadata. - - Juergen Hoeller - Mark Pollack - - - - Initializes a new instance of the class for a method or constructor parameter. - Considers the dependency as 'eager' - - The MethodParameter to wrap. - if set to true if the dependency is required. - - - - Initializes a new instance of the class for a method or a constructor parameter. - - The MethodParameter to wrap. - if set to true the dependency is required. - if set to true the dependency is 'eager' in the sense of - eagerly resolving potential target objects for type matching. - - - - Gets a value indicating whether this dependency is required. - - true if required; otherwise, false. - - - - Determine the declared (non-generic) type of the wrapped parameter/field. - - The type of the dependency (never null - - - - Gets a value indicating whether this is eager in the sense of - eagerly resolving potential target beans for type matching. - - true if eager; otherwise, false. - - - - Gets the wrapped MethodParameter, if any. - - The method parameter. - - - - Simple factory for shared instances. - - Juergen Hoeller - Simon White (.NET) - - - - Constructs a new instance of the target dictionary. - - The new instance. - - - - Set the source . - - -

- This value will be used to populate the - returned by this factory. -

-
-
- - - Set the of the - implementation to use. - - -

- The default is the . -

-
- - If the value is . - - - If the value is an . - - - If the value is an interface. - -
- - - The of objects created by this factory. - - - Always returns the . - - - - - Specifies how instances of the - - class must apply environment variables when replacing values. - - Mark Pollack - - - - Never replace environment variables. - - - - - If properties are not specified via a resource, - then resolve using environment variables. - - - - - Apply environment variables first before applying properties from a - resource. - - - - - Implementation of that - resolves variable name against environment variables. - - Aleksandar Seovic - - - - Resolves variable value for the specified variable name. - - - The name of the variable to resolve. - - - The variable value if able to resolve, null otherwise. - - - - - Holder for event handler values for an object. - - Rick Evans (.NET) - - - - The empty array of s. - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The - to be used to populate this instance. - - - - - Copy all given argument values into this object. - - - The - to be used to populate this instance. - - - - - Adds the supplied handler to the collection of event handlers. - - The handler to be added. - - - - The mapping of event names to an - of - s. - - - - - Gets the of events - that have handlers associated with them. - - - - - Gets the of - s for the supplied - event name. - - - - - Immutable placeholder class used for the value of a - object when it's a reference - to a Spring that should be evaluated at runtime. - - Aleksandar Seovic - - - - Creates a new instance of the - - class. - - The expression to resolve. - - - - Returns a string representation of this instance. - - A string representation of this instance. - - - - Gets or sets the expression string. Setting the expression string will cause - the expression to be parsed. - - The expression string. - - - - Return the expression. - - - - - Properties for this expression node. - - - - - implementation that - retrieves a static or non-static public field value. - - -

- Typically used for retrieving public constants. -

-
- -

- The following example retrieves the field value... -

- - - - - - -

- The previous example could also have been written using the convenience - - property, like so... -

- - - - - -

- This class also implements the - interface - (). - If the id (or name) of one's - - object definition is set to the - of the field to be retrieved, then the id (or - name) of one's object definition will be used for the name of the - field lookup. See below for an example of this - concise style of definition. -

- - - - - - - -

- The usage for retrieving instance fields is similar. No example is shown - because public instance fields are generally bad practice; but if - you have some legacy code that exposes public instance fields, or if you - just really like coding public instance fields, then you can use this - implementation to - retrieve such field values. -

- - Juergen Hoeller - Rick Evans (.NET) - - - - Interface to be implemented by objects that wish to be aware of their object - name in an . - - -

- Note that most objects will choose to receive references to collaborating - objects via respective properties. -

-

- For a list of all object lifecycle methods, see the - API documentation. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Set the name of the object in the object factory that created this object. - - - The name of the object in the factory. - - -

- Invoked after population of normal object properties but before an init - callback like 's - - method or a custom init-method. -

-
-
- - - Invoked by an - after it has set all object properties supplied - (and satisfied - and ApplicationContextAware). - - -

- This method allows the object instance to perform initialization only - possible when all object properties have been set and to throw an - exception in the event of misconfiguration. -

-
- - In the event of misconfiguration (such as failure to set an essential - property) or if initialization fails. - -
- - - Return an instance (possibly shared or independent) of the object - managed by this factory. - - - An instance (possibly shared or independent) of the object managed by - this factory. - - - - - - The of the - field to be retrieved. - - - - - Set the name of the object in the object factory that created this object. - - - The name of the object in the factory. - - -

- In the context of the - - class, the - - value will be interepreted as the value of the - - property if no value has been explicitly assigned to the - - property. This allows for concise object definitions with just an id or name; - see the class documentation for - - for an example of this style of usage. -

-
-
- - - The name of the field the value of which is to be retrieved. - - -

- If the - - has been set (and is not ), then the value of this property - refers to an instance field name; it otherwise refers to a - field name. -

-
-
- - - The object instance on which the field is defined. - - - - - The on which the field is defined. - - - - - The of object that this - creates, or - if not known in advance. - - - - - Is the object managed by this factory a singleton or a prototype? - - - - - Extension of the - interface to be implemented by object factories that are capable of - autowiring and expose this functionality for existing object instances. - - Juergen Hoeller - Rick Evans (.NET) - - - - Create a new object instance of the given class with the specified - autowire strategy. - - - The of the object to instantiate. - - - The desired autowiring mode. - - - Whether to perform a dependency check for objects (not applicable to - autowiring a constructor, thus ignored there). - - The new object instance. - - If the wiring fails. - - - - - - Autowire the object properties of the given object instance by name or - . - - - The existing object instance. - - - The desired autowiring mode. - - - Whether to perform a dependency check for the object. - - - If the wiring fails. - - - - - - Apply s - to the given existing object instance, invoking their - - methods. - - -

- The returned object instance may be a wrapper around the original. -

-
- - The existing object instance. - - - The name of the object. - - - The object instance to use, either the original or a wrapped one. - - - If any post-processing failed. - - -
- - - Apply s - to the given existing object instance, invoking their - - methods. - - -

- The returned object instance may be a wrapper around the original. -

-
- - The existing object instance. - - - The name of the object. - - - The object instance to use, either the original or a wrapped one. - - - If any post-processing failed. - - -
- - - Resolve the specified dependency against the objects defined in this factory. - - The descriptor for the dependency. - Name of the object which declares the present dependency. - A list that all names of autowired object (used for - resolving the present dependency) are supposed to be added to. - the resolved object, or null if none found - if dependency resolution failed - - - - Extension of the interface - that injects dependencies into the object managed by the factory. - - Bruno Baia - - - - Gets the template object definition that should be used - to configure the instance of the object managed by this factory. - - - - - SPI interface to be implemented by most if not all listable object factories. - - -

- Allows for framework-internal plug'n'play, e.g. in - . -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Configuration interface to be implemented by most if not all object - factories. - - -

- Provides the means to configure an object factory in addition to the - object factory client methods in the - interface. -

-

- Allows for framework-internal plug'n'play even when needing access to object - factory configuration methods. -

-

- When disposed, it will destroy all cached singletons in this factory. Call - when you want to shutdown - the factory. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Interface that defines a registry for shared object instances. - - - Can be implemented by - implementations in order to expose their singleton management facility - in a uniform manner. - - The interface extends this interface. - - - Juergen Hoeller - Mark Pollack (.NET) - - - - Registers the given existing object as singleton in the object registry, - under the given object name. - - - - The given instance is supposed to be fully initialized; the registry - will not perform any initialization callbacks (in particular, it won't - call IInitializingObject's AfterPropertiesSet method). - The given instance will not receive any destruction callbacks - (like IDisposable's Dispose method) either. - - - If running within a full IObjectFactory: Register an object definition - instead of an existing instance if your object is supposed to receive - initialization and/or destruction callbacks. - - - Typically invoked during registry configuration, but can also be used - for runtime registration of singletons. As a consequence, a registry - implementation should synchronize singleton access; it will have to do - this anyway if it supports a BeanFactory's lazy initialization of singletons. - - - Name of the object. - The singleton object. - - - - - - Return the (raw) singleton object registered under the given name. - - - - Only checks already instantiated singletons; does not return an Object - for singleton object definitions which have not been instantiated yet. - - - The main purpose of this method is to access manually registered singletons - . Can also be used to access a singleton - defined by an object definition that already been created, in a raw fashion. - - - Name of the object to look for. - the registered singleton object, or null if none found - - - - - Check if this registry contains a singleton instance with the given name. - - - - Only checks already instantiated singletons; does not return true - for singleton bean definitions which have not been instantiated yet. - - - The main purpose of this method is to check manually registered singletons - . Can also be used to check whether a - singleton defined by an object definition has already been created. - - - To check whether an object factory contains an object definition with a given name, - use ListableBeanFactory's ContainsObjectDefinition. Calling both - ContainsObjectDefinition and ContainsSingleton answers - whether a specific object factory contains an own object with the given name. - - - Use IObjectFactory's ContainsObject for general checks whether the - factory knows about an object with a given name (whether manually registered singleton - instance or created by bean definition), also checking ancestor factories. - - - Name of the object to look for. - - true if this bean factory contains a singleton instance with the given name; otherwise, false. - - - - - - - - Gets the names of singleton objects registered in this registry. - - - - Only checks already instantiated singletons; does not return names - for singleton bean definitions which have not been instantiated yet. - - - The main purpose of this method is to check manually registered singletons - . Can also be used to check which - singletons defined by an object definition have already been created. - - - The list of names as String array (never null). - - - - - - - Gets the number of singleton beans registered in this registry. - - - - Only checks already instantiated singletons; does not count - singleton object definitions which have not been instantiated yet. - - - The main purpose of this method is to check manually registered singletons - . Can also be used to count the number of - singletons defined by an object definition that have already been created. - - - The number of singleton objects. - - - - - - - Ignore the given dependency type for autowiring. - - -

- To be invoked during factory configuration. -

-

- This will typically be used for dependencies that are resolved - in other ways, like - through . -

-
- - The to be ignored. - -
- - - Determines whether the specified object name is currently in creation.. - - Name of the object. - - true if the specified object name is currently in creation; otherwise, false. - - - - - Add a new - that will get applied to objects created by this factory. - - -

- To be invoked during factory configuration. -

-
- - The - to register. - -
- - - Given an object name, create an alias. - - -

- This is typically used to support names that are illegal within - XML ids (which are used for object names). -

-

- Typically invoked during factory configuration, but can also be - used for runtime registration of aliases. Therefore, a factory - implementation should synchronize alias access. -

-
- The name of the object. - - - The alias that will behave the same as the object name. - - - If there is no object with the given name. - - - If the alias is already in use. - -
- - - Register the given custom - for all properties of the given . - - -

- To be invoked during factory configuration. -

-
- - The required of the property. - - - The to register. - -
- - - Set the parent of this object factory. - - -

- Note that the parent shouldn't be changed: it should only be set outside - a constructor if it isn't available when an object of this class is - created. -

-
-
- - - Returns the current number of registered - s. - - - The current number of registered - s. - - - - - Return the registered - for the - given object, allowing access to its property values and constructor - argument values. - - The name of the object. - - The registered - . - - - If there is no object with the given name. - - - In the case of errors. - - - - - Return the registered - for the - given object, allowing access to its property values and constructor - argument values. - - The name of the object. - Whether to search parent object factories. - - The registered - . - - - If there is no object with the given name. - - - In the case of errors. - - - - - Injects dependencies into the supplied instance - using the supplied . - - - The object instance that is to be so configured. - - - The name of the object definition expressing the dependencies that are to - be injected into the supplied instance. - - - An object definition that should be used to configure object. - - - - - - Ensure that all non-lazy-init singletons are instantiated, also - considering s. - - -

- Typically invoked at the end of factory setup, if desired. -

-

- As this is a startup method, it should destroy already created singletons if - it fails, to avoid dangling resources. In other words, after invocation - of that method, either all or no singletons at all should be - instantiated. -

-
- - If one of the singleton objects could not be created. - -
- - - Register a special dependency type with corresponding autowired value. - - - This is intended for factory/context references that are supposed - to be autowirable but are not defined as objects in the factory: - e.g. a dependency of type ApplicationContext resolved to the - ApplicationContext instance that the object is living in. - - Note there are no such default types registered in a plain IObjectFactory, - not even for the BeanFactory interface itself. - - - Type of the dependency to register. - This will typically be a base interface such as IObjectFactory, with extensions of it resolved - as well if declared as an autowiring dependency (e.g. IListableBeanFactory), - as long as the given value actually implements the extended interface. - - The autowired value. This may also be an - implementation o the interface, - which allows for lazy resolution of the actual target value. - - - - Determines whether the specified object qualifies as an autowire candidate, - to be injected into other beans which declare a dependency of matching type. - This method checks ancestor factories as well. - - Name of the object to check. - The descriptor of the dependency to resolve. - - true if the object should be considered as an autowire candidate; otherwise, false. - - if there is no object with the given name. - - - - Subinterface of - that adds - a before-destruction callback. - - - The typical usage will be to invoke custom destruction callbacks on - specific object types, matching corresponding initialization callbacks. - - Juergen Hoeller - Simon White (.NET) - - - - Apply this - to the - given new object instance before its destruction. Can invoke custom - destruction callbacks. - - The new object instance. - The name of the object. - - In case of errors. - - - - - Describes an object instance, which has property values, constructor - argument values, and further information supplied by concrete implementations. - - -

- This is just a minimal interface: the main intention is to allow - - (like PropertyPlaceholderConfigurer) to access and modify property values. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Return the property values to be applied to a new instance of the object. - - - - - Return the constructor argument values for this object. - - - - - Return the event handlers for any events exposed by this object. - - - - - Return a description of the resource that this object definition - came from (for the purpose of showing context in case of errors). - - - - - Is this object definition a "template", i.e. not meant to be instantiated - itself but rather just serving as an object definition for configuration - templates used by . - - - if this object definition is a "template". - - - - - Is this object definition "abstract", i.e. not meant to be instantiated - itself but rather just serving as parent for concrete child object - definitions. - - - if this object definition is "abstract". - - - - - Return whether this a Singleton, with a single, shared instance - returned on all calls. - - -

- If , an object factory will apply the Prototype - design pattern, with each caller requesting an instance getting an - independent instance. How this is defined will depend on the - object factory implementation. Singletons are the commoner type. -

-
-
- - - Is this object lazily initialized? - -

- Only applicable to a singleton object. -

-

- If , it will get instantiated on startup by object factories - that perform eager initialization of singletons. -

-
-
- - - Returns the of the object definition (if any). - - - A resolved object . - - - If the of the object definition is not a - resolved or . - - - - - Returns the of the - of the object definition. - - Note that this does not have to be the actual type name used at runtime, - in case of a child definition overrding/inheriting the the type name from its - parent. It can be modifed during object factory post-processing, typically - replacing the original class name with a parsed variant of it. - Hence, do not consider this to be the definitive bean type at runtime - but rather only use it for parsing purposes at the individual object - definition level. - - - - - The autowire mode as specified in the object definition. - - -

- This determines whether any automagical detection and setting of - object references will happen. Default is - , - which means there's no autowire. -

-
-
- - - The object names that this object depends on. - - -

- The object factory will guarantee that these objects get initialized - before. -

-

- Note that dependencies are normally expressed through object properties - or constructor arguments. This property should just be necessary for - other kinds of dependencies like statics (*ugh*) or database - preparation on startup. -

-
-
- - - The name of the initializer method. - - -

- The default is , in which case there is no initializer method. -

-
-
- - - Return the name of the destroy method. - - -

- The default is , in which case there is no destroy method. -

-
-
- - - The name of the factory method to use (if any). - - -

- This method will be invoked with constructor arguments, or with no - arguments if none are specified. The static method will be invoked on - the specified . -

-
-
- - - The name of the factory object to use (if any). - - - - - Gets a value indicating whether this instance a candidate for getting autowired into some other - object. - - - true if this instance is autowire candidate; otherwise, false. - - - - - Simple factory for shared instances. - - Juergen Hoeller - Simon White (.NET) - - - - Constructs a new instance of the target dictionary. - - The new instance. - - - - Set the source . - - -

- This value will be used to populate the - returned by this factory. -

-
-
- - - Set the of the - implementation to use. - - -

- The default is the . -

-
-
- - - The of objects created by this factory. - - - Always returns the . - - - - - implementation that - creates instances of the class. - - -

- Typically used for retrieving shared - instances for common topics (such as the 'DAL', 'BLL', etc). The - - property determines the name of the - Common.Logging logger. -

-
- Rick Evans - -
- - - Creates a new instance of the - - class. - - - - - Creates a new instance of the - - class. - - - The name of the instance served up by - this factory. - - - If the supplied is - or contains only whitespace character(s). - - - - - Return an instance (possibly shared or independent) of the object - managed by this factory. - - - An instance (possibly shared or independent) of the object - managed by this factory. - - - - - - Invoked by an - after it has set all object properties supplied - (and satisfied the - - and - interfaces). - - - In the event of misconfiguration (such as failure to set an essential - property) or if initialization fails. - - - - - - The name of the instance served up by - this factory. - - - The name of the instance served up by - this factory. - - - If the supplied to the setter is - or contains only whitespace character(s). - - - - - Return the type of object that this - creates, or - if not known in advance. - - - - - - Is the object managed by this factory a singleton or a prototype? - - - - - - An that returns a value - that is the result of a or instance method invocation. - - -

- Note that this class generally is expected to be used for accessing factory methods, - and as such defaults to operating in singleton mode. The first request to - - by the owning object factory will cause a method invocation, the return - value of which will be cached for all subsequent requests. The - property may be set to - , to cause this factory to invoke the target method each - time it is asked for an object. -

-

- A target method may be specified by setting the - property to a string representing - the method name, with specifying - the that the method is defined on. - Alternatively, a target instance method may be specified, by setting the - property as the target object, and - the property as the name of the - method to call on that target object. Arguments for the method invocation may be - specified by setting the property. -

-

- Another (esoteric) use case for this factory object is when one needs to call a method - that doesn't return any value (for example, a class method to - force some sort of initialization to happen)... this use case is not supported by - factory-methods, since a return value is needed to become the object. -

-

- - This class depends on the - - method being called after all properties have been set, as per the - contract. If you are - using this class outside of a Spring.NET IoC container, you must call one of either - or - yourself to ready the object's internal - state, or you will get a nasty . - -

-
- -

- The following example uses an instance of this class to call a - factory method... -

- - - - - - - - 1st - 2nd - and 3rd arguments - - - - -

- The following example is similar to the preceding example; the only pertinent difference is the fact that - a number of different objects are passed as arguments, demonstrating that not only simple value types - are valid as elements of the argument list... -

- - - - - - - - - - - 1st - - - - - - - http://www.springframework.net/ - - - - - -

- Named parameters are also supported... this next example yields the same results as - the preceding example (that did not use named arguments). -

- - - - - - - - - - 1st - and 3rd arguments - 2nd - - - - -

- Similarly, the following example uses an instance of this class to call an instance method... -

- - - - - - - - - -

- The above example could also have been written using an anonymous inner object definition... if the - object on which the method is to be invoked is not going to be used outside of the factory object - definition, then this is the preferred idiom because it limits the scope of the object on which the - method is to be invoked to the surrounding factory object. -

- - - - - - - - - - Colin Sampaleanu - Juergen Hoeller - Rick Evans (.NET) - Simon White (.NET) - - - - - - Specialisation of the class that tries - to convert the given arguments for the actual target method via an - appropriate implementation. - - Juergen Hoeller - Rick Evans - - - - - Helper class allowing one to declaratively specify a method call for later invocation. - - -

- Typically not used directly but via its subclasses such as - . -

-

- Usage: specify either the and - or the - and - properties respectively, and - (optionally) any arguments to the method. Then call the - method to prepare the invoker. - Once prepared, the invoker can be invoked any number of times. -

-
- -

- The following example uses the class to invoke the - ToString() method on the Foo class using a mixture of both named and unnamed - arguments. -

- - public class Foo - { - public string ToString(string name, int age, string address) - { - return string.Format("{0}, {1} years old, {2}", name, age, address); - } - - public static void Main() - { - Foo foo = new Foo(); - MethodInvoker invoker = new MethodInvoker(); - invoker.Arguments = new object [] {"Kaneda", "18 Kaosu Gardens, Nakatani Drive, Okinanawa"}; - invoker.AddNamedArgument("age", 29); - invoker.Prepare(); - // at this point, the arguments that will be passed to the method invocation - // will have been resolved into the following ordered array : {"Kaneda", 29, "18 Kaosu Gardens, Nakatani Drive, Okinanawa"} - string details = (string) invoker.Invoke(); - Console.WriteLine (details); - // will print out 'Kaneda, 29 years old, 18 Kaosu Gardens, Nakatani Drive, Okinanawa' - } - } - -
- Colin Sampaleanu - Juergen Hoeller - Simon White (.NET) -
- - - The used to search for - the method to be invoked. - - - - - The value returned from the invocation of a method that returns void. - - - - - The method that will be invoked. - - - - - Creates a new instance of the class. - - - - - Prepare the specified method. - - -

- The method can be invoked any number of times afterwards. -

-
- - If all required properties are not set, or a matching argument could not be found - for a named argument (typically down to a typo). - - - If the specified method could not be found. - -
- - - Searches for and returns the method that is to be invoked. - - - The return value of this method call will subsequently be returned from the - . - - The method that is to be invoked. - - If no method could be found. - - - If more than one method was found. - - - - - Adds the named argument to this instances mapping of argument names to argument values. - - - The name of an argument on the method that is to be invoked. - - - The value of the named argument on the method that is to be invoked. - - - - - Returns the prepared object that - will be invoked. - - -

- A possible use case is to determine the return of the method. -

-
- - The prepared object that - will be invoked. - -
- - - Invoke the specified method. - - -

- The invoker needs to have been prepared beforehand (via a call to the - method). -

-
- - The object returned by the method invocation, or - if the method returns void. - - - If at least one of the arguments passed to this - was incompatible with the signature of the invoked method. - -
- - - The target on which to call the target method. - - -

- Only necessary when the target method is ; - else, a target object needs to be specified. -

-
-
- - - The target object on which to call the target method. - - -

- Only necessary when the target method is not ; - else, a target class is sufficient. -

-
-
- - - The name of the method to be invoked. - - -

- Refers to either a method - or a non- method, depending on - whether or not a target object has been set. -

-
- -
- - - Arguments for the method invocation. - - -

- Ordering is significant... the order of the arguments in this - property must match the ordering of the various parameters on the target - method. There does however exist a small possibility for confusion when - the arguments in this property are supplied in addition to one or more named - arguments. In this case, each named argument is slotted into the index position - corresponding to the named argument... once once all named arguments have been - resolved, the arguments in this property are slotted into any remaining (empty) - slots in the method parameter list (see the example in the overview of the - class if this is not clear). -

-

- If this property is not set, or the value passed to the setter invocation - is or a zero-length array, a method with no (un-named) arguments is assumed. -

-
- -
- - - The resolved arguments for the method invocation. - - - - This property is not set until the target method has been resolved via a call to the - method). It is a combination of the - named and plain vanilla arguments properties, and it is this object array that - will actually be passed to the invocation of the target method. - -

- Setting the value of this property to results in basically clearing out any - previously prepared arguments... another call to the - method will then be required to prepare the arguments again (or the prepared arguments - can be set explicitly if so desired). -

-
- - -
- - - Named arguments for the method invocation. - - -

- The keys of this dictionary are the () names of the - method arguments, and the () values are the actual - argument values themselves. -

-

- If this property is not set, or the value passed to the setter invocation - is a reference, a method with no named arguments is assumed. -

-
- -
- - - Creates a new instance of the - class. - - - - - Prepare the specified method. - - -

- The method can be invoked any number of times afterwards. -

-
- - If all required properties are not set. - - - If the specified method could not be found. - -
- - - Register the given custom - for all properties of the given . - - - The of property. - - - The to register. - - - - - Return an instance (possibly shared or independent) of the object - managed by this factory. - - -

- Returns the return value of the method that is to be invoked. -

-

- Will return the same value each time if the - - property value is . -

-
- - An instance (possibly shared or independent) of the object managed by - this factory. - - -
- - - Prepares this method invoker. - - - If all required properties are not set. - - - If the specified method could not be found. - - - - - - If a singleton should be created, or a new object on each request. - Defaults to . - - - - - Return the return value of the method - that this factory invokes, or if not - known in advance. - - -

- If the return value of the method that this factory is to invoke is - , then the - will be returned (in accordance with the - contract that - treats a value as a configuration error). -

-
- -
- - - Holder for an with - name and aliases. - - -

- Recognized by - - for inner object definitions. Registered by - , - which also uses it as general holder for a parsed object definition. -

-

- Can also be used for programmatic registration of inner object - definitions. If you don't care about the functionality offered by the - interface and the like, - registering - or is good enough. -

-
- Juergen Hoeller - Simon White (.NET) -
- - - Creates a new instance of the - class. - - - The object definition to be held by this instance. - - - The name of the object definition. - - - - - Creates a new instance of the - class. - - - The object definition to be held by this instance. - - The name of the object. - - Any aliases for the supplied - - - - - The held by this - instance. - - - - - The name of the object definition. - - - - - Any aliases for the object definition. - - -

- Guaranteed to never return ; if the associated - - does not have any aliases associated with it, then an empty - array will be returned. -

-
-
- - - Visitor class for traversing objects, in particular - the property values and constructor arguments contained in them resolving - object metadata values. - - - Used by and - to parse all string values contained in a ObjectDefinition, resolving any placeholders found. - - Mark Pollack - - - - Initializes a new instance of the class, - applying the specified IVariableSource to all object metadata values. - - The variable source. - - - - Initializes a new instance of the class - for subclassing - - Subclasses should override the ResolveStringValue method - - - - Traverse the given ObjectDefinition object and the MutablePropertyValues - and ConstructorArgumentValues contained in them. - - The object definition to traverse. - - - - Visits the ObjectDefinition property ObjectTypeName, replacing string values using - the specified IVariableSource. - - The object definition. - - - - Visits the property values of the ObjectDefinition, replacing string values - using the specified IVariableSource. - - The object definition. - - - - Visits the indexed constructor argument values, replacing string values using the - specified IVariableSource. - - The indexed argument values. - - - - Visits the named constructor argument values, replacing string values using the - specified IVariableSource. - - The named argument values. - - - - Visits the generic constructor argument values, replacing string values using - the specified IVariableSource. - - The genreic argument values. - - - - Configures the constructor argument ValueHolder. - - The vconstructor alue holder. - - - - Resolves the given value taken from an object definition according to its type - - the value to resolve - the resolved value - - - - Visits the ManagedList property ElementTypeName and - calls for list element. - - - - - Visits the ManagedSet property ElementTypeName and - calls for list element. - - - - - Visits the ManagedSet properties KeyTypeName and ValueTypeName and - calls for dictionary's value element. - - - - - Visits the elements of a NameValueCollection and calls - for value of each element. - - - - - Looks up the value of the given variable name in the configured . - - The name of the variable to be looked up - - The value of this variable, as returned from the passed - into the constructor - - If no has been configured. - - - - Returns a value that is an - that - returns an object from an - . - - -

- The primary motivation of this class is to avoid having a client object - directly calling the - - method to get a prototype object out of an - , which would be a - violation of the inversion of control principle. With the use of this - class, the client object can be fed an - as a property - that directly returns one target prototype object. -

-

- The object referred to by the value of the - - property does not have to be a prototype object, but there is little - to no point in using this class in conjunction with a singleton object. -

-
- -

- The following XML configuration snippet illustrates the use of this - class... -

- - - - - - - - - - - - - - - - Colin Sampaleanu - Simon White (.NET) - - - - Interface to be implemented by objects that wish to be aware of their owning - . - - -

- For example, objects can look up collaborating objects via the factory. -

-

- Note that most objects will choose to receive references to collaborating - objects via respective properties and / or an appropriate constructor. -

-

- For a list of all object lifecycle methods, see the - API documentation. -

-
- Rod Johnson - Rick Evans (.NET) -
- - - Callback that supplies the owning factory to an object instance. - - - Owning - (may not be ). The object can immediately - call methods on the factory. - - -

- Invoked after population of normal object properties but before an init - callback like 's - - method or a custom init-method. -

-
- - In case of initialization errors. - -
- - - Returns an instance of the object factory. - - The object factory. - - - - Invoked by an - after it has set all supplied object properties. - - - In the event of misconfiguration (such as failure to set an essential - property) or if initialization fails. - - - - - - Sets the name of the target object. - - - - - The target factory that will be used to perform the lookup - of the object referred to by the - property. - - - The owning - (will never be ). - - - In case of initialization errors. - - - - - - The of object created by this factory. - - - - - Interface defining a factory which can return an object instance - (possibly shared or independent) when invoked. - - - This interface is typically used to encapsulate a generic factory - which returns a new instance (prototype) on each invocation. - It is similar to the , but - implementations of the aforementioned interface are normally meant to be defined - as instances by the user in an , - while implementations of this class are normally meant to be fed as a property to - other objects; as such, the - method - has different exception handling behavior. - - Colin Sampaleanu - Simon White (.NET) - - - - Return an instance (possibly shared or independent) - of the object managed by this factory. - - - An instance of the object (should never be ). - - - - - Creates a new instance of the GenericObjectFactory class. - - - The enclosing - . - - - - - Returns the object created by the enclosed object factory. - - The created object. - - - - An implementation - that exposes an arbitrary target object under a different name. - - -

- Usually, the target object will reside in a different object - definition file, using this - to link it in - and expose it under a different name. Effectively, this corresponds - to an alias for the target object. -

- - For XML based object definition files, a <alias> - tag is available that effectively achieves the same. - -
- Juergen Hoeller - Rick Evans (.NET) - -
- - - Return an instance (possibly shared or independent) of the object - managed by this factory. - - - An instance (possibly shared or independent) of the object managed by - this factory. - - - - - - The name of the target object. - - -

- The target object may potentially be defined in a different object - definition file. -

-
- The name of the target object. -
- - - Return the type of object that this - creates, or - if not known in advance. - - - - - - Is the object managed by this factory a singleton or a prototype? - - - - - - Callback that supplies the owning factory to an object instance. - - - The owning - (may not be ). The object can immediately - call methods on the factory. - - - In case of initialization errors. - - - - - - Implementation of that - resolves variable name against Java-style property file. - - - Aleksandar Seovic - - - - Resolves variable value for the specified variable name. - - - The name of the variable to resolve. - - - The variable value if able to resolve, null otherwise. - - - - - Initializes properties based on the specified - property file locations. - - - - - Gets or sets the locations of the property files - to read properties from. - - - The locations of the property files - to read properties from. - - - - - Convinience property. Gets or sets a single location - to read properties from. - - - A location to read properties from. - - - - - Overrides default values in one or more object definitions. - - -

- Instances of this class override already existing values, and is - thus best suited to replacing defaults. If you need to replace - placeholder values, consider using the - - class instead. -

-

- In contrast to the - - class, the original object definition can have default - values or no values at all for such object properties. If an overriding - configuration file does not have an entry for a certain object property, - the default object value is left as is. Also note that it is not - immediately obvious to discern which object definitions will be mutated by - one or more - s - simply by looking at the object configuration. -

-

- Each line in a referenced configuration file is expected to take the - following form... -

- - - -

- The name.property key refers to the object name and the - property that is to be overridden; and the value is the overridding - value that will be inserted into the appropriate object definition's - named property. -

-

- Please note that in the case of multiple - s - that define different values for the same object definition value, the - last overridden value will win (due to the fact that the values - supplied by previous - s - will be overridden). -

-
- -

- The following XML context definition defines an object that has a number - of properties, all of which have default values... -

- - - - - - - - -

- What follows is a .NET config file snippet for the above example (assuming - the need to override one of the default values)... -

- - - - - - -
- Juergen Hoeller - Simon White (.NET) - - - -
- - - Allows for the configuration of individual object property values from - a .NET .config file. - - -

- Useful for custom .NET .config files targetted at system administrators - that override object properties configured in the application context. -

-

- Two concrete implementations are provided in the Spring.NET core library: - - - - - for <add key="placeholderKey" value="..."/> style - overriding (pushing values from a .NET .config file into object - definitions). - - - - - - for replacing "${...}" placeholders (pulling values from a .NET .config - file into object definitions). - - - -

-

- Please refer to the API documentation for the concrete implementations - listed above for example usage. -

-
- Juergen Hoeller - Simon White (.NET) - - -
- - - The default configuration section name to use if none is explictly supplied. - - - - - - Creates a new instance of the - - class. - - -

- This is an class, and as such exposes no - public constructors. -

-
-
- - - Modify the application context's internal object factory after its - standard initialization. - - - The object factory used by the application context. - - - In case of errors. - - - - - - Loads properties from the configuration sections - specified in into . - - The instance to be filled with properties. - - - - Apply the given properties to the supplied - . - - - The - used by the application context. - - The properties to apply. - - If an error occured. - - - - - Validates the supplied . - - -

- Basically, if external locations are specified, ensure that either - one or a like number of config sections are also specified. -

-
- - The to be validated. - -
- - - Simply initializes the supplied - collection with this instances default - (if any). - - - The collection to be so initialized. - - - - - The policy for resolving conflicting property overrides from - several resources. - - -

- When merging conflicting property overrides from several resources, - should append an override with the same key be appended to the - current value, or should the property override from the last resource - processed override previous values? -

-

- The default value is ; i.e. a property - override from the last resource to be processed overrides previous - values. -

-
- - if the property override from the last resource - processed overrides previous values. - -
- - - Return the order value of this object, where a higher value means greater in - terms of sorting. - - The order value. - - - - - The default properties to be applied. - - -

- These are to be considered defaults, to be overridden by values - loaded from other resources. -

-
-
- - - The location of the .NET .config file that contains the property - overrides that are to be applied. - - - - - The locations of the .NET .config files containing the property - overrides that are to be applied. - - - - - The configuration sections to look for within the .config files. - - - - - - - Should a failure to find a .config file be ignored? - - -

- is only appropriate if the .config file is - completely optional. The default is . -

-
- - if a failure to find a .config file is to be - ignored. - -
- - - Apply the given properties to the supplied - . - - - The - used by the application context. - - The properties to apply. - - If an error occured. - - - - - Process the given key as 'name.property' entry. - - - The object factory containing the object definitions that are to be - processed. - - The key. - The value. - - If an error occurs. - - - If the property was not well formed (i.e. not in the format "name.property"). - - - - - implementation that - evaluates a property path on a given target object. - - -

- The target object can be specified directly or via an object name (see - example below). -

-

- Please note that the - is an implementation, and as such has - to comply with the contract of the - interface; more specifically, this means that the end result of the property lookup path - evaluation cannot be ( - implementations are not permitted to return ). If the resut of a - property lookup path evaluates to , an exception will be thrown. -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - Juergen Hoeller - Rick Evans (.NET) - - - - Return an instance (possibly shared or independent) of the object - managed by this factory. - - - An instance (possibly shared or independent) of the object managed by - this factory. - - - - - - The target object that the property path lookup is to be applied to. - - -

- This would most likely be an inner object, but can of course be - any object reference. -

-
- - The target object that the property path lookup is to be applied to. - - -
- - - The (object) name of the target object that the property path lookup - is to be applied to. - - -

- Please note that any leading or trailing whitespace will be - trimmed from this name prior to resolution. The implication of this is that - one cannot use the - class in conjunction with object names that start or end with whitespace. -

-
- - The (object) name of the target object that the property path lookup - is to be applied to. - - -
- - - The property (lookup) path to be applied to the target object. - - -

- Please note that any leading or trailing whitespace will be - trimmed from this path prior to resolution. Whitespace is not a valid - identifier for property names (in part or whole) in CLS-based languages, - so this is a not unreasonable action. Please also note that whitespace - that is embedded within the property path will be left as-is (which may - or may not result in an error being thrown, depending on the context of - the whitespace). -

-
- -

- Examples of such property lookup paths can be seen below; note that - property lookup paths can be nested to an arbitrary level. -

- - name.length - accountManager.account['the key'].name - accounts[0].name - -
- - The property (lookup) path to be applied to the target object. - -
- - - The 'expected' of the result from evaluating the - property path. - - -

- This is not necessary for directly specified target objects, or - singleton target objects, where the can - be determined via reflection. Just specify this in case of a - prototype target, provided that you need matching by type (for - example, for autowiring). -

-

- It is permissable to set the value of this property to - (which in any case is the default value). -

-
- - The 'expected' of the result from evaluating the - property path. - -
- - - Return the of object that this - creates, or - if not known in advance. - - - - - - Is the object managed by this factory a singleton or a prototype? - - - - - - Set the name of the object in the object factory that created this object. - - -

- The object name of this - - will be interpreted as "objectName.property" pattern, if neither the - - - have been supplied (set). -

-

- This allows for concise object definitions with just an id or name. -

-
- - The name of the object in the factory. - -
- - - Callback that supplies the owning factory to an object instance. - - - Owning - (may not be ). The object can immediately - call methods on the factory. - - - In case of initialization errors. - - - - - Resolves placeholder values in one or more object definitions. - - -

- The default placeholder syntax follows the NAnt style: ${...}. - Instances of this class can be configured in the same way as any other - object in a Spring.NET container, and so custom placeholder prefix - and suffix values can be set via the - and properties. -

- -

- The following example XML context definition defines an object that has - a number of placeholders. The placeholders can easily be distinguished - by the presence of the ${} characters. -

- - - - - - - - -

- The associated XML configuration file for the above example containing the - values for the placeholders would contain a snippet such as .. -

- - - - - - - - -

- The preceding XML snippet listing the various property keys and their - associated values needs to be inserted into the .NET config file of - your application (or Web.config file for your ASP.NET web application, - as the case may be), like so... -

- - - - - - - - -
-

- - checks simple property values, lists, dictionaries, sets, constructor - values, object type name, and object names in - runtime object references ( - ). - Furthermore, placeholder values can also cross-reference other - placeholders, in the manner of the following example where the - rootPath property is cross-referenced by the subPath - property. -

- - - - - - - - -

- In contrast to the - - class, this configurer only permits the replacement of explicit - placeholders in object definitions. Therefore, the original definition - cannot specify any default values for its object properties, and the - placeholder configuration file is expected to contain an entry for each - defined placeholder. That is, if an object definition contains a - placeholder ${foo}, there should be an associated - <add key="foo" value="..."/> entry in the - referenced placeholder configuration file. Default property values - can be defined via the inherited - - collection to overcome any perceived limitation of this feature. -

-

- If a configurer cannot resolve a placeholder, and the value of the - - property is currently set to , an - - will be thrown. If you want to resolve properties from multiple configuration - resources, simply specify multiple resources via the - - property. Finally, please note that you can also define multiple - - instances, each with their own custom placeholder syntax. -

-
- Juergen Hoeller - Simon White (.NET) - - - -
- - - The default placeholder prefix. - - - - - The default placeholder suffix. - - - - - Apply the given properties to the supplied - . - - - The - used by the application context. - - The properties to apply. - - If an error occured. - - - - - Parse values recursively to be able to resolve cross-references between - placeholder values. - - - The map of constructor arguments / property values. - - The string to be resolved. - The placeholders that have already been visited - during the current resolution attempt (used to detect circular references - between placeholders). Only non-null if we're parsing a nested placeholder. - - If an error occurs. - - The resolved string. - - - - Resolve the given placeholder using the given name value collection, - performing an environment variables check according to the given mode. - - -

- The default implementation delegates to - - before/afer the environment variable check. Subclasses can override - this for custom resolution strategies, including customized points - for the environment properties check. -

-
- The placeholder to resolve - - The merged name value collection of this configurer. - - The environment variable mode. - - The resolved value or if none. - - -
- - - Resolve the given placeholder using the given name value collection. - - -

- This (the default) implementation simply looks up the value of the - supplied key. -

-

- Subclasses can override this for customized placeholder-to-key - mappings or custom resolution strategies, possibly just using the - given name value collection as fallback. -

-
- The placeholder to resolve. - - The merged name value collection of this configurer. - - The resolved value. -
- - - The placeholder prefix (the default is ${). - - - - - - The placeholder suffix (the default is }) - - - - - - Indicates whether unresolved placeholders should be ignored. - - - - - Controls how environment variables will be used to - replace property placeholders. - - -

- See the overview of the - - enumeration for the available options. -

-
-
- - - implementation that - retrieves a or non-static public property value. - - -

- Typically used for retrieving public property values. -

-
- Rick Evans (.NET) -
- - - Creates a new instance of the - class. - - - - - Invoked by an - after it has set all object properties supplied - (and satisfied - and ApplicationContextAware). - - - In the event of misconfiguration (such as failure to set an essential - property) or if initialization fails. - - - - - Template method that subclasses must override to construct the object - returned by this factory. - - - If an exception occured during object creation. - - The object returned by this factory. - - - - The of the static property - to be retrieved. - - - - - Arguments for the property invocation. - - -

- If this property is not set, or the value passed to the setter invocation - is a null or zero-length array, a property with no arguments is assumed. -

-
-
- - - The name of the property the value of which is to be retrieved. - - -

- Refers to either a property or a non-static property, - depending on a target object being set. -

-
-
- - - The object instance on which the property is defined. - - - - - The on which the property is defined. - - - - - Return the type of object that this - creates, or - if not known in advance. - - - - - Implementation of that - resolves variable name against registry key. - - Aleksandar Seovic - - - - Resolves variable value for the specified variable name. - - - The name of the variable to resolve. - - - This implementation resolves REG_SZ as well as REG_MULTI_SZ values. In case of a REG_MULTI_SZ value, - strings are concatenated to a comma-separated list following - - - The variable value if able to resolve, null otherwise. - - - - - Gets or sets the registry key to obtain variable values from. - - - The registry key to obtain variable values from. - - - - - - implementation that allows for convenient registration of custom - IResource implementations. - - -

- Because the - class implements the - - interface, instances of this class that have been exposed in the - scope of an - will - automatically be picked up by the application context and made - available to the IoC container whenever resolution of IResources is required. -

-
- Mark Pollack - - -
- - - Registers custom IResource implementations. The supplied - is not used since IResourse implementations - are registered with a global - - - The object factory. - - - In case of errors. - - - - - The IResource implementations, i.e. resource handlers, to register. - - -

- The has the - contains the resource protocol name as the key and type as the value. - The key name can either be a string or an object, in which case - ToString() will be used to obtain the string name. - The value can be the fully qualified name of the IResource - implementation, a string, or - an actual of the IResource class - -

-
-
- - - A convenience class to create a - given the resource base - name and assembly name. - - -

- This is currently the preferred way of injecting resources into view - tier components (such as Windows Forms GUIs and ASP.NET ASPX pages). - A GUI component (typically a Windows Form) is injected with - an instance, and can - then proceed to use the various GetXxx() methods on the - to retrieve images, - strings, custom resources, etc. -

-
- Mark Pollack - - - -
- - - Creates a . - - - If an exception occured during object creation. - - The object returned by this factory. - - - - - - Invoked by an - after it has set all object properties supplied - (and satisfied the - - and - interfaces). - - - In the event of misconfiguration (such as failure to set an essential - property) or if initialization fails. - - - - - - The root name of the resources. - - -

- For example, the root name for the resource file named - "MyResource.en-US.resources" is "MyResource". -

- - The namespace is also prefixed before the resource file name. - -
-
- - - The string representation of the assembly that contains the resource. - - - - - The . - - - - - Immutable placeholder class used for the value of a - object when it's a reference - to another object in this factory to be resolved at runtime. - - Rod Johnson - Rick Evans (.NET) - - - - Creates a new instance of the - - class. - - -

- This does not mark this object as being a reference to - another object in any parent factory. -

-
- The name of the target object. -
- - - Creates a new instance of the - - class. - - -

- This variant constructor allows a client to specifiy whether or not - this object is a reference to another object in a parent factory. -

-
- The name of the target object. - - Whether this object is an explicit reference to an object in a - parent factory. - -
- - - Returns a string representation of this instance. - - A string representation of this instance. - - - - Return the target object name. - - - - - Is this is an explicit reference to an object in the parent - factory? - - - if this is an explicit reference to an - object in the parent factory. - - - - - Simple factory object for shared instances. - - Juergen Hoeller - Simon White (.NET) - - - - Constructs a new instance of the target set. - - The new instance. - - - - Set the source . - - -

- This value will be used to populate the - returned by this factory. -

-
-
- - - Set the of the - implementation to use. - - -

- The default is the . -

-
-
- - - The of objects created by this factory. - - - Always returns the . - - - - - Configure all ISharedStateAware objects, delegating concrete handling to the list of . - - - - - Creates a new empty instance. - - - - - Creates a new preconfigured instance. - - - priority value affecting order of invocation of this processor. See interface. - - - - Iterates over configured list of s until - the first provider is found that
- a) true == provider.CanProvideState( instance, name )
- b) null != provider.GetSharedState( instance, name )
-
-
- - - A NoOp for this processor - - - The new object instance. - - - The name of the object. - - - the original . - - - - - Return the order value of this object, where a higher value means greater in - terms of sorting. - - -

- Normally starting with 0 or 1, with indicating - greatest. Same order values will result in arbitrary positions for the affected - objects. -

-

- Higher value can be interpreted as lower priority, consequently the first object - has highest priority. -

-
- The order value. -
- - - Get/Set the (already ordererd!) list of instances. - - - If this list is not set, the containing object factory will automatically - be scanned for instances. - - - - - Implementation of that - resolves variable name against special folders (as defined by - enumeration). - - Aleksandar Seovic - - - - Resolves specified special folder to its full path. - - - The name of the special folder to resolve. Should be one of the values - defined by the enumeration. - - - The folder path if able to resolve, null otherwise. - - - - - - implementation that allows for convenient registration of custom - type aliases. - - - Type aliases can be used instead of fully qualified type names anywhere - a type name is expected in a Spring.NET configuration file. -

- Because the - class implements the - - interface, instances of this class that have been exposed in the - scope of an - will - automatically be picked up by the application context and made - available to the IoC container whenever resolution of type aliases is required. -

-
- Mark Pollack - - -
- - - Registers any type aliases. The supplied - is not used since type aliases - are registered with a global - - - The object factory. - - - In case of errors. - - - - - The type aliases to register. - - -

- The has the - contains the alias name as the key and type as the value. - The key name can either be a string or an object, in which case - ToString() will be used to obtain the string name. - the value can be the fully qualified name of the type as a string or - an actual of the class that - being aliased. -

-
-
- - - Holder for a typed value. - - -

- Can be added to object definitions to explicitly specify - a target type for a value, - for example for collection - elements. -

-

- This holder just stores the value and the target - . The actual conversion will be performed by - the surrounding object factory. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Creates a new instance of the - - class. - - - - - Initializes a new instance of the class. - - The value. - - - - Creates a new instance of the - - class. - - - The value that is to be converted. - - - The to convert to. - - - If the supplied is - . - - - - - The value that is to be converted. - - -

- Obviously if the - - is the , no conversion - will actually be performed. -

-
-
- - - The to convert to. - - - If the setter is supplied with a value. - - - - - Gets a value indicating whether this instance has target type. - - - true if this instance has target type; otherwise, false. - - - - - Provides methods for type-safe accessing s. - - Erich Eichinger - - - - Initialize a new instance of an - - The underlying to read values from. - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The expected format of the variable's value - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The expected format of the variable's value - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - A that contains the value of the specified variable - or , if returns null. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - A that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns an of type that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - An of type that contains the value of the specified variable - or , if returns null. - - - - - Returns an of type that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns null. - - If false, suppresses exceptions if the result - of cannot be parsed - and returns instead. - - An of type that contains the value of the specified variable - or , if cannot be parsed. - - - - - Returns a that contains the value of the specified variable. - - The name of the variable to be read. - The value to be returned if returns or . - - A that contains the value of the specified variable - or , if returns null. - - - - - Resolves placeholder values in one or more object definitions - - - The placeholder syntax follows the NAnt style: ${...}. - Placeholders values are resolved against a list of - s. In case of multiple definitions - for the same property placeholder name, the first one in the - list is used. - Variable substitution is performed on simple property values, - lists, dictionaries, sets, constructor - values, object type name, and object names in - runtime object references ( - ). - Furthermore, placeholder values can also cross-reference other - placeholders, in the manner of the following example where the - rootPath property is cross-referenced by the subPath - property. - - - - - - - - - - If a configurer cannot resolve a placeholder, and the value of the - - property is currently set to , an - - will be thrown. - - Mark Pollack - - - - The default placeholder prefix. - - - - - The default placeholder suffix. - - - - - Modify the application context's internal object factory after its - standard initialization. - - The object factory used by the application context. - -

- All object definitions will have been loaded, but no objects will have - been instantiated yet. This allows for overriding or adding properties - even to eager-initializing objects. -

-
- - In case of errors. - -
- - - Apply the property replacement using the specified s for all - object in the supplied - . - - - The - used by the application context. - - - If an error occured. - - - - - Sets the list of s that will be used to resolve placeholder names. - - A list of s. - - - - Sets that will be used to resolve placeholder names. - - A instance. - - - - The placeholder prefix (the default is ${). - - - - - - The placeholder suffix (the default is }) - - - - - - Indicates whether unresolved placeholders should be ignored. - - - - - Return the order value of this object, where a higher value means greater in - terms of sorting. - - The order value. - - - - - Context that gets passed along an object definition reading process, - encapsulating all relevant configuraiton as well as state. - - Rob Harrop - Juergen Hoeller - Mark Pollack (.NET) - - - - Initializes a new instance of the class. - - The resource. - - - - Gets the resource. - - The resource. - - - - Abstract superclass - that implements default object creation. - - -

- Provides object creation, initialization and wiring, supporting - autowiring and constructor resolution. Handles runtime object - references, managed collections, and object destruction. -

-

- The main template method to be implemented by subclasses is - , - used for autowiring by type. Note that this class does not implement object - definition registry capabilities - ( - does). -

-
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) -
- - - Abstract superclass for - implementations. - - -

- This class provides singleton / prototype determination, singleton caching, - object definition aliasing, - handling, and object definition merging for child object definitions. -

-
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) -
- - - Marker object to be temporarily registered in the singleton cache, - while instantiating an object (in order to be able to detect circular references). - - - - - The instance for this class. - - - - - Used as value in hashtable that keeps track of singleton names currently in the - process of being created. Would not be necessary if we created a case insensitive implementation of - ISet. - - - - - Creates a new instance of the - class. - - -

- This constructor implicitly creates an - - that treats the names of objects in this factory in a case-sensitive fashion. -

-

- This is an class, and as such exposes no public constructors. -

-
-
- - - Creates a new instance of the - class. - - -

- This is an class, and as such exposes no public constructors. -

-
- - if the names of objects in this factory are to be treated in a - case-sensitive fashion. - -
- - - Creates a new instance of the - class. - - -

- This is an class, and as such exposes no public constructors. -

-
- - if the names of objects in this factory are to be treated in a - case-sensitive fashion. - - - Any parent object factory; may be . - -
- - - Return an instance (possibly shared or independent) of the given object name. - - The name of the object to return. - - The the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - - The arguments to use if creating a prototype using explicit arguments to - a factory method. If there is no factory method and the - supplied array is not , then - match the argument values by type and call the object's constructor. - - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the object is not of the required type. - - - If the supplied is . - - - - - - Apply the property values of the object definition with the supplied - to the supplied . - - -

- The object definition can either define a fully self-contained object, - reusing it's property values, or just property values meant to be used - for existing object instances. -

-
- - The existing object that the property values for the named object will - be applied to. - - - The name of the object definition associated with the property values that are - to be applied. - - - In case of errors. - -
- - - Create an object instance for the given object definition. - - The name of the object. - - The object definition for the object that is to be instantiated. - - - The arguments to use if creating a prototype using explicit arguments to - a static factory method. It is invalid to use a non- arguments value - in any other case. - - - Whether eager caching of singletons is allowed... typically true for - singlton objects, but never true for inner object definitions. - - - Create instance only - suppress injecting dependencies yet. - - - A new instance of the object. - - - In case of errors. - - -

- The object definition will already have been merged with the parent - definition in case of a child definition. -

-

- All the other methods in this class invoke this method, although objects - may be cached after being instantiated by this method. All object - instantiation within this class is performed by this method. -

-
-
- - - Destroy the target object. - - -

- Must destroy objects that depend on the given object before the object itself, - nor throw an exception. -

-
- - The name of the object. - - - The target object instance to destroyed. - -
- - - Does this object factory contain an object definition with the - supplied ? - - -

- Does not consider any hierarchy this factory may participate in. - Invoked by - - when no cached singleton instance is found. -

-
- - The name of the object to look for. - - - if this object factory contains an object - definition with the supplied . - -
- - - Adds the supplied (object) to this factory's - singleton cache. - - -

- To be called for eager registration of singletons, e.g. to be able to - resolve circular references. -

- - If a singleton has already been registered under the same name as - the supplied , then the old singleton will - be replaced. - -
- The name of the object. - The singleton object. - - If the argument is - or consists wholly of whitespace characters; or if the - is . - -
- - - Return the object name, stripping out the factory dereference prefix if - necessary, and resolving aliases to canonical names. - - - The transformed name of the object. - - - - - Ensures, that the given name is prefixed with - if it incidentially already starts with this prefix. This avoids troubles when dereferencing - the object name during - - - - - Determines whether the specified name is defined as an alias as opposed - to the name of an actual object definition. - - The object name to check. - - true if the specified name is alias; otherwise, false. - - - - - Return a , - even by traversing parent if the parameter is a child definition. - - - The name of the object. - - - Are ancestors to be included in the merge? - - -

- Will ask the parent object factory if not found in this instance. -

-
- - A merged - with overridden properties. - -
- - - Return a , - even by traversing parent if the parameter is a child definition. - - - A merged - with overridden properties. - - - - - Creates the root object definition. - - The template definition to base root definition on. - Root object definition. - - - - Return the registered - for the - given object, allowing access to its property values and constructor - argument values. - - The name of the object. - - The registered - . - - - If there is no object with the given name. - - - In the case of errors. - - - - - Return the registered - for the - given object, allowing access to its property values and constructor - argument values. - - The name of the object. - Whether to search parent object factories. - - The registered - . - - - If there is no object with the given name. - - - In the case of errors. - - - - - Gets the type for the given FactoryObject. - - The factory object instance to check. - the FactoryObject's object type - - - - Gets the object type for the given FactoryObject definition, as far as possible. - Only called if there is no singleton instance registered for the target object already. - - - The default implementation creates the FactoryObject via GetObject - to call its ObjectType property. Subclasses are encouraged to optimize - this, typically by just instantiating the FactoryObject but not populating it yet, - trying whether its ObjectType property already returns a type. - If no type found, a full FactoryObject creation as performed by this implementation - should be used as fallback. - - Name of the object. - The merged object definition for the object. - The type for the object if determinable, or null otherwise - - - - Predict the eventual object type (of the processed object instance) for the - specified object. - - - Does not need to handle FactoryObjects specifically, since it is only - supposed to operate on the raw object type. - This implementation is simplistic in that it is not able to - handle factory methods and InstantiationAwareBeanPostProcessors. - It only predicts the object type correctly for a standard object. - To be overridden in subclasses, applying more sophisticated type detection. - - Name of the object. - The merged object definition to determine the type for. - The type of the object, or null if not predictable - - - - Get the object for the given object instance, either the object - instance itself or its created object in case of an - . - - - The name that may include the factory dereference prefix. - - The object instance. - - The singleton instance of the object. - - - - - Obtain an object to expose from the given IFactoryObject. - - The IFactoryObject instance. - Name of the object. - The merged object definition. - The object obtained from the IFactoryObject - If IFactoryObject object creation failed. - - - - Post-process the given object that has been obtained from the FactoryObject. - The resulting object will be exposed for object references. - - The default implementation simply returns the given object - as-is. Subclasses may override this, for example, to apply - post-processors. - The instance obtained from the IFactoryObject. - Name of the object. - The object instance to expose - if any post-processing failed. - - - - Convenience method to pull an - from this factory. - - - The name of the factory object to be retrieved. If this name is not a valid - name, it will be converted - into one. - - - The associated with the - supplied . - - - - - Is the supplied a factory object dereference? - - - - - Determines whether the type of the given object definition matches the - specified target type. - - Allows for lazy load of the actual object type, provided that the - type match can be determined otherwise. - The default implementation simply delegates to the standard - ResolveObjectType method. Subclasses may override this to use - a differnt strategy. - - Name of the object (for error handling purposes). - The merged object definition to determine the type for. - Type to match against (never null). - - true if object definition matches tye specified target type; otherwise, false. - - if we failed to load the type." - - - - Resolves the type of the object for the specified object definition resolving - an object type name to a Type (if necessary) and storing the resolved Type - in the object definition for further use. - - The merged object definition to dertermine the type for. - Name of the object (for error handling purposes). - - - - - Is the object (definition) with the supplied an - ? - - The name of the object to be checked. - - the object (definition) with the supplied - an ? - - - - - Remove the object identified by the supplied - from this factory's singleton cache. - - - The name of the object that is to be removed from the singleton - cache. - - - If the argument is or - consists wholly of whitespace characters. - - - - - Return the names of objects in the singleton cache that match the given - object type (including subclasses). - - - The class or interface to match, or for all object names. - - -

- Will not consider s - as the type of their created objects is not known before instantiation. -

-

- Does not consider any hierarchy this factory may participate in. -

-
- - The names of objects in the singleton cache that match the given - object type (including subclasses), or an empty array if none. - -
- - - Determines whether the object with the given name matches the specified type. - - More specifically, check whether a GetObject call for the given name - would return an object that is assignable to the specified target type. - Translates aliases back to the corresponding canonical bean name. - Will ask the parent factory if the bean cannot be found in this factory instance. - - The name of the object to query. - Type of the target to match against. - - true if the object type matches; otherwise, false - if it doesn't match or cannot be determined yet. - - Ff there is no object with the given name - - - - - Determines the of the object with the - supplied . - - -

- More specifically, checks the of object that - would return. - For an , returns the - of object that the - creates. -

-

- Please note that (prototype) objects created via a factory method or - objects are handled - slightly differently, in that we don't want to needlessly create - instances of such objects just to determine the - of object that they create. -

-
- The name of the object to query. - - The of the object or - if not determinable. - -
- - - Determines the of the object defined - by the supplied object . - - -

- This, the default, implementation returns - to indicate that the type cannot be determined. Subclasses are - encouraged to try to determine the actual return - here, matching their strategy of resolving - factory methods in the - Spring.Objects.Factory.Support.AbstractObjectFactory.CreateObject - implementation. -

-
- - The name associated with the supplied object . - - - The - that the is to be determined for. - - - The of the object defined by the supplied - object ; or if the - cannot be determined. - -
- - - Returns the names of the objects in the singleton cache. - - -

- Does not consider any hierarchy this factory may participate in. -

-
- The names of the objects in the singleton cache. -
- - - Returns the number of objects in the singleton cache. - - -

- Does not consider any hierarchy this factory may participate in. -

-
- The number of objects in the singleton cache. -
- - - Destroys the named singleton object. - - -

- Delegates to - - if a corresponding singleton instance is found. -

-
- - The name of the singleton object that is to be destroyed. - - -
- - - Check the supplied merged object definition for any possible - validation errors. - - - The object definition to be checked for validation errors. - - - The name of the object associated with the supplied object definition. - - - The the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - - The arguments to use if creating a prototype using explicit arguments to - a factory method. If there is no factory method and the - supplied array is not , then - match the argument values by type and call the object's constructor. - - - In the case of object validation errors. - - - - - Parent object factory, for object inheritance support - - - - - Dependency types to ignore on dependency check and autowire, as Set of - Type objects: for example, string. Default is none. - - - - - ObjectPostProcessors to apply in CreateObject - - - - - Indicates whether any IInstantiationAwareBeanPostProcessors have been registered - - - - - Indicates whether any IDestructionAwareBeanPostProcessors have been registered - - - - - Set of registered singletons, containing the bean names in registration order - - - - - Set that holds all inner objects created by this factory that implement the IDisposable - interface, to be destroyed on call to Dispose. - - - - - Determines whether the local object factory contains a bean of the given name, - ignoring object defined in ancestor contexts. - This is an alternative to ContainsObject, ignoring an object - of the given name from an ancestor object factory. - - The name of the object to query. - - true if objects with the specified name is defined in the local factory; otherwise, false. - - - - - Is this object a singleton? - - - - - - Determines whether the specified object name is prototype. That is, will GetObject - always return independent instances? - - The name of the object to query - - true if the specified object name will always deliver independent instances; otherwise, false. - - This method returning false does not clearly indicate a singleton object. - It indicated non-independent instances, which may correspond to a scoped object as - well. use the IsSingleton property to explicitly check for a shared - singleton instance. - Translates aliases back to the corresponding canonical object name. Will ask the - parent factory if the object can not be found in this factory instance. - - - if there is no object with the given name. - - - - Does this object factory contain an object with the given name? - - - This method does not (and it should not) check if the specified - object exists in one of the parent object factories. If it did, - message sources and event registries within application context - hierarchy would have circular references, which would cause stack - overflows during message lookup, for example. (A. Seovic) - - . - - - - Return the aliases for the given object name, if defined. - - . - - - - Return an unconfigured(!) instance (possibly shared or independent) of the given object name. - - - - This method will only instantiate the requested object. It does NOT inject any dependencies! - - - - - Return an instance (possibly shared or independent) of the given object name. - - . - - - - Return an instance (possibly shared or independent) of the given object name. - - - - - - Return an instance (possibly shared or independent) of the given object name. - - -

- This method allows an object factory to be used as a replacement for the - Singleton or Prototype design pattern. -

-

- Note that callers should retain references to returned objects. There is no - guarantee that this method will be implemented to be efficient. For example, - it may be synchronized, or may need to run an RDBMS query. -

-

- Will ask the parent factory if the object cannot be found in this factory - instance. -

-
- The name of the object to return. - - The arguments to use if creating a prototype using explicit arguments to - a static factory method. If there is no factory method and the - arguments are not null, then match the argument values by type and - call the object's constructor. - - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the supplied is . - -
- - - Return an instance (possibly shared or independent) of the given object name, - optionally injecting dependencies. - - The name of the object to return. - - The the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - - The arguments to use if creating a prototype using explicit arguments to - a factory method. If there is no factory method and the - supplied array is not , then - match the argument values by type and call the object's constructor. - - whether to inject dependencies or not. - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the object is not of the required type. - - - If the supplied is . - - - - - - - Checks, if the passed instance is of the required type. - - the name of the object - the actual instance - the type contract the given instance must adhere. - the object instance passed in via (for more fluent usage) - - if is null or not assignable to . - - - - - Creates a singleton instance for the specified object name and definition. - - - The object name (will be used as the key in the singleton cache key). - - The object definition. - - The arguments to use if creating a prototype using explicit arguments to - a static factory method. If there is no factory method and the - arguments are not null, then match the argument values by type and - call the object's constructor. - - The created object instance. - - - - Injects dependencies into the supplied instance - using the named object definition. - - - - - - Injects dependencies into the supplied instance - using the supplied . - - - - - - Destroy all cached singletons in this factory. - - - - - Ignore the given dependency type for autowiring - - . - - - - Determines whether the specified object name is currently in creation.. - - Name of the object. - - true if the specified object name is currently in creation; otherwise, false. - - - - - Add a new - that will get applied to objects created by this factory. - - - The - to register. - - . - - - - Given an object name, create an alias. - - . - - - - Register the given existing object as singleton in the object factory, - under the given object name. - - . - - - - Register the given custom - for all properties of the given . - - . - - - - Does this object factory contains a singleton instance with the - supplied ? - - - - - - Tries to find a cached object for the specified name. - - Teh object name to look for. - The cached object if found, otherwise. - - - - Determines whether the given object name is already in use within this factory, - i.e. whether there is a local object or alias registered under this name or - an inner object created with this name. - - Name of the object to check. - - true if is object name in use; otherwise, false. - - - - - Returns, whether this factory treats object names case sensitive or not. - - - - - Gets the of - s - that will be applied to objects created by this factory. - - - - - Gets the set of classes that will be ignored for autowiring. - - -

- The elements of this are - s. -

-
-
- - - Returns, whether this object factory instance contains objects. - - - - - Returns, whether this object factory instance contains objects. - - - - - Gets the temporary object that is placed - into the singleton cache during object resolution. - - - - - Set that holds all inner objects created by this factory that implement the IDisposable - interface, to be destroyed on call to Dispose. - - - - - The parent object factory, or if there is none. - - - The parent object factory, or if there is none. - - - - - Return an instance (possibly shared or independent) of the given object name. - - . - - - - Returns the current number of registered - s. - - - The current number of registered - s. - - . - - - - Gets the names of singleton objects registered in this registry. - - The list of names as String array (never null). - - - Only checks already instantiated singletons; does not return names - for singleton bean definitions which have not been instantiated yet. - - - The main purpose of this method is to check manually registered singletons - . Can also be used to check which - singletons defined by an object definition have already been created. - - - - - - - - - Gets the number of singleton beans registered in this registry. - - The number of singleton objects. - - - Only checks already instantiated singletons; does not count - singleton object definitions which have not been instantiated yet. - - - The main purpose of this method is to check manually registered singletons - . Can also be used to count the number of - singletons defined by an object definition that have already been created. - - - - - - - - - Makes a distinction between sort order and object identity. - This is important when used with , since most - implementations assume Order == Identity - - - - - Handle the case when both objects have equal sort order priority. By default returns 0, - but may be overriden for handling special cases. - - The first object to compare. - The second object to compare. - - -1 if first object is less then second, 1 if it is greater, or 0 if they are equal. - - - - - The used during the invocation and - searching for of methods. - - - - - The instance for this class. - - - - - Creates a new instance of the - - class. - - -

- This is an class, and as such exposes no public constructors. -

-
- Flag specifying whether to make this object factory case sensitive or not. -
- - - Creates a new instance of the - - class. - - -

- This is an class, and as such exposes no public constructors. -

-
- Flag specifying whether to make this object factory case sensitive or not. - The parent object factory, or if none. -
- - - Predict the eventual object type (of the processed object instance) for the - specified object. - - Name of the object. - The merged object definition to determine the type for. - - The type of the object, or null if not predictable - - - - - Determines the of the object defined - by the supplied object . - - - The name associated with the supplied object . - - - The - that the is to be determined for. - - - The of the object defined by the supplied - object ; or if the - cannot be determined. - - - - - Apply the property values of the object definition with the supplied - to the supplied . - - - The existing object that the property values for the named object will - be applied to. - - - The name of the object definition associated with the property values that are - to be applied. - - - - - Apply any - s. - - -

- The returned instance may be a wrapper around the original. -

-
- - The of the object that is to be - instantiated. - - - The name of the object that is to be instantiated. - - - An instance to use in place of the original instance. - - - In case of errors. - -
- - - Apply the given property values, resolving any runtime references - to other objects in this object factory. - - - The object name passed for better exception information. - - - The definition of the named object. - - - The wrapping the target object. - - - The new property values. - - -

- Must use deep copy, so that we don't permanently modify this property. -

-
-
- - - Return an array of object-type property names that are unsatisfied. - - -

- These are probably unsatisfied references to other objects in the - factory. Does not include simple properties like primitives or - s. -

-
- - An array of object-type property names that are unsatisfied. - - - The definition of the named object. - - - The wrapping the target object. - -
- - - Destroy all cached singletons in this factory. - - -

- To be called on shutdown of a factory. -

-
-
- - - Populate the object instance in the given - with the property values from the - object definition. - - - The name of the object. - - - The definition of the named object. - - - The wrapping the target object. - - - - - Wires up any exposed events in the object instance in the given - with any event handler - values from the . - - - The name of the object. - - - The definition of the named object. - - - The wrapping the target object. - - - - - Fills in any missing property values with references to - other objects in this factory if autowire is set to - . - - - The object name to be autowired by . - - - The definition of the named object to update through autowiring. - - - The wrapping the target object (and - from which we can rip out information concerning the object). - - - The property values to register wired objects with. - - - - - Defines "autowire by type" (object properties by type) behavior. - - -

- This is like PicoContainer default, in which there must be exactly one object - of the property type in the object factory. This makes object factories simple - to configure for small namespaces, but doesn't work as well as standard Spring - behavior for bigger applications. -

-
- - The object name to be autowired by . - - - The definition of the named object to update through autowiring. - - - The wrapping the target object (and - from which we can rip out information concerning the object). - - - The property values to register wired objects with. - -
- - - Ignore the given dependency type for autowiring - - - This will typically be used by application contexts to register - dependencies that are resolved in other ways, like IOjbectFactory through - IObjectFactoryAware or IApplicationContext through IApplicationContextAware. - By default, IObjectFactoryAware and IObjectName interfaces are ignored. - For further types to ignore, invoke this method for each type. - - . - - - - Create an object instance for the given object definition. - - The name of the object. - - The object definition for the object that is to be instantiated. - - - The arguments to use if creating a prototype using explicit arguments to - a static factory method. It is invalid to use a non- arguments value - in any other case. - - - Whether eager caching of singletons is allowed... typically true for - singlton objects, but never true for inner object definitions. - - - Suppress injecting dependencies yet. - - - A new instance of the object. - - - In case of errors. - - -

- The object definition will already have been merged with the parent - definition in case of a child definition. -

-

- All the other methods in this class invoke this method, although objects - may be cached after being instantiated by this method. All object - instantiation within this class is performed by this method. -

-
-
- - - Add the created, but yet unpopulated singleton to the singleton cache - to be able to resolve circular references - - the name of the object to add to the cache. - the definition used to create and populated the object. - the raw object instance. - - Derived classes may override this method to select the right cache based on the object definition. - - - - - Remove the specified singleton from the singleton cache that has - been added before by a call to - - the name of the object to remove from the cache. - the definition used to create and populated the object. - - Derived classes may override this method to select the right cache based on the object definition. - - - - - Creates an instance from the passed in - using constructor - - The name of the object to create - used for error messages. - The describing the object to be created. - optional arguments to pass to the constructor - An wrapping the already instantiated object - - - - Instantiates the given object using its default constructor - - Name of the object. - The definition. - IObjectWrapper for the new instance - - - - Determines candidate constructors to use for the given bean, checking all registered - - - Raw type of the object. - Name of the object. - the candidate constructors, or null if none specified - In case of errors - - - - - Instantiate an object instance using a named factory method. - - -

- The method may be static, if the - parameter specifies a class, rather than a - instance, or an - instance variable on a factory object itself configured using Dependency - Injection. -

-

- Implementation requires iterating over the static or instance methods - with the name specified in the supplied - (the method may be overloaded) and trying to match with the parameters. - We don't have the types attached to constructor args, so trial and error - is the only way to go here. -

-
- - The name associated with the supplied . - - - The definition describing the instance that is to be instantiated. - - - Any arguments to the factory method that is to be invoked. - - - The result of the factory method invocation (the instance). - -
- - - "autowire constructor" (with constructor arguments by type) behaviour. - - The name of the object to autowire by type. - The object definition to update through autowiring. - The chosen candidate constructors. - The argument values passed in programmatically via the GetObject method, - or null if none (-> use constructor argument values from object definition) - - An for the new instance. - - - - Also applied if explicit constructor argument values are specified, - matching all remaining arguments with objects from the object factory. - - - This corresponds to constructor injection: in this mode, a Spring.NET - object factory is able to host components that expect constructor-based - dependency resolution. - - - - - - Perform a dependency check that all properties exposed have been set, if desired. - - -

- Dependency checks can be objects (collaborating objects), simple (primitives - and ), or all (both). -

-
- - The name of the object. - - - The definition of the named object. - - - The wrapping the target object. - - - The property values to be checked. - - - If all of the checked dependencies were not satisfied. - -
- - - Extract a filtered set of PropertyInfos from the given IObjectWrapper, excluding - ignored dependency types. - - The object wrapper the object was created with. - The filtered PropertyInfos - - - - Determine whether the given bean property is excluded from dependency checks. - This implementation excludes properties whose type matches an ignored dependency type - or which are defined by an ignored dependency interface. - - - - the of the object property - whether the object property is excluded - - - - Give an object a chance to react now all its properties are set, - and a chance to know about its owning object factory (this object). - - -

- This means checking whether the object implements - and / or - , and invoking the - necessary callback(s) if it does. -

-

- Custom init methods are resolved in a case-insensitive manner. -

-
- - The new object instance we may need to initialise. - - - The name the object has in the factory. Used for logging output. - - - The definition of the target object instance. - -
- - - Invoke the specified custom destroy method on the given object. - - -

- This implementation invokes a no-arg method if found, else checking - for a method with a single boolean argument (passing in "true", - assuming a "force" parameter), else logging an error. -

-

- Can be overridden in subclasses for custom resolution of destroy - methods with arguments. -

-

- Custom destroy methods are resolved in a case-insensitive manner. -

-
-
- - - Destroy the target object. - - -

- Must destroy objects that depend on the given object before the object itself. - Should not throw any exceptions. -

-
- - The name of the object. - - - The target object instance to destroyed. - -
- - - Destroys all of the objects registered as dependant on the - object (definition) identified by the supplied . - - - The name of the root object (definition) that is itself being destroyed. - - - - - Resolve a reference to another object in the factory. - - - The name of the object that is having the value of one of its properties resolved. - - - The definition of the named object. - - - The name of the property the value of which is being resolved. - - - The runtime reference containing the value of the property. - - A reference to another object in the factory. - - - - Find object instances that match the required . - - -

- Called by autowiring. If a subclass cannot obtain information about object - names by , a corresponding exception should be thrown. -

-
- - The of the objects to look up. - - - An of object names and object - instances that match the required , or - if none are found. - - - In case of errors. - -
- - - Return the names of the objects that depend on the given object. - Called by DestroyObject, to be able to destroy depending objects first. - - - The name of the object to find depending objects for. - - - The array of names of depending objects, or the empty string array if none. - - - In case of errors. - - - - - Injects dependencies into the supplied instance - using the named object definition. - - - The object instance that is to be so configured. - - - The name of the object definition expressing the dependencies that are to - be injected into the supplied instance. - - - - - - Injects dependencies into the supplied instance - using the supplied . - - - The object instance that is to be so configured. - - - The name of the object definition expressing the dependencies that are to - be injected into the supplied instance. - - - An object definition that should be used to configure object. - - - - - - Configures object instance by injecting dependencies, satisfying Spring lifecycle - interfaces and applying object post-processors. - - - The name of the object definition expressing the dependencies that are to - be injected into the supplied instance. - - - An object definition that should be used to configure object. - - - A wrapped object instance that is to be so configured. - - - - - - Applies the PostProcessAfterInitialization callback of all - registered IObjectPostProcessors, giving them a chance to post-process - the object obtained from IFactoryObjects (for example, to auto-proxy them) - - The instance obtained from the IFactoryObject. - Name of the object. - The object instance to expose - if any post-processing failed. - - - - Create a new object instance of the given class with the specified - autowire strategy. - - - The of the object to instantiate. - - - The desired autowiring mode. - - - Whether to perform a dependency check for objects (not applicable to - autowiring a constructor, thus ignored there). - - The new object instance. - - If the wiring fails. - - - - - - Autowire the object properties of the given object instance by name or - . - - - The existing object instance. - - - The desired autowiring mode. - - - Whether to perform a dependency check for the object. - - - If the wiring fails. - - - If the supplied is not one of the - or - - values. - - - - - - Apply s - to the given existing object instance, invoking their - - methods. - - - The existing object instance. - - - The name of the object. - - - The object instance to use, either the original or a wrapped one. - - - If any post-processing failed. - - - - - - Apply s - to the given existing object instance, invoking their - - methods. - - - The existing object instance. - - - The name of the object. - - - The object instance to use, either the original or a wrapped one. - - - If any post-processing failed. - - - - - - Resolve the specified dependency against the objects defined in this factory. - - The descriptor for the dependency. - Name of the object which declares the present dependency. - A list that all names of autowired object (used for - resolving the present dependency) are supposed to be added to. - - the resolved object, or null if none found - - if dependency resolution failed - - - - Cache of filtered PropertyInfos: object Type -> PropertyInfo array - - - - - Dependency interfaces to ignore on dependency check and autowire, as Set of - Class objects. By default, only the IObjectFactoryAware and IObjectNameAware - interfaces are ignored. - - - - - The - implementation to be used to instantiate managed objects. - - - - - An - implementation that provides some convenience support for - derived classes. - - -

- This class is reserved for internal use within the framework; it is - not intended to be used by application developers using Spring.NET. -

-
- Rick Evans -
- - - Permits the (re)implementation of an arbitrary method on a Spring.NET - IoC container managed object. - - -

- Encapsulates the notion of the Method-Injection form of Dependency - Injection. -

-

- Methods that are dependency injected with implementations of this - interface may be (but need not be) , in which - case the container will create a concrete subclass of the - class prior to instantiation. -

-

- Do not use this mechanism as a means of AOP. See the reference - manual for examples of appropriate usages of this interface. -

-
- Rod Johnson - Rick Evans (.NET) -
- - - Reimplement the supplied . - - - The instance whose is to be - (re)implemented. - - - The method that is to be (re)implemented. - - The target method's arguments. - - The result of the (re)implementation of the method call. - - - - - Creates a new instance of the - - class. - - -

- This is an class, and as such has no - publicly visible constructors. -

-
- - The object definition that is the target of the method replacement. - - - The enclosing IoC container with which the above - is associated. - - - If either of the supplied arguments is . - -
- - - Is ; derived classes must supply an implementation. - - - The instance whose is to be - (re)implemented. - - - The method that is to be (re)implemented. - - The target method's arguments. - The result of the object lookup. - - - - Helper method for subclasses to retrieve the appropriate - for the - supplied . - - - The to use to retrieve - the appropriate - . - - - The appropriate - . - - - - - Helper method for subclasses to lookup an object from an enclosing - IoC container. - - - The name of the object that is to be looked up. - - - The named object. - - - - - Common base class for object definitions, factoring out common - functionality from - and - . - - Rod Johnson - Juergen Hoeller - Rick Evans (.NET) - - - - Describes a configurable object instance, which has property values, - constructor argument values, and further information supplied by concrete - implementations. - - Rick Evans - - - - Return the property values to be applied to a new instance of the object. - - - - - Return the constructor argument values for this object. - - - - - The method overrides (if any) for this object. - - - The method overrides (if any) for this object; may be an - empty collection but is guaranteed not to be - . - - - - - Return the event handlers for any events exposed by this object. - - - - - Return a description of the resource that this object definition - came from (for the purpose of showing context in case of errors). - - - - - Is this object definition "abstract", i.e. not meant to be instantiated - itself but rather just serving as parent for concrete child object - definitions. - - - if this object definition is "abstract". - - - - - Returns the of the object definition (if any). - - - A resolved object . - - - If the of the object definition is not a - resolved or . - - - - - Returns the of the - of the object definition (if any). - - - - - Return whether this a Singleton, with a single, shared instance - returned on all calls. - - -

- If , an object factory will apply the Prototype - design pattern, with each caller requesting an instance getting an - independent instance. How this is defined will depend on the - object factory implementation. Singletons are the commoner type. -

-
-
- - - Is this object lazily initialized? - -

- Only applicable to a singleton object. -

-

- If , it will get instantiated on startup by object factories - that perform eager initialization of singletons. -

-
-
- - - The autowire mode as specified in the object definition. - - -

- This determines whether any automagical detection and setting of - object references will happen. Default is - , - which means there's no autowire. -

-
-
- - - The dependency check code. - - - - - The object names that this object depends on. - - -

- The object factory will guarantee that these objects get initialized - before. -

-

- Note that dependencies are normally expressed through object properties - or constructor arguments. This property should just be necessary for - other kinds of dependencies like statics (*ugh*) or database - preparation on startup. -

-
-
- - - The name of the initializer method. - - -

- The default is , in which case there is no initializer method. -

-
-
- - - Return the name of the destroy method. - - -

- The default is , in which case there is no destroy method. -

-
-
- - - The name of the factory method to use (if any). - - -

- This method will be invoked with constructor arguments, or with no - arguments if none are specified. The static method will be invoked on - the specified . -

-
-
- - - The name of the factory object to use (if any). - - - - - Gets or sets a value indicating whether this instance a candidate for getting autowired into some other - object. - - - true if this instance is autowire candidate; otherwise, false. - - - - - Creates a new instance of the - - class. - - -

- This is an class, and as such exposes no - public constructors. -

-
-
- - - Creates a new instance of the - - class. - - -

- This is an class, and as such exposes no - public constructors. -

-
-
- - - Creates a new instance of the - - class. - - - The object definition used to initialise the member fields of this - instance. - - -

- This is an class, and as such exposes no - public constructors. -

-
-
- - - Resolves the type of the object, resolving it from a specified - object type name if necessary. - - - A resolved instance. - - - If the type cannot be resolved. - - - - - Validate this object definition. - - - In the case of a validation failure. - - - - - Validates all - - - - - Validate the supplied . - - - The - to be validated. - - - - - Override settings in this object definition from the supplied - object definition. - - - The object definition used to override the member fields of this instance. - - - - - Returns a that represents the current - . - - - A that represents the current - . - - - - - The property values that are to be applied to the object - upon creation. - - -

- Setting the value of this property to - will merely result in a new (and empty) - - collection being assigned to the property value. -

-
- - The property values (if any) for this object; may be an - empty collection but is guaranteed not to be - . - -
- - - Does this definition have any - ? - - - if this definition has at least one - . - - - - - The constructor argument values for this object. - - -

- Setting the value of this property to - will merely result in a new (and empty) - - collection being assigned. -

-
- - The constructor argument values (if any) for this object; may be an - empty collection but is guaranteed not to be - . - -
- - - The event handler values for this object. - - -

- Setting the value of this property to - will merely result in a new (and empty) - - collection being assigned. -

-
- - The event handler values (if any) for this object; may be an - empty collection but is guaranteed not to be - . - -
- - - The method overrides (if any) for this object. - - -

- Setting the value of this property to - will merely result in a new (and empty) - - collection being assigned to the property value. -

-
- - The method overrides (if any) for this object; may be an - empty collection but is guaranteed not to be - . - -
- - - Is this definition a singleton, with - a single, shared instance returned on all calls to an enclosing - container (typically an - or - ). - - -

- If , an object factory will apply the - prototype design pattern, with each caller requesting an - instance getting an independent instance. How this is defined - will depend on the object factory implementation. singletons - are the commoner type. -

-
- -
- - - Gets a value indicating whether this instance is prototype, with an independent instance - returned for each call. - - - true if this instance is prototype; otherwise, false. - - - - - Is this object lazily initialized? - -

- Only applicable to a singleton object. -

-

- If , it will get instantiated on startup - by object factories that perform eager initialization of - singletons. -

-
-
- - - Is this object definition a "template", i.e. not meant to be instantiated - itself but rather just serving as an object definition for configuration - templates used by . - - - if this object definition is a "template". - - - - - Is this object definition "abstract", i.e. not meant to be - instantiated itself but rather just serving as a parent for concrete - child object definitions. - - - if this object definition is "abstract". - - - - - The of the object definition (if any). - - - A resolved object . - - - If the of the object definition is not a - resolved or . - - - - - - Is the of the object definition a resolved - ? - - - - - Returns the of the - of the object definition (if any). - - - - - A description of the resource that this object definition - came from (for the purpose of showing context in case of errors). - - - - - The autowire mode as specified in the object definition. - - -

- This determines whether any automagical detection and setting of - object references will happen. The default is - , - which means that no autowiring will be performed. -

-
-
- - - Gets the resolved autowire mode. - - -

- This resolves - - to one of - - or - . -

-
-
- - - The dependency checking mode. - - -

- The default is - . -

-
-
- - - The object names that this object depends on. - - -

- The object factory will guarantee that these objects get initialized - before this object definition. -

- - Dependencies are normally expressed through object properties - or constructor arguments. This property should just be necessary for - other kinds of dependencies such as statics (*ugh*) or database - preparation on startup. - -
-
- - - Gets or sets a value indicating whether this instance a candidate for getting autowired into some other - object. - - - true if this instance is autowire candidate; otherwise, false. - - - - - The name of the initializer method. - - -

- The default value is the constant, - in which case there is no initializer method. -

-
-
- - - Return the name of the destroy method. - - -

- The default value is the constant, - in which case there is no destroy method. -

-
-
- - - The name of the factory method to use (if any). - - -

- This method will be invoked with constructor arguments, or with no - arguments if none are specified. The - method will be invoked on the specified - . -

-
-
- - - The name of the factory object to use (if any). - - - - - Does this object definition have any constructor argument values? - - - if his object definition has at least one - element in it's - - property. - - - - - Abstract base class for object definition readers. - - -

- Provides common properties like the object registry to work on. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Simple interface for object definition readers. - - Juergen Hoeller - Rick Evans - - - - Load object definitions from the supplied . - - - The resource for the object definitions that are to be loaded. - - - The number of object definitions found - - - In the case of loading or parsing errors. - - - - - Load object definitions from the supplied . - - - The resources for the object definitions that are to be loaded. - - - The number of object definitions found - - - In the case of loading or parsing errors. - - - - - Loads the object definitions from the specified resource location. - - The resource location, to be loaded with the - IResourceLoader location . - - The number of object definitions found - - - - - Loads the object definitions from the specified resource locations. - - The the resource locations to be loaded with the - IResourceLoader of this object definition reader. - - The number of object definitions found - - - - - Gets the - - instance that this reader works on. - - - - - The against which any class names - will be resolved into instances. - - - - - The to use for anonymous - objects (wihtout explicit object name specified). - - - - - Gets the resource loader to use for resource locations. - - There is also a method - available for loading object definitions from a resource location. This is - a convenience to avoid explicit ResourceLoader handling. - The resource loader. - - - - The shared instance for this class (and derived classes). - - - - - Creates a new instance of the - - class. - - - The - instance that this reader works on. - - -

- This is an class, and as such exposes no public constructors. -

-
-
- - - Creates a new instance of the - - class. - - - The - instance that this reader works on. - - - The against which any class names - will be resolved into instances. - - -

- This is an class, and as such exposes no public constructors. -

-
-
- - - Load object definitions from the supplied . - - - The resource for the object definitions that are to be loaded. - - - The number of object definitions that were loaded. - - - In the case of loading or parsing errors. - - - - - Load object definitions from the supplied . - - - The resources for the object definitions that are to be loaded. - - - The number of object definitions found - - - In the case of loading or parsing errors. - - - - - Loads the object definitions from the specified resource location. - - The resource location, to be loaded with the - IResourceLoader location . - - The number of object definitions found - - - - - Loads the object definitions from the specified resource locations. - - The the resource locations to be loaded with the - IResourceLoader of this object definition reader. - - The number of object definitions found - - - - - Gets the - - instance that this reader works on. - - - - - The to use for anonymous - objects (wihtout explicit object name specified). - - - - - - The against which any class names - will be resolved into instances. - - - - - Gets or sets the resource loader to use for resource locations. - - The resource loader. - - - - Utility class that contains various methods useful for the implementation of - autowire-capable object factories. - - Juergen Hoeller - Rick Evans (.NET) - - - - Creates a new instance of the AutowireUtils class. - - -

- This is a utility class, and as such has no publicly - visible constructors. -

-
-
- - - Gets those s - that are applicable for autowiring the supplied . - - - The - (definition) that is being autowired by constructor. - - - The absolute minimum number of arguments that any returned constructor - must have. If this parameter is equal to zero (0), then all constructors - are valid (regardless of their argument count), including any default - constructor. - - - Those s - that are applicable for autowiring the supplied . - - - - - Determine a weight that represents the class hierarchy difference between types and - arguments. - - -

- A direct match, i.e. type MyInteger -> arg of class MyInteger, does not increase - the result - all direct matches means weight zero (0). A match between the argument type - and a MyInteger instance argument would increase the weight by - 1, due to the superclass () being one (1) steps up in the - class hierarchy being the last one that still matches the required type. -

-

- Therefore, with an argument of type , a - constructor taking a argument would be - preferred to a constructor taking an argument - which would be preferred to a constructor taking an - argument which would in turn be preferred - to a constructor taking an argument. -

-

- All argument weights get accumulated. -

-
- - The argument s to match. - - The arguments to match. - The accumulated weight for all arguments. -
- - - Algorithm that judges the match between the declared parameter types of a candidate method - and a specific list of arguments that this method is supposed to be invoked with. - - - Determines a weight that represents the class hierarchy difference between types and - arguments. The following a an example based on the Java class hierarchy for Integer. - A direct match, i.e. type Integer -> arg of class Integer, does not increase - the result - all direct matches means weight 0. A match between type Object and arg of - class Integer would increase the weight by 2, due to the superclass 2 steps up in the - hierarchy (i.e. Object) being the last one that still matches the required type Object. - Type Number and class Integer would increase the weight by 1 accordingly, due to the - superclass 1 step up the hierarchy (i.e. Number) still matching the required type Number. - Therefore, with an arg of type Integer, a constructor (Integer) would be preferred to a - constructor (Number) which would in turn be preferred to a constructor (Object). - All argument weights get accumulated. - - The param types. - The args. - - - - - Determines whether the given object property is excluded from dependency checks. - - The PropertyInfo of the object property. - - true if is excluded from dependency check; otherwise, false. - - - - - Sorts the supplied , preferring - public constructors and "greedy" ones (that have lots of arguments). - - -

- The result will contain public constructors first, with a decreasing number - of arguments, then non-public constructors, again with a decreasing number - of arguments. -

-
- - The array to be sorted. - -
- - - Determines whether the setter property is defined in any of the given interfaces. - - The PropertyInfo of the object property - The ISet of interfaces. - - true if setter property is defined in interface; otherwise, false. - - - - - Creates the autowire candidate resolver. - - A SimpleAutowireCandidateResolver - - - - Object definition for definitions that inherit settings from their - parent (object definition). - - -

- Will use the - of the parent object definition if none is specified, but can also - override it. In the latter case, the child's - - must be compatible with the parent, i.e. accept the parent's property values - and constructor argument values (if any). -

-

- A will - inherit all of the , - , and - from it's parent - object definition, with the option to add new values. If the - , - , - and / or - - properties are specified, they will override the corresponding parent settings. -

-

- The remaining settings will always be taken from the child definition: - , - , - , - , - and - -

-
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) - -
- - - Creates a new instance of the - - class. - - - The name of the parent object. - - - - - Creates a new instance of the - - class. - - - The name of the parent object. - - - The additional property values (if any) of the child. - - - - - Creates a new instance of the - - class. - - - The name of the parent object. - - - The - to be applied to a new instance of the object. - - - The additional property values (if any) of the child. - - - - - Creates a new instance of the - - class. - - - The name of the parent object. - - - The class of the object to instantiate. - - - The - to be applied to a new instance of the object. - - - The additional property values (if any) of the child. - - - - - Creates a new instance of the - - class. - - - The name of the parent object. - - - The of the object to - instantiate. - - - The - to be applied to a new instance of the object. - - - The additional property values (if any) of the child. - - - - - Validate this object definition. - - -

- A common cause of validation failures is a missing value for the - - property; by - their very nature require that the - - be set. -

-
- - In the case of a validation failure. - -
- - - A that represents the current - . - - - A that represents the current - . - - - - - The name of the parent object definition. - - -

- This value is required. -

-
- - The name of the parent object definition. - -
- - - Helper class for resolving constructors and factory methods. - Performs constructor resolution through argument matching. - - - Operates on a and an . - Used by . - - Juergen Hoeller - Mark Pollack - - - - Initializes a new instance of the class for the given factory - and instantiation strategy. - - The object factory to work with. - The object factory as IAutowireCapableObjectFactory. - The instantiation strategy for creating objects. - - - - "autowire constructor" (with constructor arguments by type) behavior. - Also applied if explicit constructor argument values are specified, - matching all remaining arguments with objects from the object factory. - - - This corresponds to constructor injection: In this mode, a Spring - object factory is able to host components that expect constructor-based - dependency resolution. - - Name of the object. - The merged object definition for the object. - The chosen chosen candidate constructors (or null if none). - The explicit argument values passed in programmatically via the getBean method, - or null if none (-> use constructor argument values from object definition) - An IObjectWrapper for the new instance - - - - Instantiate an object instance using a named factory method. - - -

- The method may be static, if the - parameter specifies a class, rather than a - instance, or an - instance variable on a factory object itself configured using Dependency - Injection. -

-

- Implementation requires iterating over the static or instance methods - with the name specified in the supplied - (the method may be overloaded) and trying to match with the parameters. - We don't have the types attached to constructor args, so trial and error - is the only way to go here. -

-
- - The name associated with the supplied . - - - The definition describing the instance that is to be instantiated. - - - Any arguments to the factory method that is to be invoked. - - - The result of the factory method invocation (the instance). - -
- - - Create an array of arguments to invoke a constructor or static factory method, - given the resolved constructor arguments values. - - When return value is null the out parameter UnsatisfiedDependencyExceptionData will contain - information for use in throwing a UnsatisfiedDependencyException by the caller. This avoids using - exceptions for flow control as in the original implementation. - - - - Resolves the - of the supplied . - - The name of the object that is being resolved by this factory. - The rod. - The wrapper. - The cargs. - Where the resolved constructor arguments will be placed. - - The minimum number of arguments that any constructor for the supplied - must have. - - -

- 'Resolve' can be taken to mean that all of the s - constructor arguments is resolved into a concrete object that can be plugged - into one of the s constructors. Runtime object - references to other objects in this (or a parent) factory are resolved, - type conversion is performed, etc. -

-

- These resolved values are plugged into the supplied - object, because we wouldn't want to touch - the s constructor arguments in case it (or any of - its constructor arguments) is a prototype object definition. -

-

- This method is also used for handling invocations of static factory methods. -

-
-
- - - Returns an array of all of those - methods exposed on the - that match the supplied criteria. - - - Methods that have this name (can be in the form of a regular expression). - - - Methods that have exactly this many arguments. - - - Methods that are static / instance. - - - The on which the methods (if any) are to be found. - - - An array of all of those - methods exposed on the - that match the supplied criteria. - - - - - Concrete implementation of the - and - - interfaces. - - -

- This class is a full-fledged object factory based on object definitions - that is usable straight out of the box. -

-

- Can be used as an object factory in and of itself, or as a superclass - for custom object factory implementations. Note that readers for - specific object definition formats are typically implemented separately - rather than as object factory subclasses. -

-

- For an alternative implementation of the - interface, - have a look at the - - class, which manages existing object instances rather than creating new - ones based on object definitions. -

-
- Juergen Hoeller - Rick Evans (.NET) - -
- - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - Flag specifying whether to make this object factory case sensitive or not. - - - - Creates a new instance of the - class. - - The parent object factory. - - - - Creates a new instance of the - class. - - Flag specifying whether to make this object factory case sensitive or not. - The parent object factory. - - - - Find object instances that match the . - - -

- Called by autowiring. If a subclass cannot obtain information about object - names by , a corresponding exception should be thrown. -

-
- - The type of the objects to look up. - - - An of object names and object - instances that match the , or - if none is found. - - - In case of errors. - -
- - - Return the names of the objects that depend on the given object. - - -

- Called by the - - so that dependant objects are able to be disposed of first. -

-
- - The name of the object to find depending objects for. - - - The array of names of depending objects, or the empty string array if none. - - - In case of errors. - -
- - - Check whether the specified object matches the supplied . - - The name of the object to check. - - The to check for. - - - if the object matches the supplied , - or if the supplied is . - - - - - The instance for this class. - - - - - Whether to allow re-registration of a different definition with the - same name. - - - - - The mapping of object definition objects, keyed by object name. - - - - - List of object definition names, in registration order. - - - - - Resolver to use for checking if an object definition is an autowire candidate - - - - - IDictionary from dependency type to corresponding autowired value - - - - - Check if this registry contains a object definition with the given - name. - - - The name of the object to look for. - - - if this object factory contains an object - definition with the given name. - - - - - - Register a new object definition with this registry. - - - The name of the object instance to register. - - - The definition of the object instance to register. - - - If the object definition is invalid. - - - - - - Ensure that all non-lazy-init singletons are instantiated, also - considering s. - - - If one of the singleton objects could not be created. - - - - - - Register a special dependency type with corresponding autowired value. - - Type of the dependency to register. - This will typically be a base interface such as IObjectFactory, with extensions of it resolved - as well if declared as an autowiring dependency (e.g. IListableBeanFactory), - as long as the given value actually implements the extended interface. - The autowired value. This may also be an - implementation o the interface, - which allows for lazy resolution of the actual target value. - - This is intended for factory/context references that are supposed - to be autowirable but are not defined as objects in the factory: - e.g. a dependency of type ApplicationContext resolved to the - ApplicationContext instance that the object is living in. - - Note there are no such default types registered in a plain IObjectFactory, - not even for the BeanFactory interface itself. - - - - - - Return the registered - for the - given object, allowing access to its property values and constructor - argument values. - - The name of the object. - - The registered , - or null, if specified object definitions does not exist. - - - If is null or empty string. - - - - - - Return the registered - for the - given object, allowing access to its property values and constructor - argument values. - - The name of the object. - Whether to search parent object factories. - - The registered , - or null, if specified object definitions does not exist. - - - If is null or empty string. - - - - - - Return the names of all objects defined in this factory. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - - - - - - Return the names of objects matching the given - (including subclasses), judging from the object definitions. - - - The (class or interface) to match, or - for all object names. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - - - - - - Return the names of objects matching the given - (including subclasses), judging from the object definitions. - - - The (class or interface) to match, or - for all object names. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - - - - - - Return the names of objects matching the given - (including subclasses), judging from the object definitions. - - - The (class or interface) to match, or - for all object names. - - - Whether to include prototype objects too or just singletons (also applies to - s). - - - Whether to include s too - or just normal objects. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - - - - - - Return the object instances that match the given object - (including subclasses), judging from either object - definitions or the value of - in the case of - s. - - - The (class or interface) to match. - - - A of the matching objects, - containing the object names as keys and the corresponding object instances - as values. - - - If the objects could not be created. - - - - - - Return the object instances that match the given object - (including subclasses). - - - The (class or interface) to match. - - - Whether to include prototype objects too or just singletons (also applies to - s). - - - Whether to include s too - or just normal objects. - - - An of the matching objects, - containing the object names as keys and the corresponding object instances - as values. - - - If any of the objects could not be created. - - - - - - Return the object instances that match the given object - (including subclasses). - - - The (class or interface) to match. - - - Whether to include prototype objects too or just singletons (also applies to - s). - - - Whether to include s too - or just normal objects. - - - An of the matching objects, - containing the object names as keys and the corresponding object instances - as values. - - - If any of the objects could not be created. - - - - - - Resolve the specified dependency against the objects defined in this factory. - - The descriptor for the dependency. - Name of the object which declares the present dependency. - A list that all names of autowired object (used for - resolving the present dependency) are supposed to be added to. - - the resolved object, or null if none found - - if dependency resolution failed - - - - Raises the no such object definition exception for an unresolvable dependency - - The type. - The dependency description. - The descriptor. - - - - Determines whether the specified object qualifies as an autowire candidate, - to be injected into other beans which declare a dependency of matching type. - This method checks ancestor factories as well. - - Name of the object to check. - The descriptor of the dependency to resolve. - - true if the object should be considered as an autowire candidate; otherwise, false. - - if there is no object with the given name. - - - - Determine whether the specified object definition qualifies as an autowire candidate, - to be injected into other beans which declare a dependency of matching type. - - Name of the object definition to check. - The merged object definiton to check. - The descriptor of the dependency to resolve. - - true if the object should be considered as an autowire candidate; otherwise, false. - - - - - Should object definitions registered under the same name as an - existing object definition be allowed? - - -

- If , then the new object definition will - replace (override) the existing object definition. If - , an exception will be thrown when - an attempt is made to register an object definition under the same - name as an already existing object definition. -

-

- The default is . -

-
- - is the registration of an object definition - under the same name as an existing object definition is allowed. - -
- - - Get or set custom autowire candidate resolver for this IObjectFactory to use - when deciding whether a bean definition should be considered as a - candidate for autowiring. Never null - - - - - Return the number of objects defined in this registry. - - - The number of objects defined in this registry. - - - - - - Default implementation of the - - interface. - - -

- Does not support per - loading. -

-
- Aleksandar Seovic -
- - - Central interface for factories that can create - - instances. - - -

- Allows for replaceable object definition factories using the Strategy - pattern. -

-
- Aleksandar Seovic -
- - - Factory style method for getting concrete - - instances. - - - The FullName of the of the defined object. - - The name of the parent object definition (if any). - - The against which any class names - will be resolved into instances. It can be null to register the - object class just by name. - - - An - - instance. - - - - - Factory style method for getting concrete - - instances. - - /// If no parent is specified, a RootObjectDefinition is created, otherwise a - ChildObjectDefinition. - The of the defined object. - The name of the parent object definition (if any). - The against which any class names - will be resolved into instances. - - An - - instance. - - - - - Default implementation of the interface, deleagting to - 's GenerateObjectName. - - Note that this implementation is only able to handle - subclasses such as - and - - Juergen Hoeller - Mark Pollack (.NET) - - - - Strategy interface for generating object names for object definitions - - Juergen Hoeller - Mark Pollack (.NET) - - - - Generates an object name for the given object definition. - - The object definition to generate a name for. - The object definitions registry that the given definition is - supposed to be registerd with - the generated object name - - - - Generates an object name for the given object definition. - - The object definition to generate a name for. - The object definitions registry that the given definition is - supposed to be registerd with - the generated object name - - - - An - implementation that delegates to an - that is - obtained as the result of a lookup in an associated IoC container. - - -

- This class is reserved for internal use within the framework; it is - not intended to be used by application developers using Spring.NET. -

-
- Rick Evans -
- - - Creates a new instance of the - - class. - - - The object definition that is the target of the method replacement. - - - The enclosing IoC container with which the above - is associated. - - - If either of the supplied arguments is . - - - - - Reimplements the supplied by delegating to - another - looked up in an enclosing IoC container. - - - The instance whose is to be - (re)implemented. - - - The method that is to be (re)implemented. - - The target method's arguments. - - The result of the delegated call to the looked up - . - - - - - The various modes of dependency checking. - - Rick Evans (.NET) - - - - DO not do any dependency checking. - - - - - Check object references. - - - - - Just check primitive (string, int, etc) values. - - - - - Check everything. - - - - - Strategy interface for determining whether a specific object definition - qualifies as an autowire candidate for a specific dependency. - - Mark Fisher - Juergen hoeller - Mark Pollack (.NET) - - - - Determines whether the given object definition qualifies as an - autowire candidate for the given dependency. - - The object definition including object name and aliases. - The descriptor for the target method parameter or field. - - true if the object definition qualifies as autowire candidate; otherwise, false. - - - - - Responsible for creating instances corresponding to a - . - - Rod Johnson - Rick Evans (.NET) - - - - Instantiate an instance of the object described by the supplied - from the supplied . - - - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be the null - or zero length string if we're autowiring an object that doesn't belong - to the supplied . - - - The owning - - - An instance of the object described by the supplied - from the supplied . - - - - - Instantiate an instance of the object described by the supplied - from the supplied . - - - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be the null - or zero length string if we're autowiring an object that doesn't belong - to the supplied . - - - The owning - - - The to be used to instantiate - the object. - - - Any arguments to the supplied . May be null. - - - An instance of the object described by the supplied - from the supplied . - - - - - Instantiate an instance of the object described by the supplied - from the supplied . - - - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be the null - or zero length string if we're autowiring an object that doesn't belong - to the supplied . - - - The owning - - - The to be used to get the object. - - - Any arguments to the supplied . May be null. - - - An instance of the object described by the supplied - from the supplied . - - - - - Denotes a special placeholder collection that may contain - s or - other placeholder objects that will need to be resolved. - - -

- 'A special placeholder collection' means that the elements of this - collection can be placeholders for objects that will be resolved later by - a Spring.NET IoC container, i.e. the elements themselves will be - resolved at runtime by the enclosing IoC container. -

-

- The core Spring.NET library already provides three implementations of this interface - straight out of the box; they are... -

- - - - . - - - - - . - - - - - . - - - -

- If you have a custom collection class (i.e. a class that either implements the - directly or derives from a class that does) - that you would like to expose as a special placeholder collection (i.e. one that can - have s as elements - that will be resolved at runtime by an appropriate Spring.NET IoC container, just - implement this interface. -

-
- -

- Lets say one has a Bag class (i.e. a collection that supports bag style semantics). -

- - using System; - - using Spring.Objects.Factory.Support; - - namespace MyNamespace - { - public sealed class Bag : ICollection - { - // ICollection implementation elided for clarity... - - public void Add(object o) - { - // implementation elided for clarity... - } - } - - public class ManagedBag : Bag, IManagedCollection - { - public ICollection Resolve( - string objectName, RootObjectDefinition definition, - string propertyName, ManagedCollectionElementResolver resolver) - { - Bag newBag = new Bag(); - string elementName = propertyName + "[bag-element]"; - foreach(object element in this) - { - object resolvedElement = resolver(objectName, definition, elementName, element); - newBag.Add(resolvedElement); - } - return newBag; - } - } - } - -
- Rick Evans -
- - - Resolves this managed collection at runtime. - - - The name of the top level object that is having the value of one of it's - collection properties resolved. - - - The definition of the named top level object. - - - The name of the property the value of which is being resolved. - - - The callback that will actually do the donkey work of resolving - this managed collection. - - A fully resolved collection. - - - - Resolves a single element value of a managed collection. - - -

- If the does not need to be resolved or - converted to an appropriate , the - will be returned as-is. -

-
- - The name of the top level object that is having the value of one of it's - collection properties resolved. - - - The definition of the named top level object. - - - The name of the property the value of which is being resolved. - - - That element of a managed collection that may need to be resolved - to a concrete value. - - A fully resolved element. -
- - - Represents an override of a method that looks up an object in the same IoC context. - - -

- Methods eligible for lookup override must not have arguments. -

-
- Rod Johnson - Rick Evans (.NET) -
- - - Represents the override of a method on a managed object by the IoC container. - - -

- Note that the override mechanism is not intended as a generic means of - inserting crosscutting code: use AOP for that. -

-
- Rod Johnson - Rick Evans (.NET) -
- - - Creates a new instance of the - class. - - -

- This is an class, and as such exposes no - public constructors. -

-
- - The name of the method that is to be overridden. - - - If the supplied is or - contains only whitespace character(s). - -
- - - Does this - match the supplied ? - - -

- By 'match' one means does this particular - - instance apply to the supplied ? -

-

- This allows for argument list checking as well as method name checking. -

-
- The method to be checked. - - if this override matches the supplied - . - -
- - - The name of the method that is to be overridden. - - - - - Is the method that is ot be injected - () - to be considered as overloaded? - - -

- If (the default), then argument type matching - will be performed (because one would not want to override the wrong - method). -

-

- Setting the value of this property to can be used - to optimize runtime performance (ever so slightly). -

-
-
- - - Creates a new instance of the - class. - - -

- Methods eligible for lookup override must not have arguments. -

-
- - The name of the method that is to be overridden. - - - The name of the object in the current IoC context that the - dependency injected method must return. - - - If either of the supplied arguments is or - contains only whitespace character(s). - -
- - - Does this - match the supplied ? - - The method to be checked. - - if this override matches the supplied . - - - If the supplied is . - - - - - A that represents the current - . - - - A that represents the current - . - - - - - The name of the object in the current IoC context that the - dependency injected method must return. - - - - - An - implementation that simply returns the result of a lookup in an - associated IoC container. - - -

- This class is Spring.NET's implementation of Dependency Lookup via - Method Injection. -

-

- This class is reserved for internal use within the framework; it is - not intended to be used by application developers using Spring.NET. -

-
- Rick Evans -
- - - Creates a new instance of the - class. - - - The object definition that is the target of the method replacement. - - - The enclosing IoC container with which the above - is associated. - - - If either of the supplied arguments is . - - - - - Reimplements the supplied by returning the - result of an object lookup in an enclosing IoC container. - - - The instance whose is to be - (re)implemented. - - - The method that is to be (re)implemented. - - The target method's arguments. - - The result of the object lookup. - - - - - Tag subclass used to hold a dictionary of managed elements. - - Juergen Hoeller - Rick Evans (.NET) - - - - Resolves this managed collection at runtime. - - - The name of the top level object that is having the value of one of it's - collection properties resolved. - - - The definition of the named top level object. - - - The name of the property the value of which is being resolved. - - - The callback that will actually do the donkey work of resolving - this managed collection. - - A fully resolved collection. - - - - Gets or sets the unresolved name for the - of the keys of this managed dictionary. - - The unresolved name for the type of the keys of this managed dictionary. - - - - Gets or sets the unresolved name for the - of the values of this managed dictionary. - - The unresolved name for the type of the values of this managed dictionary. - - - - Tag subclass used to hold a list of managed elements. - - Rod Johnson - Rick Evans (.NET) - - - - Resolves this managed collection at runtime. - - - The name of the top level object that is having the value of one of it's - collection properties resolved. - - - The definition of the named top level object. - - - The name of the property the value of which is being resolved. - - - The callback that will actually do the donkey work of resolving - this managed collection. - - A fully resolved collection. - - - - Gets or sets the unresolved name for the - of the elements of this managed list. - - The unresolved name for the type of the elements of this managed list. - - - - Tag subclass used to hold a set of managed elements. - - Juergen Hoeller - Rick Evans (.NET) - - - - Resolves this managed collection at runtime. - - - The name of the top level object that is having the value of one of it's - collection properties resolved. - - - The definition of the named top level object. - - - The name of the property the value of which is being resolved. - - - The callback that will actually do the donkey work of resolving - this managed collection. - - A fully resolved collection. - - - - Gets or sets the unresolved name for the - of the elements of this managed set. - - The unresolved name for the type of the elements of this managed set. - - - - An - implementation that supports method injection. - - -

- Classes that want to take advantage of method injection must meet some - stringent criteria. Every method that is to be method injected - must be defined as either or - . An - will be thrown if these criteria are not met. -

-
- Rick Evans -
- - - Simple object instantiation strategy for use in - implementations. - - -

- Does not support method injection, although it provides hooks for subclasses - to override to add method injection support, for example by overriding methods. -

-
- Rod Johnson - Rick Evans (.NET) - -
- - - The shared instance for this class (and derived classes). - - - - - Instantiate an instance of the object described by the supplied - from the supplied . - - - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be the null - or zero length string if we're autowiring an object that doesn't belong - to the supplied . - - - The owning - - - An instance of the object described by the supplied - from the supplied . - - - - - Gets the zero arg ConstructorInfo object, if the type offers such functionality. - - The type. - Zero argument ConstructorInfo - - If the type does not have a zero-arg constructor. - - - - - Instantiate an instance of the object described by the supplied - from the supplied . - - - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be the null - or zero length string if we're autowiring an object that doesn't belong - to the supplied . - - - The owning - - - The to be used to instantiate - the object. - - - Any arguments to the supplied . May be null. - - - An instance of the object described by the supplied - from the supplied . - - - - - Instantiate an instance of the object described by the supplied - from the supplied . - - - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be the null - or zero length string if we're autowiring an object that doesn't belong - to the supplied . - - - The owning - - - The to be used to get the object. - - - Any arguments to the supplied . May be null. - - - An instance of the object described by the supplied - from the supplied . - - - - - Instantiate an instance of the object described by the supplied - from the supplied , - injecting methods as appropriate. - - -

- The default implementation of this method is to throw a - . -

-

- Derived classes can override this method if they can instantiate an object - with the Method Injection specified in the supplied - . Instantiation should use a no-arg constructor. -

-
- - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be a - or zero length string if we're autowiring an object that - doesn't belong to the supplied . - - - The owning - - - An instance of the object described by the supplied - from the supplied . - -
- - - Instantiate an instance of the object described by the supplied - from the supplied , - injecting methods as appropriate. - - -

- The default implementation of this method is to throw a - . -

-

- Derived classes can override this method if they can instantiate an object - with the Method Injection specified in the supplied - . Instantiation should use the supplied - and attendant . -

-
- - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be the null - or zero length string if we're autowiring an object that doesn't belong - to the supplied . - - - The owning - - - The to be used to instantiate - the object. - - - Any arguments to the supplied . May be null. - - - An instance of the object described by the supplied - from the supplied . - -
- - - The name of the dynamic assembly that holds dynamically created code - - - - - A cache of generated instances, keyed on - the object name for which the was generated. - - - - - Instantiate an instance of the object described by the supplied - from the supplied , - injecting methods as appropriate. - - - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be the - or zero length string if we're autowiring an - object that doesn't belong to the supplied - . - - - The owning - - - An instance of the object described by the supplied - from the supplied . - - - - - - Instantiate an instance of the object described by the supplied - from the supplied , - injecting methods as appropriate. - - - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be the - or zero length string if we're autowiring an - object that doesn't belong to the supplied - . - - - The owning - - - The to be used to instantiate - the object. - - - Any arguments to the supplied . May be null. - - - An instance of the object described by the supplied - from the supplied . - - - - - - Instantiate an instance of the object described by the supplied - from the supplied , - injecting methods as appropriate. - - -

- This method dynamically generates a subclass that supports method - injection for the supplied . It then - instantiates an new instance of said type using the constructor - identified by the supplied , - passing the supplied to said - constructor. It then manually injects (generic) method replacement - and method lookup instances (of - ) into - the new instance: those methods that are 'method-injected' will - then delegate to the approriate - - instance to effect the actual method injection. -

-
- - The definition of the object that is to be instantiated. - - - The name associated with the object definition. The name can be the - or zero length string if we're autowiring an - object that doesn't belong to the supplied - . - - - The owning - - - The parameter s to use to find the - appropriate constructor to invoke. - - - The aguments that are to be passed to the appropriate constructor - when the object is being instantiated. - - - A new instance of the defined by the - supplied . - -
- - - A factory that generates subclasses of those - classes that have been configured for the Method-Injection form of - Dependency Injection. - - -

- This class is designed as for one-shot usage; i.e. it must - be used to generate exactly one method injected subclass and - then discarded (it maintains state in instance fields). -

-
-
- - - The name of the generated - property (for method replacement). - - -

- Exists so that clients of this class can use this name to set properties reflectively - on the dynamically generated subclass. -

-
-
- - - The name of the generated - property (for method lookup). - - -

- Exists so that clients of this class can use this name to set properties reflectively - on the dynamically generated subclass. -

-
-
- - - Creates a new instance of the - class. - - - The in which - the generated is to be defined. - - - The object definition that is the target of the method injection. - - - If either of the supplied arguments is . - - - - - Builds a suitable for Method-Injection. - - - A suitable for Method-Injection. - - - - - Defines overrides for those methods that are configured with an appropriate - . - - - The overarching that is defining - the generated . - - - - - Override the supplied with the logic - encapsulated by the - - defined by the supplied . - - - The builder for the subclass that is being generated. - - - The method on the superclass that is to be overridden. - - - The field defining the - - that the overridden method will delegate to to do the 'actual' - method injection logic. - - - - - Defines the parameters to the method that is being overridden. - - -

- Since we are simply overridding a method (in this method - injection context), all we do here is simply copy the - parameters (since we want a method with the exact same parameters). -

-
- - The parameters to the original method that is being overridden. - - - The builder we are using to define the new overridden method. - -
- - - Generates the MSIL for actually returning a return value if the - supplied is not - . - - - The definition of the return value; if , it - means that no return value is to required (a void - return type). - - - The to emit - the MSIL to. - - - - - Generates the MSIL for a return value if the supplied - returns a value. - - - The method to be checked. - - - The to emit - the MSIL to. - - - The return value, or if the method does not - return a value (has a void return type). - - - - - Pushes (sets up) the arguments for a call to the - - method of an appropriate - . - - - The parameters to the original method (will be bundled - up into a generic object[] and passed as the third - argument to the - - invocation. - - - The to emit - the MSIL to. - - - - - Simply generates the IL for a write only property for the - . - - - The in which the property is defined. - - - The name of the (to be) generated property. - - - The (instance) field that the property is to 'set'. - - - - - A collection (with set semantics) of method overrides, determining which, if any, - methods on a managed object the Spring.NET IoC container will override at runtime. - - Rod Johnson - Rick Evans - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - -

- Deep copy constructoe. -

-
- - The instance supplying initial overrides for this new instance. - -
- - - Copy all given method overrides into this object. - - - The overrides to be copied into this object. - - - - - Adds the supplied to the overrides contained - within this instance. - - - The to be - added. - - - - - Adds the supplied to the overloaded method names - contained within this instance. - - - The overloaded method name to be added. - - - - - Returns true if the supplied is present within - the overloaded method names contained within this instance. - - - The overloaded method name to be checked. - - - True if the supplied is present within - the overloaded method names contained within this instance. - - - - - Return the override for the given method, if any. - - - The method to check for overrides for. - - - the override for the given method, if any. - - - - - Returns an that can iterate - through a collection. - - -

- The returned is the - exposed by the - - property. -

-
- - An that can iterate through a - collection. - -
- - - The collection of method overrides. - - - - - Returns true if this instance contains no overrides. - - - - - Programmatic means of constructing a using the builder pattern. Intended primarily - for use when implementing custom namespace parsers. - - Set methods are used instead of properties, so that chaining of methods can be used to create - 'one-liner'definitions that set multiple properties at one. - Rod Johnson - Rob Harrop - Juergen Hoeller - Mark Pollack (.NET) - - - - Initializes a new instance of the class, private - to force use of factory methods. - - - - - Create a new ObjectDefinitionBuilder used to construct a root object definition. - - The object definition factory. - The type name of the object. - A new ObjectDefinitionBuilder instance. - - - - Create a new ObjectDefinitionBuilder used to construct a root object definition. - - The object definition factory. - Name of the object type. - Name of the factory method. - A new ObjectDefinitionBuilder instance. - - - - Create a new ObjectDefinitionBuilder used to construct a root object definition. - - The object definition factory. - Type of the object. - A new ObjectDefinitionBuilder instance. - - - - Create a new ObjectDefinitionBuilder used to construct a root object definition. - - The object definition factory. - Type of the object. - Name of the factory method. - A new ObjectDefinitionBuilder instance. - - - - Create a new ObjectDefinitionBuilder used to construct a child object definition.. - - The object definition factory. - Name of the parent object. - - - - - Adds the property value under the given name. - - The name. - The value. - The current ObjectDefinitionBuilder. - - - - Adds a reference to the specified object name under the property specified. - - The name. - Name of the object. - The current ObjectDefinitionBuilder. - - - - Adds an index constructor arg value. The current index is tracked internally and all addtions are - at the present point - - The constructor arg value. - The current ObjectDefinitionBuilder. - - - - Adds a reference to the named object as a constructor argument. - - Name of the object. - - - - - Sets the name of the factory method to use for this definition. - - The factory method. - The current ObjectDefinitionBuilder. - - - - Sets the name of the factory object to use for this definition. - - The factory object. - The factory method. - The current ObjectDefinitionBuilder. - - - - Sets whether or not this definition describes a singleton object. - - if set to true [singleton]. - The current ObjectDefinitionBuilder. - - - - Sets whether objects or not this definition is abstract. - - if set to true [flag]. - The current ObjectDefinitionBuilder. - - - - Sets whether objects for this definition should be lazily initialized or not. - - if set to true [lazy]. - The current ObjectDefinitionBuilder. - - - - Sets the autowire mode for this definition. - - The autowire mode. - The current ObjectDefinitionBuilder. - - - - Sets the dependency check mode for this definition. - - The dependency check. - The current ObjectDefinitionBuilder. - - - - Sets the name of the destroy method for this definition. - - Name of the method. - The current ObjectDefinitionBuilder. - - - - Sets the name of the init method for this definition. - - Name of the method. - The current ObjectDefinitionBuilder. - - - - Sets the resource description for this definition. - - The resource description. - The current ObjectDefinitionBuilder. - - - - Adds the specified object name to the list of objects that this definition depends on. - - Name of the object. - The current ObjectDefinitionBuilder. - - - - Gets the current object definition in its raw (unvalidated) form. - - The raw object definition. - - - - Validate and gets the object definition. - - The object definition. - - - - Utility methods that are useful for - - implementations. - - Juergen Hoeller - Rick Evans (.NET) - - - - - The string used as a separator in the generation of synthetic id's - for those object definitions explicitly that aren't assigned one. - - -

- If a name or parent object definition - name is not unique, "#1", "#2" etc will be appended, until such - time that the name becomes unique. -

-
-
- - - Registers the supplied with the - supplied . - - -

- This is a convenience method that registers the - - of the supplied under the - - property value of said . If the - supplied has any - , - then those aliases will also be registered with the supplied - . -

-
- - The object definition holder containing the - that - is to be registered. - - - The registry that the supplied - is to be registered with. - - - If either of the supplied arguments is . - - - If the could not be registered - with the . - -
- - - Generates an object definition name for the supplied - that is guaranteed to be unique - within the scope of the supplied . - - The - that requires a generated name. - The - - that the supplied is to be - registered with (needed so that the uniqueness of any generated - name can be guaranteed). - if set to true if the given object - definition will be registed as an inner object or as a top level objener objects - verses top level objects. - - An object definition name for the supplied - that is guaranteed to be unique - within the scope of the supplied and - never . - - - If either of the or - arguments is . - - - If a unique name cannot be generated. - - - - - Generates the name of the object for a top-level object definition unique within the given object factory. - - The object definition to generate an object name for. - The registry to check for existing names. - The generated object name - if no unique name can be generated for the given - object definition - - - - Factory method for getting concrete - instances. - - - The name of the event handler method. This may be straight text, a regular - expression, , or empty. - - - The name of the event being wired. This too may be straight text, a regular - expression, , or empty. - - - A concrete - instance. - - - - - Creates a new instance of the - class. - - -

- This is a utility class, and as such exposes no public constructors. -

-
-
- - - Thrown when the validation of an object definition failed. - - Juergen Hoeller - Rick Evans (.NET) - - - - Creates a new instance of the - - class. - - - - - Creates a new instance of the - - class. - - The detail message. - - - - Creates a new instance of the - - class. - - - The detail message. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ObjectDefinitionValidationException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Helper class for use in object factory implementations, - resolving values contained in object definition objects - into the actual values applied to the target object instance. - - - Used by . - - Juergen Hoeller - Mark Pollack (.NET) - - - - Initializes a new instance of the class. - - The object factory. - Name of the object. - The object definition. - - - - Given a property value, return a value, resolving any references to other - objects in the factory if necessary. - - -

- The value could be : - - -

- An , - which leads to the creation of a corresponding new object instance. - Singleton flags and names of such "inner objects" are always ignored: inner objects - are anonymous prototypes. -

- - -

- A , which must - be resolved. -

-
- -

- An . This is a - special placeholder collection that may contain - s or - collections that will need to be resolved. -

-
- -

- An ordinary object or , in which case it's left alone. -

-
- -

-
- - The name of the object that is having the value of one of its properties resolved. - - - The definition of the named object. - - - The name of the property the value of which is being resolved. - - - The value of the property that is being resolved. - -
- - - Resolve the target type of the passed . - - The who's target type is to be resolved - The resolved target type, if any. otherwise. - - - - Resolves an inner object definition. - - - The name of the object that surrounds this inner object definition. - - - The name of the inner object definition... note: this is a synthetic - name assigned by the factory (since it makes no sense for inner object - definitions to have names). - - - The name of the property the value of which is being resolved. - - - The definition of the inner object that is to be resolved. - - - if the owner of the property is a singleton. - - - The resolved object as defined by the inner object definition. - - - - - Checks the given bean name whether it is unique. If not already unique, - a counter is added, increasing the counter until the name is unique. - - Original Name of the inner object. - The Adapted name for the inner object - - - - Resolve a reference to another object in the factory. - - - The name of the object that is having the value of one of its properties resolved. - - - The definition of the named object. - - - The name of the property the value of which is being resolved. - - - The runtime reference containing the value of the property. - - A reference to another object in the factory. - - - - Object definition reader for a simple properties format. - - - Provides object definition registration methods for - and - instances. Typically applied to a - . - - Rod Johnson - Juergen Hoeller - Simon White (.NET) - - - - Value of a T/F attribute that represents true. - Anything else represents false. Case seNsItive. - - - - - Separator between object name and property name. - - - - - Prefix for the class property of a root object definition. - - - - - Special string added to distinguish if the object will be - a singleton. - - -

- Default is true. -

-
- -

- owner.(singleton)=true -

-
-
- - - Special string added to distinguish if the object will be - lazily initialised. - - -

- Default is false. -

-
- -

- owner.(lazy-init)=true -

-
-
- - - Reserved "property" to indicate the parent of a child object definition. - - - - - Property suffix for references to other objects in the current - : e.g. - owner.dog(ref)=fido. - - -

- Whether this is a reference to a singleton or a prototype - will depend on the definition of the target object. -

-
-
- - - Prefix before values referencing other objects. - - - - - Creates a new instance of the - - class. - - - The - instance that this reader works on. - - - - - Load object definitions from the supplied . - - - The resource for the object definitions that are to be loaded. - - - The number of object definitions that were loaded. - - - In the case of loading or parsing errors. - - - - - Load object definitions from the specified properties file. - - - The resource descriptor for the properties file. - - - The match or filter for object definition names, e.g. 'objects.' - - in case of loading or parsing errors - the number of object definitions found - - - - Register object definitions contained in a - , using all property keys (i.e. - not filtering by prefix). - - - The containing object definitions. - - - In case of loading or parsing errors. - - The number of object definitions registered. - - - - Register object definitions contained in a - . - - -

- Similar syntax as for an . - This method is useful to enable standard .NET internationalization support. -

-
- - The containing object definitions. - - - The match or filter for object definition names, e.g. 'objects.' - - - In case of loading or parsing errors. - - The number of object definitions registered. -
- - - Register object definitions contained in an - , using all property keys - (i.e. not filtering by prefix). - - - The containing object definitions. - - - In case of loading or parsing errors. - - The number of object definitions registered. - - - - Registers object definitions contained in an - using all property keys ( i.e. not filtering by prefix ) - - The containing - object definitions. - - - In case of loading or parsing errors. - - The number of object definitions registered. - - - - Register object definitions contained in a - . - - -

- Ignores ineligible properties. -

-
- IDictionary name -> property (String or Object). Property values - will be strings if coming from a Properties file etc. Property names - (keys) must be strings. Type keys must be strings. - - - The match or filter within the keys in the map: e.g. 'objects.' - - - In case of loading or parsing errors. - - The number of object definitions found. -
- - - Register object definitions contained in a - . - - -

- Ignores ineligible properties. -

-
- IDictionary name -> property (String or Object). Property values - will be strings if coming from a Properties file etc. Property names - (keys) must be strings. Type keys must be strings. - - - The match or filter within the keys in the map: e.g. 'objects.' - - - The description of the resource that the - came from (for logging purposes). - - - In case of loading or parsing errors. - - The number of object definitions found. -
- - - Get all property values, given a prefix (which will be stripped) - and add the object they define to the factory with the given name - - The name of the object to define. - - The containing string pairs. - - The prefix of each entry, which will be stripped. - - The description of the resource that the - came from (for logging purposes). - - - In case of loading or parsing errors. - - - - - Name of default parent object - - - - - Gets or sets object definition factory to use. - - - - - Represents the replacement of a method on a managed object by the IoC - container. - - -

- Note that this mechanism is not intended as a generic means of - inserting crosscutting code: use AOP for that. -

-
- Rod Johnson - Rick Evans (.NET) -
- - - Creates a new instance of the - class. - - - The name of the method that is to be overridden. - - - The object name of the - instance in the surrounding IoC container. - - - If either of the supplied arguments is or - contains only whitespace character(s). - - - - - Add a fragment of a instance's - such as 'Exception or System.Excep to identify an argument - for a dependency injected method. - - - A (sub) string of a instance's . - - - If the supplied is or - contains only whitespace character(s). - - - - - - Does this - match the supplied ? - - The method to be checked. - - if this override matches the supplied . - - - If the supplied is . - - - - - A that represents the current - . - - - A that represents the current - . - - - - - The object name of the - instance in the surrounding IoC container. - - - - - A plain-vanilla object definition. - - -

- This is the most common type of object definition; - instances - do not derive from a parent - , and usually - (but not always - see below) have an - - and (optionally) some - and - . -

-

- Note that - instances do not have to specify an - : - This can be useful for deriving - instances - from such definitions, each with it's own - , - inheriting common property values and other settings from the parent. -

-
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) - -
- - - Creates a new instance of the - class. - - - - - Creates a new instance of the - - class. - - - The of the object to instantiate. - - - - - Creates a new instance of the - - class. - - - The of the object to instantiate. - - - if this object definition defines a singleton object. - - - - - Creates a new instance of the - class - for a singleton, providing property values and constructor arguments. - - - The of the object to instantiate. - - - The - to be applied to a new instance of the object. - - - The to be applied to - a new instance of the object. - - - - - Creates a new instance of the - class - for a singleton using the supplied - . - - - The of the object to instantiate. - - - The autowiring mode. - - - - - Creates a new instance of the - class - for a singleton using the supplied - . - - - The of the object to instantiate. - - - The autowiring mode. - - - Whether to perform a dependency check for objects (not - applicable to autowiring a constructor, thus ignored there) - - - - - Creates a new instance of the - class - with the given singleton status, providing property values. - - - The of the object to instantiate. - - - The to be applied to - a new instance of the object. - - - - - Creates a new instance of the - class - with the given singleton status, providing property values. - - - The of the object to instantiate. - - - The to be applied to - a new instance of the object. - - - if this object definition defines a singleton object. - - - - - Creates a new instance of the - class - for a singleton, providing property values and constructor arguments. - - -

- Takes an object class name to avoid eager loading of the object class. -

-
- - The assembly qualified of the object to instantiate. - - - The to be applied to - a new instance of the object. - - - The - to be applied to a new instance of the object. - -
- - - Creates a new instance of the - class. - - -

- Deep copy constructor. -

-
- - The definition that is to be copied. - -
- - - Validate this object definition. - - - In the case of a validation failure. - - - - - A that represents the current - . - - - A that represents the current - . - - - - - A implementation to use that checks - the object definitions only (no attributes) - - Mark Fisher - Mark Pollack (.NET) - - - - Determines whether the given object definition qualifies as an - autowire candidate for the given dependency. - - The object definition including object name and aliases. - The descriptor for the target method parameter or field. - - true if the object definition qualifies as autowire candidate; otherwise, false. - - - - - Static factory that permits the registration of existing singleton instances. - - -

- Does not have support for prototype objects, aliases, and post startup object - configuration. -

-

- Serves as a simple example implementation of the - interface, that manages existing object instances as opposed to creating new ones - based on object definitions. -

-

- The - method is not supported by this class; this class deals exclusively with - existing singleton instances, thus the methods mentioned previously make little sense in this context. -

-
- Rod Johnson - Juergen Hoeller - Simon White (.NET) -
- - - Map from object name to object instance. - - - - - This method is not supported by . - - - - - - Return an instance of the given object name. - - The name of the object to return. - The instance of the object. - - is not currently supported. - - - - - - Return an instance (possibly shared or independent) of the given object name. - - -

- This method allows an object factory to be used as a replacement for the - Singleton or Prototype design pattern. -

-

- Note that callers should retain references to returned objects. There is no - guarantee that this method will be implemented to be efficient. For example, - it may be synchronized, or may need to run an RDBMS query. -

-

- Will ask the parent factory if the object cannot be found in this factory - instance. -

-
- The name of the object to return. - - The arguments to use if creating a prototype using explicit arguments to - a static factory method. If there is no factory method and the - arguments are not null, then match the argument values by type and - call the object's constructor. - - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the supplied is . - -
- - - Return an instance (possibly shared or independent) of the given object name. - - The name of the object to return. - - The the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - - The arguments to use if creating a prototype using explicit arguments to - a factory method. If there is no factory method and the - supplied array is not , then - match the argument values by type and call the object's constructor. - - The instance of the object. - - If there's no such object definition. - - - If the object could not be created. - - - If the object is not of the required type. - - - If the supplied is . - - - - - - Return an instance of the given object name. - - The name of the object to return. - - the object may match. Can be an interface or - superclass of the actual class. For example, if the value is the - class, this method will succeed whatever the - class of the returned instance. - - The instance of the object. - - - - - Does this object factory contain an object with the given name? - - The name of the object to query. - True if an object with the given name is defined. - - - - Is this object a singleton? - - -

- That is, will - or - always return the same object? -

-
- The name of the object to query. - True if the named object is a singleton. - - If there's no such object definition. - -
- - - Determines whether the specified object name is prototype. That is, will GetObject - always return independent instances? - - This method returning false does not clearly indicate a singleton object. - It indicated non-independent instances, which may correspond to a scoped object as - well. use the IsSingleton property to explicitly check for a shared - singleton instance. - Translates aliases back to the corresponding canonical object name. Will ask the - parent factory if the object can not be found in this factory instance. - - - - The name of the object to query - - true if the specified object name will always deliver independent instances; otherwise, false. - - if there is no object with the given name. - - - - Determine the type of the object with the given name. - - -

- More specifically, checks the type of object that - would return. - For an , returns the type - of object that the creates. -

-
- The name of the object to query. - - The of the object or if - not determinable. - -
- - - Determines whether the object with the given name matches the specified type. - - The name of the object to query. - Type of the target to match against. - - true if the object type matches; otherwise, false - if it doesn't match or cannot be determined yet. - - Ff there is no object with the given name - - - - - Return the aliases for the given object name, if defined. - - The object name to check for aliases. - The aliases, or an empty array if none. - - If there's no such object definition. - - - - - Not supported. - - The name of the object. - - The registered - . - - - Always, as object definitions are not supported by this - implementation. - - - - - Return the registered - for the - given object, allowing access to its property values and constructor - argument values. - - The name of the object. - Whether to search parent object factories. - - The registered - . - - - If there is no object with the given name. - - - In the case of errors. - - - - - Return the names of all objects defined in this factory. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - - - - - Return the names of objects matching the given - (including subclasses), judging from the object definitions. - - - The (class or interface) to match, or - for all object names. - - -

- Will not consider s, - as the type of their created objects is not known before instantiation. -

-
- - The names of all objects defined in this factory, or an empty array if none - are defined. - -
- - - Return the names of objects matching the given - (including subclasses), judging from the object definitions. - - - The (class or interface) to match, or - for all object names. - - -

- Does consider objects created by s, - or rather it considers the type of objects created by - (which means that - s will be instantiated). -

-

- Does not consider any hierarchy this factory may participate in. -

-
- - The names of all objects defined in this factory, or an empty array if none - are defined. - -
- - - Return the names of objects matching the given - (including subclasses), judging from the object definitions. - - -

- Since this implementation of the - - interface does not support the notion of ptototype objects, the - parameter is ignored. -

-
- - The (class or interface) to match, or - for all object names. - - - Whether to include prototype objects too or just singletons (also applies to - s). Ignored. - - - Whether to include s too - or just normal objects. - - - The names of all objects defined in this factory, or an empty array if none - are defined. - - -
- - - Tests whether this object factory contains an object definition for the - specified object name. - - The object name to query. - - True if an object defintion is contained within this object factory. - - - - - Return the object instances that match the given object - (including subclasses), judging from either object - definitions or the value of - in the case of - s. - - -

- This version of the - method matches all kinds of object definitions, be they singletons, prototypes, or - s. Typically, the results - of this method call will be the same as a call to - IListableObjectFactory.GetObjectsOfType(type,true,true) . -

-
- - The (class or interface) to match. - - - A of the matching objects, - containing the object names as keys and the corresponding object instances - as values. - - - If the objects could not be created. - -
- - - Return the object instances that match the given object - (including subclasses), judging from either object - definitions or the value of - in the case of - s. - - - The (class or interface) to match. - - - Whether to include prototype objects too or just singletons (also applies to - s). - - - Whether to include s too - or just normal objects. - - - A of the matching objects, - containing the object names as keys and the corresponding object instances - as values. - - - If the objects could not be created. - - - - - Add a new singleton object. - - - The name to be associated with the object name. - - The singleton object. - - - - Injects dependencies into the supplied instance - using the named object definition. - - - The object instance that is to be so configured. - - - The name of the object definition expressing the dependencies that are to - be injected into the supplied instance. - - - This feature is not currently supported. - - - - - - Injects dependencies into the supplied instance - using the supplied . - - - The object instance that is to be so configured. - - - The name of the object definition expressing the dependencies that are to - be injected into the supplied instance. - - - An object definition that should be used to configure object. - - - - - - Defines a method to release allocated unmanaged resources. - - - - - Return the number of objects defined in the factory. - - - The number of objects defined in the factory. - - - - - Return an instance of the given object name. - - The name of the object to return. - The instance of the object. - - - - - Abstract implementation providing - a number of convenience methods and a - template method - that subclasses must override to provide the actual parsing logic. - - - Use this implementation when you want - to parse some arbitrarily complex XML into one or more - ObjectDefinitions. If you just want to parse some - XML into a single IObjectDefinition, you may wish to consider - the simpler convenience extensions of this class, namely - and - - - Rob Harrop - Juergen Hoeller - Rick Evans - Mark Pollack (.NET) - - - - Interface used to handle custom, top-level tags. - - Implementations are free to turn the metadata in the custom tag into as - many as required. - - Rob Harrop - Mark Pollack (.NET) - - - - Parse the specified XmlElement and register the resulting - ObjectDefinitions with the IObjectDefinitionRegistry - embedded in the supplied - - -

- This method is never invoked if the parser is namespace aware - and was called to process the root node. -

-
- - The element to be parsed. - - - TThe object encapsulating the current state of the parsing process. - Provides access to a IObjectDefinitionRegistry - - - The primary object definition. - -
- - - Constant for the ID attribute - - - - - Parse the specified XmlElement and register the resulting - ObjectDefinitions with the IObjectDefinitionRegistry - embedded in the supplied - - The element to be parsed. - TThe object encapsulating the current state of the parsing process. - Provides access to a IObjectDefinitionRegistry - The primary object definition. - -

- This method is never invoked if the parser is namespace aware - and was called to process the root node. -

-
-
- - - Resolves the ID for the supplied . - - - When using generation, a name is generated automatically. - Otherwise, the ID is extracted from the "id" attribute, potentially with a - fallback to a generated id. - - The element that the object definition has been built from. - The object definition to be registered. - The the object encapsulating the current state of the parsing process; - provides access to a - the resolved id - - if no unique name could be generated for the given object definition - - - - - Registers the supplied with the supplied - . - - Subclasses can override this method to control whether or not the supplied - is actually even registered, or to - register even more objects. - - The default implementation registers the supplied - with the supplied only if the IsNested - parameter is false, because one typically does not want inner objects - to be registered as top level objects. - - - - The object definition to be registered. - The registry that the bean is to be registered with. - - - - Central template method to actually parse the supplied XmlElement - into one or more IObjectDefinitions. - - The element that is to be parsed into one or more s - The the object encapsulating the current state of the parsing process; - provides access to a - The primary IObjectDefinition resulting from the parsing of the supplied XmlElement - - - - Gets a value indicating whether an ID should be generated instead of read - from the passed in XmlElement. - - Note that this flag is about always generating an ID; the parser - won't even check for an "id" attribute in this case. - - true if should generate id; otherwise, false. - - - - Gets a value indicating whether an ID should be generated instead if the - passed in XmlElement does not specify an "id" attribute explicitly. - - Disabled by default; subclasses can override this to enable ID generation - as fallback: The parser will first check for an "id" attribute in this case, - only falling back to a generated ID if no value was specified. - - true if should generate id if no value was specified; otherwise, false. - - - - - Convenient base class for when there exists a one-to-one mapping - between attribute names on the element that is to be parsed and - the property names on the Type being configured. - - - - - Mark Pollack - - - - Base Type for those implementations that - need to parse and define just a single IObjectDefinition. - - - Extend this parser Type when you want to create a single object definition - from an arbitrarily complex XML element. You may wish to consider extending - the when you want to create a - single Object definition from a relatively simple custom XML element. - The resulting ObjectDefinition will be automatically registered - with the ObjectDefinitionRegistry. Your job simply is to parse the - custom XML element into a single ObjectDefinition - - Rob Harrop - Juergen Hoeller - Rick Evans - Mark Pollack (.NET) - - - - Central template method to actually parse the supplied XmlElement - into one or more IObjectDefinitions. - - The element that is to be parsed into one or more s - The the object encapsulating the current state of the parsing process; - provides access to a - - The primary IObjectDefinition resulting from the parsing of the supplied XmlElement - - - - - Gets the type of the object corresponding to the supplied XmlElement. - - Note that, for application classes, it is generally preferable to override - GetObjectTypeName instad, in order to avoid a direct - dependence on the object implementation class. The ObjectDefinitionParser - and its IXmlObjectDefinitionParser (namespace parser) can be used within an - IDE add-in then, even if the application classses are not available in the add-ins - AppDomain. - - The element. - The Type of the class that is being defined via parsing the supplied - Element. - - - - Gets the name of the object type name (FullName) corresponding to the supplied XmlElement. - - The element. - The type name of the object that is being defined via parsing the supplied - XmlElement. - - - - Parse the supplied XmlElement and populate the supplied ObjectDefinitionBuilder as required. - - The default implementation delegates to the DoParse version without - ParameterContext argument. - The element. - The parser context. - The builder used to define the IObjectDefinition. - - - - Parse the supplied XmlElement and populate the supplied ObjectDefinitionBuilder as required. - - The default implementation does nothing. - The element. - The builder used to define the IObjectDefinition. - - - - XML resource reader. - - -

- Navigates through an XML resource and invokes parsers registered - with the . -

-
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) -
- - - SPI for parsing an XML document that contains Spring object definitions. - Used by for actually parsing a DOM - document. - - Instantiated per document to parse: Implementations can hold state in - instance variables during the execution of the RegisterObjectDefinitions - method, for example global settings that are defined for all object definitions - in the document. - - Juergen Hoeller - Rob Harrop - Mark Pollack (.NET) - - - - - Read object definitions from the given DOM element, and register - them with the given object registry. - - The DOM element containing object definitions, usually the - root (document) element. - The current context of the reader. Includes - the resource being parsed - - The number of object definitions that were loaded. - - - In case of parsing errors. - - - - - The shared instance for this class (and derived classes). - - - - - Creates a new instance of the DefaultObjectDefinitionDocumentReader class. - - - - - Read object definitions from the given DOM element, and register - them with the given object registry. - - The DOM element containing object definitions, usually the - root (document) element. - The current context of the reader. Includes - the resource being parsed - - The number of object definitions that were loaded. - - - In case of parsing errors. - - - - - Parses object definitions starting at the given - using the passed . - - The root element to start parsing from. - The instance to use. - - in case an error happens during parsing and registering object definitions - - - - - Loads external XML object definitions from the resource described by the supplied - . - - The XML element describing the resource. - - If the resource could not be imported. - - - - - Parses the given alias element, registering the alias with the registry. - - The alias element. - The registry. - - - - Parse an object definition and register it with the object factory.. - - The element containing the object definition. - The helper. - - - - - - Allow the XML to be extensible by processing any custom element types last, - after we finished processing the objct definitions. This method is a natural - extension point for any other custom post-processing of the XML. - - The default implementation is empty. Subclasses can override this method to - convert custom elements into standard Spring object definitions, for example. - Implementors have access to the parser's object definition reader and the - underlying XML resource, through the corresponding properties. - - - The root. - - - - Allow the XML to be extensible by processing any custom element types first, - before we start to process the object definitions. - - This method is a natural - extension point for any other custom pre-processing of the XML. -

The default implementation is empty. Subclasses can override this method to - convert custom elements into standard Spring object definitions, for example. - Implementors have access to the parser's object definition reader and the - underlying XML resource, through the corresponding properties. -

-
- The root element of the XML document. -
- - - Creates an instance for the given and element. - - the to create the - the root to start reading from - a new instance - - - - Gets the reader context. - - The reader context. - - - - Simple class that holds the defaults specified at the <objects> - level in a standard Spring XML object definition document: - default-lazy-init, default-autowire, etc. - - Juergen Hoeller - Mark Pollack (.NET) - - - - Gets or sets the autowire setting for the document that's currently parsed. - - The autowire. - - - - Gets or sets the dependency-check setting for the document that's currently parsed - - The dependency check. - - - - Gets or sets the lazy-init flag for the document that's currently parsed. - - The lazy init. - - - - Strategy interface for parsing XML object definitions. - - -

- Used by - for actually parsing a DOM document or - fragment. -

-
- Juergen Hoeller - Rick Evans (.NET) - Sandu Turcan (.NET) -
- - - Invoked by after construction but before any - elements have been parsed. - - - - - Parse the specified element and register any resulting - IObjectDefinitions with the IObjectDefinitionRegistry that is - embedded in the supplied ParserContext. - - - Implementations should return the primary IObjectDefinition - that results from the parse phase if they wish to used nested - inside (for example) a <property> tag. - Implementations may return null if they will not - be used in a nested scenario. - - - The element to be parsed into one or more IObjectDefinitions - The object encapsulating the current state of the parsing - process. - - The primary IObjectDefinition (can be null as explained above) - - - - - Parse the specified XmlNode and decorate the supplied ObjectDefinitionHolder, - returning the decorated definition. - - The XmlNode may either be an XmlAttribute or an XmlElement, depending on - whether a custom attribute or element is being parsed. - Implementations may choose to return a completely new definition, - which will replace the original definition in the resulting IApplicationContext/IObjectFactory. - - The supplied ParserContext can be used to register any additional objects needed to support - the main definition. - - The source element or attribute that is to be parsed. - The current object definition. - The object encapsulating the current state of the parsing - process. - The decorated definition (to be registered in the IApplicationContext/IObjectFactory), - or simply the original object definition if no decoration is required. A null value is strickly - speaking invalid, but will leniently treated like the case where the original object definition - gets returned. - - - - Attribute that should be used to specify the default namespace - and schema location for a custom namespace parser. - - Aleksandar Seovic - - - - Creates a new instance of . - - - - - Gets or sets the default namespace for the configuration parser. - - - The default namespace for the configuration parser. - - - - - Gets or sets the default schema location for the configuration parser. - - - The default schema location for the configuration parser. - - - If the property is set, the will always resolve to an assembly-resource - and the set will be interpreted relative to this assembly. - - - - - Gets or sets a type from the assembly containing the schema - - - If this property is set, the will always resolve to an assembly-resource - and the will be interpreted relative to this assembly. - - - - - Provides a resolution mechanism for configuration parsers. - - -

- The uses this registry - class to find the parser handling a specific namespace. -

-
- Aleksandar Seovic -
- - - Name of the .Net config section that contains definitions - for custom config parsers. - - - - - Creates a new instance of the NamespaceParserRegistry class. - - - - - Reset the list of registered parsers to "factory"-setting - - use for unit tests only - - - - Registers the type for wellknown namespaces - - true if the parser could be registered, false otherwise - - - - Constructs a "assembly://..." qualified schemaLocation url using the given type - to obtain the assembly name. - - - - - Returns a parser for the given namespace. - - - The namespace for which to lookup the parser implementation. - - - A parser for a given , or - if no parser was found. - - - - - Returns a schema collection containing validation schemas for all registered parsers. - - - A schema collection containing validation schemas for all registered parsers. - - - - - Pegisters parser, using default namespace and schema location - as defined by the . - - - The of the parser that will be activated - when an element in its default namespace is encountered. - - - If is . - - - - - Associates a parser with a namespace. - - - - Parsers registered with the same as that - of a parser that has previously been registered will overwrite the existing - parser. - - - - The of the parser that will be activated - when the attendant is - encountered. - - - The namespace with which to associate instance of the parser. - - - The location of the XML schema that should be used for validation - of the XML elements that belong to the specified namespace - (can be any valid Spring.NET resource URI). - - - If the is not a - that implements the - interface. - - - If is . - - - - - Pegisters parser, using default namespace and schema location - as defined by the . - - - The parser instance. - - - If is . - - - - - Associates a parser with a namespace. - - - - Parsers registered with the same as that - of a parser that has previously been registered will overwrite the existing - parser. - - - - The namespace with which to associate instance of the parser. - - - The parser instance. - - - The location of the XML schema that should be used for validation - of the XML elements that belong to the specified namespace - (can be any valid Spring.NET resource URI). - - - If is , or if - is not specified and parser class - does not have default value defined using . - - - - - Register a schema as well-known - - - - - - - Returns default values for the parser namespace and schema location as - defined by the . - - - A parser instance. - - - A instance containing - default values for the parser namsepace and schema location - - - - - Resolves xml entities by using the infrastructure. - - - - - Support class for implementing custom namespace parsers. - - Parsing of individual elements is done via a ObjectDefintionParser. - Provides the RegisterObjectDefinitionParser for registering a ObjectDefintionParser - to handle a specific element. - Rob Harrop - Juergen Hoeller - Mark Pollack (.NET) - - - - Invoked by after construction but before any - elements have been parsed. - - - - - Parses an element under the root node, typically - an object definition or import statement. - - - The element to be parsed. - - - The parser context. - - - The number of object defintions created from this element. - - - - - Parse the specified XmlNode and decorate the supplied ObjectDefinitionHolder, - returning the decorated definition. - - The XmlNode may either be an XmlAttribute or an XmlElement, depending on - whether a custom attribute or element is being parsed. - Implementations may choose to return a completely new definition, - which will replace the original definition in the resulting IApplicationContext/IObjectFactory. - - The supplied ParserContext can be used to register any additional objects needed to support - the main definition. - - The source element or attribute that is to be parsed. - The current object definition. - The object encapsulating the current state of the parsing - process. - The decorated definition (to be registered in the IApplicationContext/IObjectFactory), - or simply the original object definition if no decoration is required. A null value is strickly - speaking invalid, but will leniently treated like the case where the original object definition - gets returned. - - - - Register the specified for the given - - - - - Constants defining the structure and values associated with the - Spring.NET XML object definition format. - - Rod Johnson - Juergen Hoeller - Rick Evans (.NET) - - - - Value of a boolean attribute that represents - . - - -

- Anything else represents . -

-
-
- - - Signifies that a default value is to be applied. - - - - - Defines an external XML object definition resource. - - - - - Specifies the relative path to an external XML object definition - resource. - - - - - Defines an alias for an object definition. - - - - - Specifies the alias of an object definition. - - - - - Specifies the default lazy initialization mode. - - - - - Specifies the default dependency checking mode. - - - - - Specifies the default autowire mode. - - - - - Defines a single named object. - - - - - Element containing informative text describing the purpose of the - enclosing element. - - -

- Always optional. -

-

- Used primarily for user documentation of XML object definition - documents. -

-
-
- - - Specifies a . - - -

- Does not have to be fully assembly qualified, but it is recommended - that the names of one's objects are - specified explicitly. -

-
-
- - - The name or alias of the parent object definition that a child - object definition inherits from. - - - - - Objects can be identified by an id, to enable reference checking. - - -

- There are constraints on a valid XML id: if you want to reference - your object in .NET code using a name that's illegal as an XML id, - use the optional "name" attribute - (). - If neither given, the objects name is - used as id. -

-
-
- - - Can be used to create one or more aliases illegal in an id. - - -

- Multiple aliases can be separated by any number of spaces, - semicolons, or commas - (). -

-

- Always optional. -

-
-
- - - Is this object a "singleton" (one shared instance, which will - be returned by all calls to - with the id), or a - "prototype" (independent instance resulting from each call to - ). - - -

- Singletons are most commonly used, and are ideal for multi-threaded - service objects. -

-
- -
- - - Controls object scope. Only applicable to ASP.NET web applications. - - -

- Scope can be defined as either application, session or request. It - defines when "singleton" instances are initialized, but has no - effect on prototype definitions. -

-
-
- - - The names of the objects that this object depends on being - initialized. - - -

- The object factory will guarantee that these objects - get initialized before this object definition. -

- - Dependencies are normally expressed through object properties or - constructor arguments. This property should just be necessary for - other kinds of dependencies such as statics (*ugh*) or database - preparation on startup. - -
-
- - - Optional attribute for the name of the custom initialization method - to invoke after setting object properties. - - -

- The method must have no arguments. -

-
-
- - - Optional attribute for the name of the custom destroy method to - invoke on object factory shutdown. - - -

- Valid destroy methods have either of the following signatures... - - void MethodName() - void MethodName(bool force) - -

- - Only invoked on singleton objects! - -
-
- - - A constructor argument : the constructor-arg tag can have an - optional type attribute, to specify the exact type of the - constructor argument - - -

- Only needed to avoid ambiguities, e.g. in case of 2 single - argument constructors that can both be converted from a - . -

-
-
- - - The constructor-arg tag can have an optional index attribute, - to specify the exact index in the constructor argument list. - - -

- Only needed to avoid ambiguities, e.g. in case of 2 arguments of - the same type. -

-
-
- - - The constructor-arg tag can have an optional named parameter - attribute, to specify a named parameter in the constructor - argument list. - - - - - Is this object "abstract", i.e. not meant to be instantiated itself - but rather just serving as parent for concrete child object - definitions? - - -

- Default is . Specify - to tell the object factory to not try to instantiate that - particular object in any case. -

-
-
- - - A property definition : object definitions can have zero or more - properties. - - -

- Spring.NET supports primitives, references to other objects in the - same or related factories, lists, dictionaries, and name value - collections. -

-
-
- - - A reference to another managed object or static - . - - - - - ID refs must specify a name of the target object. - - - - - A reference to the name of another managed object in the same - context. - - - - - A reference to the name of another managed object in the same - context. - - -

- Local references, using the "local" attribute, have to use object - ids; they can be checked by a parser, thus should be preferred for - references within the same object factory XML file. -

-
-
- - - Alternative to type attribute for factory-method usage. - - -

- If this is specified, no type attribute should be used. This should - be set to the name of an object in the current or ancestor - factories that contains the relevant factory method. This allows - the factory itself to be configured using Dependency Injection, and - an instance (rather than static) method to be used. -

-
-
- - - Optional attribute specifying the name of a factory method to use - to create this object. - - -

- Use constructor-arg elements to specify arguments to the factory - method, if it takes arguments. Autowiring does not apply to - factory methods. -

-

- If the "type" attribute is present, the factory method will be a - static method on the type specified by the "type" attribute on - this object definition. Often this will be the same type as that - of the constructed object - for example, when the factory method - is used as an alternative to a constructor. However, it may be on - a different type. In that case, the created object will *not* be - of the type specified in the "type" attribute. This is analogous - to behaviour. -

-

- If the "factory-object" attribute is present, the "type" attribute - is not used, and the factory method will be an instance method on - the object returned from a - - call with the specified object name. The factory object may be - defined as a singleton or a prototype. -

-

- The factory method can have any number of arguments. Use indexed - constructor-arg elements in conjunction with the factory-method - attribute. -

-

- Setter Injection can be used in conjunction with a factory method. - Method Injection cannot, as the factory method returns an instance, - which will be used when the container creates the object. -

-
-
- - - A list can contain multiple inner object, ref, collection, or - value elements. - - -

- Lists are untyped, pending generics support, although references - will be strongly typed. -

-

- A list can also map to an array type. The necessary conversion is - automatically performed by the - . -

-
-
- - - A set can contain multiple inner object, ref, collection, or value - elements. - - -

- Sets are untyped, pending generics support, although references - will be strongly typed. -

-
-
- - - A Spring.NET map is a mapping from a string key to object (a .NET - ). - - -

- Dictionaries may be empty. -

-
-
- - - A lookup key (for a dictionary or name / value collection). - - - - - A lookup key (for a dictionary or name / value collection). - - - - - Contains a string representation of a value. - - -

- This is used by name-value, ctor argument, and property elements. -

-
-
- - - Contains delimiters that should be used to split delimited string values. - - -

- This is used by name-value element. -

-
-
- - - A reference to another objects. - - -

- Used as a convenience shortcut on property and constructor-arg - elements to refer to other objects. -

-
-
- - - Contains a string representation of an expression. - - -

- This is used by ctor argument and property elements. -

-
-
- - - A map entry can be an inner object, ref, collection, or value. - - -

- The name of the property is given by the "key" attribute. -

-
-
- - - Contains a string representation of a property value. - - -

- The property may be a string, or may be converted to the - required using the - - machinery. This makes it possible for application developers to - write custom - implementations that can convert strings to objects. -

- - This is recommended for simple objects only. Configure more complex - objects by setting properties to references to other objects. - -
-
- - - Contains a string representation of an expression. - - - - - Denotes value. - - -

- Necessary because an empty "value" tag will resolve to an empty - , which will not be resolved to - value unless a special - does so. -

-
-
- - - 'name-values' elements differ from dictionary elements in that - values must be strings. - - -

- May be empty. -

-
-
- - - Element content is the string value of the property. - - -

- The "key" attribute is the name of the property. -

-
-
- - - The lazy initialization mode for an individual object definition. - - - - - The dependency checking mode for an individual object definition. - - - - - Defines a subscription to one or more events published by one or - more event sources. - - - - - The name of an event handling method. - - -

- Defaults to On${event}. - Note : this default will probably change before the first 1.0 - release. -

-
-
- - - The name of an event. - - - - - The autowiring mode for an individual object definition. - - - - - Shortcut alternative to specifying a key element in a - dictionary entry element with <ref object="..."/>. - - - - - Shortcut alternative to specifying a value element in a - dictionary entry element with <ref object="..."/>. - - - - - The string of characters that delimit object names. - - - - - A lookup method causes the IoC container to override a given method and return - the object with the name given in the attendant object attribute. - - -

- This is a form of Method Injection. -

-

- It's particularly useful as an alternative to implementing the - interface, - in order to be able to make - - calls for non-singleton instances at runtime. In this case, Method Injection - is a less invasive alternative. -

-
-
- - - The name of a lookup method. This method must take no arguments. - - - - - The name of the object in the IoC container that the lookup method - must resolve to. - - -

- Often this object will be a prototype, in which case the lookup method - will return a distinct instance on every invocation. This is useful - for single-threaded objects. -

-
-
- - - A replaced method causes the IoC container to override a given method - with an (arbitrary) implementation at runtime. - - -

- This (again) is a form of Method Injection. -

-
-
- - - Name of the method whose implementation should be replaced by the - IoC container. - - -

- If this method is not overloaded, there's no need to use arg-type - subelements. -

-

- If this method is overloaded, arg-type subelements must be - used for all override definitions for the method. -

-
-
- - - The object name of an implementation of the - interface. - - -

- This may be a singleton or prototype. If it's a prototype, a new - instance will be used for each method replacement. Singleton usage - is the norm. -

-
-
- - - Subelement of replaced-method identifying an argument for a - replaced method in the event of method overloading. - - - - - - Specification of the of an overloaded method - argument as a . - - -

- For convenience, this may be a substring of the FQN. E.g. all the following would match - : -

-

- - - System.String - - - string - - - str - - -

-
- -
- - - Check everything. - - - - - Just check primitive (string, int, etc) values. - - - - - Check object references. - - - - - Autowire by name. - - - - - Autowire by . - - - - - Autowiring by constructor. - - - - - The autowiring strategy is to be determined by introspection - of the object's . - - - - - Creates a new instance of the - - class. - - -

- This is a utility class, and as such has no publicly visible - constructors. -

-
-
- - - Stateful class used to parse XML object definitions. - - Not all parsing code has been refactored into this class. See - BeanDefinitionParserDelegate in Java for how this class should evolve. - Rob Harrop - Juergen Hoeller - Rod Johnson - Mark Pollack (.NET) - - - - The shared instance for this class (and derived classes). - - - - - Initializes a new instance of the class. - - The reader context. - - - - Initialize the default lazy-init, dependency check, and autowire settings. - - The root element - - - - Determines whether the Spring object namespace is equal to the the specified namespace URI. - - The namespace URI. - - true if is the default Spring namespace; otherwise, false. - - - - - Decorates the object definition if required. - - The element. - The holder. - - - - - Determines whether the string represents a 'true' boolean value. - - The value. - - true if is 'true' string value; otherwise, false. - - - - - Convenience method to create a builder for a root object definition. - - Name of the object type. - A builder for a root object definition. - - - - Convenience method to create a builder for a root object definition. - - Type of the object. - a builder for a root object definition - - - - Gets the defaults definition object, or null if the - default have not yet been initialized. - - The defaults. - - - - Gets the reader context. - - The reader context. - - - - Creates an instance - populated with the object definitions supplied in the configuration - section. - - -

- Applications will typically want to use an - , and instantiate it - via the use of the - class (which is similar in functionality to this class). This class is - provided for those times when only an - is required. -

- Creates an instance of the class XmlObjectFactory -
- -

- -

-
- Mark Pollack (.NET) -
- - - Creates a new instance of the - class. - - - - - Creates a - instance populated with the object definitions supplied in the - configuration section. - - - The configuration settings in a corresponding parent configuration - section. - - - The configuration context when called from the ASP.NET - configuration system. Otherwise, this parameter is reserved and - is . - - - The for the section. - - - A instance - populated with the object definitions supplied in the configuration - section. - - - - - Default implementation of the - interface. - - -

- Parses object definitions according to the standard Spring.NET schema. -

-

- This schema is typically located at - http://www.springframework.net/xsd/spring-objects.xsd. -

-
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) -
- - - The namespace URI for the standard Spring.NET object definition schema. - - - - - The shared instance for this class (and derived classes). - - - - - Invoked by after construction but before any - elements have been parsed. - - This is a NoOp - - - - Parse the specified element and register any resulting - IObjectDefinitions with the IObjectDefinitionRegistry that is - embedded in the supplied ParserContext. - - The element to be parsed into one or more IObjectDefinitions - The object encapsulating the current state of the parsing - process. - - The primary IObjectDefinition (can be null as explained above) - - - Implementations should return the primary IObjectDefinition - that results from the parse phase if they wish to used nested - inside (for example) a <property> tag. - Implementations may return null if they will not - be used in a nested scenario. - - - - - - Parse the specified XmlNode and decorate the supplied ObjectDefinitionHolder, - returning the decorated definition. - - The XmlNode may either be an XmlAttribute or an XmlElement, depending on - whether a custom attribute or element is being parsed. - Implementations may choose to return a completely new definition, - which will replace the original definition in the resulting IApplicationContext/IObjectFactory. - - The supplied ParserContext can be used to register any additional objects needed to support - the main definition. - - The source element or attribute that is to be parsed. - The current object definition. - The object encapsulating the current state of the parsing - process. - The decorated definition (to be registered in the IApplicationContext/IObjectFactory), - or simply the original object definition if no decoration is required. A null value is strickly - speaking invalid, but will leniently treated like the case where the original object definition - gets returned. - - - - Loads external XML object definitions from the resource described by the supplied - . - - The XML element describing the resource. - The parser context. - - If the resource could not be imported. - - - - Parses an event listener definition. - - The name associated with the object that the event handler is being defined on. - - The events being populated. - - The element containing the event listener definition. - - - The namespace-aware parser. - - - - - Parse an object definition and register it with the object factory.. - - The element containing the object definition. - The parser context. - - - - - Parse a standard object definition into a - , - including object name and aliases. - - The element containing the object definition. - The parser context. - if set to true if we are processing an inner - object definition. - - The object (definition) wrapped within an - - instance. - - -

- Object elements specify their canonical name via the "id" attribute - and their aliases as a delimited "name" attribute. -

-

- If no "id" is specified, uses the first name in the "name" attribute - as the canonical name, registering all others as aliases. -

-
-
- - - Calculates an id for an object definition. - - -

- Called when an object definition has not been explicitly defined - with an id. -

-
- - The element containing the object definition. - - - The list of names defined for the object; may be - or even empty. - - - A calculated object definition id. - -
- - - Parse a standard object definition. - - The element containing the object definition. - The id of the object definition. - parsing state holder - The object (definition). - - - - Parse method override argument subelements of the given object element. - - - - - Parse element and add parsed element to - - - - - Parse element and add parsed element to - - - - - Parse constructor argument subelements of the given object element. - - - - - Parse event handler subelements of the given object element. - - - - - Parse property value subelements of the given object element. - - - The name of the object (definition) associated with the property element (s) - - - The element containing the top level object definition. - - - The namespace-aware parser. - - - The property (s) associated with the object (definition). - - - - - Parse a constructor-arg element. - - - The name of the object (definition) associated with the ctor arg. - - - The list of constructor args associated with the object (definition). - - - The name of the element containing the ctor arg definition. - - - The namespace-aware parser. - - - - - Parse a property element. - - - The name of the object (definition) associated with the property. - - - The list of properties associated with the object (definition). - - - The name of the element containing the property definition. - - - The namespace-aware parser. - - - - - Get the value of a property element (may be a list). - -

- Please note that even though this method is named GetPropertyValue, - it is called by both the property and constructor argument element - handlers. -

-
- The property element. - - The name of the object associated with the property. - - - The namespace-aware parser. - -
- - - Parse a value, ref or collection subelement of a property element. - - - Subelement of property element; we don't know which yet. - - - The name of the object (definition) associated with the top level property. - - - The namespace-aware parser. - - - - - Gets a list definition. - - - The element describing the list definition. - - - The name of the object (definition) associated with the list definition. - - - The namespace-aware parser. - - The list definition. - - - - Gets a set definition. - - - The element describing the set definition. - - - The name of the object (definition) associated with the set definition. - - - The namespace-aware parser. - - The set definition. - - - - Gets a dictionary definition. - - - The element describing the dictionary definition. - - - The name of the object (definition) associated with the dictionary definition. - - - The namespace-aware parser. - - The dictionary definition. - - - - Selects sub-elements with a given - name. - - -

- Uses a namespace manager if necessary. -

-
- - The element to be searched in. - - - The name of the child nodes to look for. - - - The child s of the supplied - with the supplied - . - -
- - - Selects a single sub-element with a given - name. - - -

- Uses a namespace manager if necessary. -

-
- - The element to be searched in. - - - The name of the child node to look for. - - - The first child of the supplied - with the supplied - . - -
- - - Gets a name value collection mapping definition. - - - The element describing the name value collection mapping definition. - - - The name of the object (definition) associated with the - name value collection mapping definition. - - The name value collection definition. - - - - Returns the text of the supplied , - or the empty string value if said is empty. - - -

- If the supplied is , - then the empty string value will be returned. -

-
-
- - - Strips the dependency check value out of the supplied string. - - -

- If the supplied is an invalid dependency - checking mode, the invalid value will be logged and this method will - return the value. - No exception will be raised. -

-
- - The string containing the dependency check value. - - The dependency check value. - -
- - - Strips the autowiring mode out of the supplied string. - - -

- If the supplied is an invalid autowiring mode, - the invalid value will be logged and this method will return the - value. No exception will be raised. -

-
- - The string containing the autowiring mode definition. - - The autowiring mode. - -
- - - Given a string containing delimited object names, returns - a string array split on the object name delimeter. - - - The string containing delimited object names. - - - A string array split on the object name delimeter. - - - - - - Context that gets passed along an object definition parsing process, encapsulating - all relevant configuraiton as well as state. - - - - - Initializes a new instance of the class. - - The reader context. - The parser helper. - - - - Initializes a new instance of the class. - - The reader context. - The parser helper. - The containing object definition. - - - - Gets the reader context. - - The reader context. - - - - Gets the registry. - - The registry. - - - - Gets the parser helper. - - The parser helper. - - - - Gets the containing object definition. - - The containing object definition. - - - - Gets a value indicating whether this instance is nested. - - true if this instance is nested; otherwise, false. - - - - Gets a value indicating whether this instance is default lazy init. - - - true if this instance is default lazy init; otherwise, false. - - - - - Object definition reader for Spring's default XML object definition format. - - -

- Typically applied to a - instance. -

-

- This class registers each object definition with the given object factory superclass, - and relies on the latter's implementation of the - interface. -

-

- It supports singletons, prototypes, and references to either of these kinds of object. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Creates a new instance of the - class. - - - The - instance that this reader works on. - - - - - Creates a new instance of the - class. - - - The - instance that this reader works on. - - - The to be used for parsing. - - - - - Load object definitions from the supplied XML . - - - The XML resource for the object definitions that are to be loaded. - - - The number of object definitions that were loaded. - - - In the case of loading or parsing errors. - - - - - Actually load object definitions from the specified XML file. - - The input stream to read from. - The resource for the XML data. - - - - - Validation callback for a validating XML reader. - - The source of the event. - Any data pertinent to the event. - - - - Register the object definitions contained in the given DOM document. - - The DOM document. - - The original resource from where the - was read. - - - The number of object definitions that were registered. - - - In case of parsing errors. - - - - - Creates the to use for actually - reading object definitions from an XML document. - - Default implementation instantiates the specified 'documentReaderType'. - - - - - Creates the to be passed along - during the object definition reading process. - - The underlying that is currently processed. - A new - - - - The to be used for parsing. - - - - - Sets the IObjectDefinitionDocumentReader implementation to use, responsible for - the actual reading of the XML object definition document.stype of the document reader. - - The type of the document reader. - - - - For retrying the parse process - - - - - Convenience extension of - - that reads object definitions from an XML document or element. - - -

- Delegates to - - underneath; effectively equivalent to using a - for a - . -

- - objects doesn't need to be the root element of - the XML document: this class will parse all object definition elements in the - XML stream. - -

- This class registers each object definition with the - - superclass, and relies on the latter's implementation of the - interface. It supports - singletons, prototypes and references to either of these kinds of object. -

-
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) - -
- - - Creates a new instance of the class, - with the given resource, which must be parsable using DOM. - - - The XML resource to load object definitions from. - - - In the case of loading or parsing errors. - - - - - Creates a new instance of the class, - with the given resource, which must be parsable using DOM. - - - The XML resource to load object definitions from. - - Flag specifying whether to make this object factory case sensitive or not. - - In the case of loading or parsing errors. - - - - - Creates a new instance of the class, - with the given resource, which must be parsable using DOM, and the - given parent factory. - - - The XML resource to load object definitions from. - - The parent object factory (may be ). - - In the case of loading or parsing errors. - - - - - Creates a new instance of the class, - with the given resource, which must be parsable using DOM, and the - given parent factory. - - - The XML resource to load object definitions from. - - Flag specifying whether to make this object factory case sensitive or not. - The parent object factory (may be ). - - In the case of loading or parsing errors. - - - - - Gets object definition reader to use. - - - - - Extension of specific to use with an - XmlObjectDefinitionReader. - - In future will contain access to IXmlParserRegistry - - - - The maximum length of any XML fragment displayed in the error message - reporting. - - -

- Hopefully this will display enough context so that a user - can pinpoint the cause of the error. -

-
-
- - - Initializes a new instance of the class. - - The resource. - The reader. - - - - Generates the name of the object. - - The object definition. - the generated object name - - - - Registers the name of the with generated. - - The object definition. - the generated object name - - - - Reports a parse error by loading a - with helpful contextual - information and throwing said exception. - - -

- Derived classes can of course override this method in order to implement - validators capable of displaying a full list of errors found in the - definition. -

-
- - The node that triggered the parse error. - - - The name of the object that triggered the exception. - - - A message about the exception. - - - Always throws an instance of this exception class, that will - contain helpful contextual infomation about the parse error. - - -
- - - Reports a parse error by loading a - with helpful contextual - information and throwing said exception. - - -

- Derived classes can of course override this method in order to implement - validators capable of displaying a full list of errors found in the - definition. -

-
- - The node that triggered the parse error. - - - The name of the object that triggered the exception. - - - A message about the error. - - - The root cause of the parse error (if any - may be ). - - - Always throws an instance of this exception class, that will - contain helpful contextual infomation about the parse error. - -
- - - This method can be overwritten in order to implement validators - capable of displaying a full list of errors found in the definition. - - - The node that triggered the parse error. - - - A message about the exception. - - - - - Gets the reader. - - The reader. - - - - Gets the resource loader. - - The resource loader. - - - - Gets the registry. - - The registry. - - - - Gets or sets the object definition factory. - - The object definition factory. - - - - Exception thrown if an - is not fully - initialized, for example if it is involved in a circular reference. - - -

- This is usually indicated by any of the variants of the - - method returning . -

-

- A circular reference with an - cannot be solved by eagerly caching singleton instances (as is the - case with normal objects. The reason is that every - needs to be fully - initialized before it can return the created object, while only specific - normal objects need to be initialized - that is, if a collaborating object - actually invokes them on initialization instead of just storing the reference. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Thrown when an - encounters an error when attempting to create an object from an object - definition. - - Juergen Hoeller - Rick Evans (.NET) - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The name of the object that triggered the exception. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The name of the object that triggered the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - The description of the resource associated with the object. - - - A message about the exception. - - - The name of the object that triggered the exception. - - - - - Creates a new instance of the - class. - - - The description of the resource associated with the object. - - - A message about the exception. - - - The name of the object that triggered the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Populates a with - the data needed to serialize the target object. - - - The to populate - with data. - - - The destination (see ) - for this serialization. - - - - - The name of the object that triggered the exception (if any). - - - - - The description of the resource associated with the object (if any). - - - - - Describes the creation failure trace of this exception. - - - - - Creates a new instance of the - FactoryObjectNotInitializedException class. - - - - - Creates a new instance of the FactoryObjectNotInitializedException class. - - - A message about the exception. - - - - - Creates a new instance of the FactoryObjectNotInitializedException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - FactoryObjectCircularReferenceException class. - - - The name of the object that triggered the exception. - - - A message about the exception. - - - - - Creates a new instance of the FactoryObjectCircularReferenceException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Exception thrown when an - is asked for an object instance name for which it cannot find a definition. - - Rod Johnson - Rick Evans (.NET) - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - Name of the missing object. - - - A further, detailed message describing the problem. - - - - - Initializes a new instance of the class. - - The required type of the object. - A description of the originating dependency. - A message describing the problem. - - - - Creates a new instance of the - class. - - - The of the missing object. - - - A further, detailed message describing the problem. - - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Populates a with - the data needed to serialize the target object. - - - The to populate - with data. - - - The destination (see ) - for this serialization. - - - - - Return the required of object, if it was a - lookup by that failed. - - - - - Return the name of the missing object, if it was a lookup by name that - failed. - - - - - Thrown in case of a reference to an object that is currently in creation. - - -

- Typically happens when constructor autowiring matches the currently - constructed object. -

-
- Juergen Hoeller - Rick Evans -
- - - The default error message text to be used, if none is specified. - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The name of the object that triggered the exception. - - - - - Creates a new instance of the - class. - - - The name of the object that triggered the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The name of the object that triggered the exception. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The name of the object that triggered the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - The description of the resource associated with the object. - - - A message about the exception. - - - The name of the object that triggered the exception. - - - - - Creates a new instance of the - class. - - - The description of the resource associated with the object. - - - A message about the exception. - - - The name of the object that triggered the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ObjectCurrentlyInCreationException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Exception thrown when an - encounters an error when attempting to parse an object - definition. - - Federico Spinazzi (.NET) - - - - Creates a new instance of the ObjectDefinitionException class. - - - - - Creates a new instance of the ObjectDefinitionException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ObjectDefinitionException class. - - - The value of the xml class attribute thet can be resolved - as a type - - - - - Creates a new instance of the ObjectDefinitionException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Populates a with - the data needed to serialize the target object. - - - The to populate - with data. - - - The destination (see ) - for this serialization. - - - - - The message about the exception. - - - - - Thrown when an - encounters an internal error, and its definitions are invalid. - - -

- An example of a situation when this exception would be thrown is - in the case of an XML document containing object definitions being - malformed. -

-
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) -
- - - Creates a new instance of the ObjectDefinitionStoreException class. - - - - - Creates a new instance of the ObjectDefinitionStoreException class. - - - A message about the exception. - - - - - Creates a new instance of the ObjectDefinitionStoreException class. - - - The description of the resource that the object definition came from - - - The name of the object that triggered the exception. - - - A message about the exception. - - - - - Initializes a new instance of the class. - - - The description of the resource that the object definition came from - - The detail message (used as exception message as-is) - The root cause. (may be null - - - - Creates a new instance of the ObjectDefinitionStoreException class. - - - The resource location (e.g. an XML object definition file) associated - with the offending object definition. - - - A message about the exception. - - - The name of the object that triggered the exception. - - - - - Creates a new instance of the ObjectDefinitionStoreException class. - - - The resource location (e.g. an XML object definition file) associated - with the offending object definition. - - - A message about the exception. - - - The name of the object that triggered the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ObjectDefinitionStoreException class. - - - The description of the resource that the object definition came from - - - A message about the exception. - - - The name of the object that triggered the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ObjectDefinitionStoreException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ObjectDefinitionStoreException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Populates a with - the data needed to serialize the target object. - - - The to populate - with data. - - - The destination (see ) - for this serialization. - - - - - The description of the resource associated with the object - - - - - The name of the object that trigger the exception. - - - - - The name of the object that triggered the exception (if any). - - - - - The description of the resource associated with the object (if any). - - - - - Convenience methods operating on object factories, returning object instances, - names, or counts. - - -

- The nesting hierarchy of an object factory is taken into account by the various methods - exposed by this class. -

-
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) -
- - - Used to dereference an - and distinguish it from managed objects created by the factory. - - -

- For example, if the managed object identified as foo is a - factory, getting &foo will return the factory, not the - instance returned by the factory. -

-
-
- - - The string used as a separator in the generation of synthetic id's - for those object definitions explicitly that aren't assigned one. - - -

- If a name or parent object definition - name is not unique, "#1", "#2" etc will be appended, until such - time that the name becomes unique. -

-
-
- - - Creates a new instance of the - class. - - -

- This is a utility class, and as such has no publicly visible - constructors. -

-
-
- - - Count all object definitions in any hierarchy in which this - factory participates. - - -

- Includes counts of ancestor object factories. -

-

- Objects that are "overridden" (specified in a descendant factory - with the same name) are counted only once. -

-
- The object factory. - - The count of objects including those defined in ancestor factories. - -
- - - Return all object names in the factory, including ancestor factories. - - The object factory. - The array of object names, or an empty array if none. - - - - Get all object names for the given type, including those defined in ancestor - factories. - - -

- Will return unique names in case of overridden object definitions. -

-

- Does consider objects created by s - if is set to true, - which means that s will get initialized. -

-
- - If this isn't also an - , - this method will return the same as it's own - - method. - - - The that objects must match. - - - Whether to include prototype objects too or just singletons - (also applies to instances). - - - Whether to include instances - too or just normal objects. - - - The array of object names, or an empty array if none. - -
- - - Get all object names for the given type, including those defined in ancestor - factories. - - -

- Will return unique names in case of overridden object definitions. -

-

- Does consider objects created by s, - or rather it considers the type of objects created by - (which means that - s will be instantiated). -

-
- - If this isn't also an - , - this method will return the same as it's own - - method. - - - The that objects must match. - - - The array of object names, or an empty array if none. - -
- - - Return all objects of the given type or subtypes, also picking up objects - defined in ancestor object factories if the current object factory is an - . - - -

- The return list will only contain objects of this type. - Useful convenience method when we don't care about object names. -

-
- The object factory. - The of object to match. - - Whether to include prototype objects too or just singletons - (also applies to instances). - - - Whether to include instances - too or just normal objects. - - - If the objects could not be created. - - - The of object instances, or an - empty if none. - -
- - - Return a single object of the given type or subtypes, also picking up objects defined - in ancestor object factories if the current object factory is an - . - - -

- Useful convenience method when we expect a single object and don't care - about the object name. -

-
- The object factory. - The of object to match. - - Whether to include prototype objects too or just singletons - (also applies to instances). - - - Whether to include instances - too or just normal objects. - - - If the object could not be created. - - - If more than one instance of an object was found. - - - A single object of the given type or subtypes. - -
- - - Return a single object of the given type or subtypes, not looking in - ancestor factories. - - -

- Useful convenience method when we expect a single object and don't care - about the object name. -

-
- The object factory. - The of object to match. - - Whether to include prototype objects too or just singletons - (also applies to instances). - - - Whether to include instances - too or just normal objects. - - - If the object could not be created. - - - If not exactly one instance of an object was found. - - - A single object of the given type or subtypes. - -
- - - Return a single object of the given type or subtypes, not looking in - ancestor factories. - - -

- Useful convenience method when we expect a single object and don't care - about the object name. - This version of ObjectOfType automatically includes prototypes and - instances. -

-
- The object factory. - The of object to match. - - If the object could not be created. - - - If not exactly one instance of an object was found. - - - A single object of the given type or subtypes. - -
- - - Return the object name, stripping out the factory dereference prefix if necessary. - - The name of the object. - The object name sans any factory dereference prefix. - - - - Given an (object) name, builds a corresponding factory object name such that - the return value can be used as a lookup name for a factory object. - - - The name to be used to build the resulting factory object name. - - - The transformed into its factory object name - equivalent. - - - - - - - Is the supplied a factory dereference? - - -

- That is, does the supplied begin with - the - ? -

-
- The name to check. - - if the supplied is a - factory dereference; if not, or the - aupplied is or - consists solely of the - - value. - - -
- - - Exception that an object implementation is suggested to throw if its own - factory-aware initialization code fails. - thrown by object factory methods - themselves should simply be propagated as-is. - - -

- Note that non-factory-aware initialization methods like AfterPropertiesSet () - or a custom "init-method" can throw any exception. -

-
- Juergen Hoeller - Rick Evans (.NET) -
- - - Creates a new instance of the ObjectInitializationException class. - - - - - Creates a new instance of the ObjectInitializationException class. - - - A message about the exception. - - - - - Creates a new instance of the ObjectInitializationException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ObjectInitializationException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Thrown in response to an attempt to lookup a factory object, and - the object identified by the lookup key is not a factory. - - -

- An object is a factory if it implements (either directly or indirectly - via inheritance) the - interface. -

-
- Rod Johnson - Rick Evans (.NET) -
- - - Thrown when an object doesn't match the required . - - Rod Johnson - Rick Evans (.NET) - - - - Creates a new instance of the ObjectNotOfRequiredTypeException class. - - - - - Creates a new instance of the ObjectNotOfRequiredTypeException class. - - - A message about the exception. - - - - - Creates a new instance of the ObjectNotOfRequiredTypeException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ObjectNotOfRequiredTypeException class. - - - Name of the object requested. - - - The required of the actual object - instance that was retrieved. - - - The instance actually returned, whose class did not match the - expected . - - - - - Creates a new instance of the ObjectNotOfRequiredTypeException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Populates a with - the data needed to serialize the target object. - - - The to populate - with data. - - - The destination (see ) - for this serialization. - - - - - The actual of the actual object - instance that was retrieved. - - - - - The required of the actual object - instance that was retrieved. - - - - - The instance actually returned, whose class did not match the - expected . - - - - - The name of the object requested. - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - The name of the object that was being retrieved from the factory. - - - The object instance that was retrieved. - - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Exception thrown when an object depends on other objects or simple properties - that were not specified in the object factory definition, although dependency - checking was enabled. - - Rod Johnson - Juergen Hoeller - Rick Evans (.NET) - - - - Creates a new instance of the UnsatisfiedDependencyException class. - - - - - Creates a new instance of the UnsatisfiedDependencyException class. - - - A message about the exception. - - - - - Creates a new instance of the UnsatisfiedDependencyException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the UnsatisfiedDependencyException class. - - - The description of the resource associated with the object. - - - The name of the object that has the unsatisfied dependency. - - - The constructor argument index at which the dependency is - unsatisfied. - - - The of the constructor argument at - which the dependency is unsatisfied. - - - A message about the exception. - - - - - Creates a new instance of the UnsatisfiedDependencyException class. - - - The description of the resource associated with the object. - - - The name of the object that has the unsatisfied dependency. - - - The name identifying the property on which the dependency is - unsatisfied. - - - A message about the exception. - - - - - Creates a new instance of the UnsatisfiedDependencyException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Base class implementation for classes that describe an event handler. - - Rick Evans - - - - Describes an event handler. - - Rick Evans - - - - Wires up the specified handler to the named event on the - supplied event source. - - - The object (an object instance, a , etc) - exposing the named event. - - - The handler for the event (an object instance, a - , etc). - - - - - The source of the event. - - - - - The name of the method that is going to handle the event. - - - - - The name of the event that is being wired up. - - - - - Creates a new instance of the - class. - - -

- This is an class, and as such exposes no public constructors. -

-
-
- - - Creates a new instance of the - class. - - - The object (possibly unresolved) that is exposing the event. - - - The name of the method on the handler that is going to handle the event. - - -

- This is an class, and as such exposes no public constructors. -

-
-
- - - Wires up the specified handler to the named event on the - supplied event source. - - - The object (an object instance, a , etc) - exposing the named event. - - - The handler for the event (an object instance, a - , etc). - - - - - Returns a stringified representation of this object. - - A stringified representation of this object. - - - - The source of the event (may be unresolved, as in the case - of a - value). - - - - - The name of the method that is going to handle the event. - - - - - The name of the event that is being wired up. - - - - - Convenience base class for implementations. - - - - - Abstracts the state sharing strategy used - by - - Erich Eichinger - - - - Indicate, whether the given instance can be served by this factory - - the instance to serve state - the name of the instance - - a boolean value indicating, whether state can - be served for the given instance or not. - - - - - Returns the shared state for the given instance. - - the instance to obtain shared state for. - the name of this instance - a dictionary containing shared state for or null. - - - - Gets a dictionary acc. to the type of . - If no dictionary is found, create it according to - - the instance to obtain shared state for - the name of the instance. - - A dictionary containing the 's state, - or null if no state can be served by this provider. - - - - - Creates a dictionary to hold the shared state identified by . - - a key to create the dictionary for. - a dictionary according to and . - - - - Indicate, whether the given instance will be served by this provider - - the instance to serve state - the name of the instance - - a boolean value indicating, whether state shall - be resolved for the given instance or not. - - - - - Create the key used for obtaining the state dictionary for . - - the instance to create the key for - the name of the instance. - - the key identifying the state dictionary to be used for - or null, if this state manager doesn't serve the given instance. - - - - Implementations may choose to return null from this method to indicate, - that they won't serve state for the given instance. - - - Note:Keys returned by this method are always treated case-sensitive! - - - - - - Create shared state dictionaries case-sensitive or case-insensitive? - - - - - A number indicating the priority of this ( for more). - - - - - Base class for all - implemenations that actually perform event wiring. - - Rick Evans - - - - Creates a new instance of the - class. - - -

- This is an class, and as such exposes no public constructors. -

-
-
- - - Creates a new instance of the - class. - - - The object (possibly unresolved) that is exposing the event. - - - The name of the method on the handler that is going to handle the event. - - -

- This is an class, and as such exposes no public constructors. -

-
-
- - - Wires up the specified handler to the named event on the - supplied event source. - - - The object (an object instance, a , etc) - exposing the named event. - - - The handler for the event (an object instance, a - , etc). - - - - - Gets the event handler. - - - The instance that is registering for the event notification. - - - Event metadata about the event. - - - The event handler. - - - - - Resolves the method metadata that describes the method that is to be used - as the argument to a delegate constructor. - - - The exposing the method. - - - The of the delegate (e.g. System.EventHandler). - - - The custom binding flags to use when searching for the method. - - The method metadata. - - If the method could not be found. - - - - - Describes an implementation - that autowires events to handler methods. - - Rick Evans - - - - Creates a new instance of the - class. - - - - - Wires up the specified handler to the named event on the supplied event source. - - - The object (an object instance, a , etc) - exposing the named event. - - - The handler for the event (an object instance, a , - etc). - - - - - The name of the method that is going to handle the event. - - - - - Performs the matching up of handler methods to one or more source events. - - -

- This class merely marshals the matching of handler methods to the events exposed - by an event source, and then delegates to a concrete - implementation (such as - or - ) to do the heavy lifting of - actually wiring a handler method to an event. -

-

- Note : the order in which handler's are wired up to events is non-deterministic. -

-
-
- - - Creates a new instance of the - class. - - - The object exposing the event (s) being wired up. - - - The name of the event that is being wired up. - - - The object exposing the method (s) being wired to the event. - - - The name of the method that is going to handle the event. - - - - - Wires up events on the source to methods exposed on the handler. - - - - - Wires up the supplied event to any handler methods that match the event - signature. - - The event being wired up. - - - - Only replaces the first occurrence of the placeholder. - - The event whose name is going to be used. - - The method name customised for the name of the supplied event. - - - - - The object exposing the event (s) being wired up. - - - - - The object exposing the method (s) being wired to an event source. - - - - - The of the object that is handling any events. - - - - - The name of the method that is going to handle the event. - - - - - The name of the event that is being wired up. - - - - - Serves shared state on a by-type basis. - - - - - Creates a new instance matching all types by default. - - - - - Creates a new instance matching only specified list of types. - - the list of types to serve. - - - - Indicate, whether the given instance will be served by this provider - - the instance to serve state - the name of the instance - - a boolean value indicating, whether state shall - be resolved for the given instance or not. - - - - - Returns the for the given . - - the instance to obtain the key for. - the name of the instance (ignored by this provider) - instance.GetType() if it matches the list. Null otherwise. - - This method will only be called if returned true previously. - - - - - Limit object types to be served by this state manager. - - - Only objects assignable to one of the types in this list - will be served state by this manager. - - - - - Describes an event handler for an object instance. - - Rick Evans - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The object (possibly unresolved) that is exposing the event. - - - The name of the method on the handler that is going to handle the event. - - - - - Gets the event handler. - - - The instance that is registering for the event notification. - - - Event metadata about the event. - - - The event handler. - - - - - Definition for sorting object instances by a property. - - Juergen Hoeller - Simon White (.NET) - - - - The name of the property to sort by. - - - - - Whether upper and lower case in string values should be ignored. - - - True if the sorting should be performed in a case-insensitive fashion. - - - - - If the sorting should be ascending or descending. - - - True if the sorting should be in the ascending order. - - - - - Mutable implementation of the - interface that - supports toggling the ascending value on setting the same property again. - - Juergen Hoeller - Jean-Pierre Pawlak - Simon White (.NET) - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class using - the specified . - - - The to use - as a source for initial property values. - - - - - Creates a new instance of the - class. - - - The name of the property to sort by. - - - Whether upper and lower case in string values should be ignored. - - - Whether or not the sorting should be ascending or descending. - - - - - Creates a new instance of the - class. - - - Whether or not the - - property should be toggled if the same name is set on the - - property. - - - - - Overrides the default method - - - The object to test against this instance for equality. - - - True if the supplied is equal to this instance. - - - - - Overrides the default method. - - The hashcode for this instance. - - - - The name of the property to sort by. - - - - - Whether upper and lower case in string values should be ignored. - - - True if the sorting should be performed in a case-insensitive fashion. - - - - - If the sorting should be ascending or descending. - - - True if the sorting should be in the ascending order. - - - - - Performs a comparison of two objects, using the specified object property via - an . - - Juergen Hoeller - Jean-Pierre Pawlak - Simon White (.NET) - - - - Creates a new instance of the - class. - - - The to use for any - sorting. - - - If the supplied is . - - - - - Compares two objects and returns a value indicating whether one is less - than, equal to or greater than the other. - - The first object to compare. - The second object to compare. - - - - - Get the 's property - value for the given object. - - The object to get the property value for. - The property value. - - - - Sort the given according to the - given sort definition. - - - The to be sorted. - - The parameters to sort by. - - In the case of a missing property name. - - - If the supplied is . - - - - - Gets the to - use for any sorting. - - - The to use for - any sorting. - - - - - Describes an event handler for a static class method. - - Rick Evans - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - The object (possibly unresolved) that is exposing the event. - - - The name of the method on the handler that is going to handle the event. - - - - - Gets the event handler. - - - The instance that is registering for the event notification. - - - Event metadata about the event. - - - The event handler. - - - - - The central interface of Spring.NET's low-level object infrastructure. - - -

- Typically not directly used by application code but rather implicitly - via an . -

-

- Implementing classes have the ability to get and set property values - (individually or in bulk), get property descriptors and query the - readability and writability of properties. -

-

- This interface supports nested properties enabling the setting - of properties on subproperties to an unlimited depth. -

-

- If a property update causes an exception, a - will be thrown. Bulk - updates continue after exceptions are encountered, throwing an exception - wrapping all exceptions encountered during the update. -

-

- implementations can be used - repeatedly, with their "target" or wrapped object changed. -

-
- Rod Johnson - Mark Pollack (.NET) -
- - Get the value of a property. - - The name of the property to get the value of. May be nested. - - The value of the property. - - if the property isn't readable, or if the getting the value throws - an exception. - - - - - Get the for a particular - property. - - - The property to be retrieved. - - - The for the particular - property. - - - - - Get the for a particular property. - - - The property the of which is to be retrieved. - - - The for a particular property.. - - - - - Get all of the instances for - all of the properties of the wrapped object. - - - An array of instances. - - - - - Set a property value. - - -

- This is the preferred way to update an individual property. -

-
- The new property value. -
- - - Set a property value. - - -

- This method is provided for convenience only. The - - method is more powerful. -

-
- - The name of the property to set value of. - - The new property value. -
- - Set a number of property values in bulk. - -

- This is the preferred way to perform a bulk update. -

-

- Note that performing a bulk update differs from performing a single update, - in that an implementation of this class will continue to update properties - if a recoverable error (such as a vetoed property change or a type - mismatch, but not an invalid property name or the like) is - encountered, throwing a - containing - all the individual errors. This exception can be examined later to see all - binding errors. Properties that were successfully updated stay changed. -

-

- Does not allow the setting of unknown fields. Equivalent to - - with an argument of false for the second parameter. -

-
- - The collection of instances to - set on the wrapped object. - -
- - - Set a number of property values in bulk with full control over behavior. - - -

- Note that performing a bulk update differs from performing a single update, - in that an implementation of this class will continue to update properties - if a recoverable error (such as a vetoed property change or a type - mismatch, but not an invalid property name or the like) is - encountered, throwing a - containing - all the individual errors. This exception can be examined later to see all - binding errors. Properties that were successfully updated stay changed. -

-

Does not allow the setting of unknown fields. -

-
- - The to set on the target object - - - Should we ignore unknown values (not found in the object!?) - -
- - - The object wrapped by the wrapper (cannot be ). - - -

- Implementations are required to allow the type of the wrapped - object to change. -

-
- The object wrapped by this wrapper. -
- - - Convenience method to return the - of the wrapped object. - - The of the wrapped object. - - - - A collection style container for - instances. - - Rod Johnson - Mark Pollack (.NET) - - - - Return the instance with the - given name. - - The name to search for. - the , or null if a - the with the supplied - did not exist in this collection. - - - - - Is there a instance for this - property name? - - The name to search for. - - True if there is a instance for - the supplied . - - - - - Return the difference (changes, additions, but not removals) of - property values between the supplied argument and the values - contained in the collection. - - -

- Subclasses should also override Equals. -

-
- The old property values. - - An containing any changes, or - an empty instance if there were - no changes. - -
- - - Return an array of the objects - held in this object. - - An array of the objects held - in this object. - - - - - This interface should be implemented by classes that want to - have access to the shared state. - - -

- Shared state is very useful if you have data that needs to be shared by all instances - of e.g. the same webform (or other IHttpHandlers). -

-

- For example, Spring.Web.UI.Page class implements this interface, which allows - each page derived from it to cache localizalization resources and parsed data binding - expressions only once and then reuse the cached values, regardless of how many instances - of the page are created. -

-
-
- - - Gets or sets the that should be used - to store shared state for this instance. - - - - - Default implementation of the - interface. - - -

- Allows simple manipulation of properties, and provides constructors to - support deep copy and construction from a number of collection types such as - and - . -

-
- Rod Johnson - Mark Pollack (.NET) - Rick Evans (.NET) -
- - - The list of objects. - - - - - Creates a new instance of the - class. - - -

- The returned instance is initially empty... - s can be added with the various - overloaded , - , - , - and - methods. -

-
- - -
- - - Creates a new instance of the - class. - - -

- Deep copy constructor. Guarantees - references are independent, although it can't deep copy objects currently - referenced by individual objects. -

-
-
- - - Creates a new instance of the - class. - - - The with property values - keyed by property name, which must be a . - - - - - Overloaded version of Add that takes a property name and a property value. - - - The name of the property. - - - The value of the property. - - - - - Add the supplied object, - replacing any existing one for the respective property. - - - The object to add. - - - - - Add all property values from the given - . - - - The map of property values, the keys of which must be - s. - - - - - Add all property values from the given - . - - - The list of s to be added. - - - - - Remove the given , if contained. - - - The to remove. - - - - - Removes the named , if contained. - - - The name of the property. - - - - - Modify a object held in this object. Indexed from 0. - - - - - Return the property value given the name. - - - The property name is checked in a case-insensitive fashion. - - - The name of the property. - - - The property value. - - - - - Does the container of properties contain one of this name. - - The name of the property to search for. - - True if the property is contained in this collection, false otherwise. - - - - - Return the difference (changes, additions, but not removals) of - property values between the supplied argument and the values - contained in the collection. - - Another property values collection. - - The collection of property values that are different than the supplied one. - - - - - Returns an that can iterate - through a collection. - - -

- The returned is the - exposed by the - - property. -

-
- - An that can iterate through a - collection. - -
- - - Convert the object to a string representation. - - - A string representation of the object. - - - - - Property to retrieve the array of property values. - - - - - Default implementation of the - interface that should be sufficient for all normal uses. - - -

- will convert - and array - values to the corresponding target arrays, if necessary. Custom - s that deal with - s or arrays can be written against a - comma delimited as - arrays are converted in such a format if the array itself is not assignable. -

-
- Rod Johnson - Juergen Hoeller - Jean-Pierre Pawlak - Mark Pollack (.NET) - Aleksandar Seovic(.NET) -
- - The wrapped object. - - - - The ILog instance for this class. We'll create a lot of these objects, - so we don't want a new instance every time. - - - - - Creates a new instance of the class. - - -

- The wrapped target instance will need to be set afterwards. -

-
- -
- - - Creates a new instance of the class. - - - The object wrapped by this . - - - If the supplied is . - - - - - Creates a new instance of the class, - instantiating a new instance of the specified and using - it as the . - - -

- Please note that the passed as the - argument must have a no-argument constructor. - If it does not, an exception will be thrown when this class attempts - to instantiate the supplied using it's - (non-existent) constructor. -

-
- - The to instantiate and wrap. - - - If the is , or if the - invocation of the s default (no-arg) constructor - fails (due to invalid arguments, insufficient permissions, etc). - -
- - Gets the value of a property. - - The name of the property to get the value of. - - The value of the property. - - If there is no such property, if the property isn't readable, or - if getting the property value throws an exception. - - - - Gets the value of a property. - - The property expression that should be used to retrieve the property value. - - The value of the property. - - If there is no such property, if the property isn't readable, or - if getting the property value throws an exception. - - - - - Sets a property value. - - -

- This method is provided for convenience only. The - - method is more powerful. -

-
- - The name of the property to set value of. - - The new value. -
- - - Sets a property value. - - - The property expression that should be used to set the property value. - - The new value. - - - - Sets a property value. - - -

- This is the preferred way to update an individual property. -

-
- - The object containing new property value. - -
- - Set a number of property values in bulk. - -

- Does not allow unknown fields. Equivalent to - - with and for - arguments. -

-
- - The to set on the target - object. - - - If an error is encountered while setting a property. - - - On a mismatch while setting a property, insufficient permissions, etc. - - -
- - - Perform a bulk update with full control over behavior. - - -

- This method may throw a reflection-based exception, if there is a critical - failure such as no matching field... less serious exceptions will be accumulated - and thrown as a single . -

-
- - The s to set on the target object. - - - Should we ignore unknown values (not found in the object!?). - - - If an error is encountered while setting a property (only thrown if the - parameter is set to ). - - - On a mismatch while setting a property, insufficient permissions, etc. - - -
- - - Returns PropertyInfo for the specified property - - The name of the property to search for. - The for the specified property. - If cannot be determined. - - - - Get the for a particular property. - - - The property the of which is to be retrieved. - - - The for a particular property.. - - - - - Returns MemberInfo for the specified property or field - - The name of the property or field to search for. - The or for the specified property or field. - If does not resolve to a property or field. - - - - Get the properties of the wrapped object. - - - An array of s. - - - - - This method is expensive! Only call for diagnostics and debugging reasons, - not in production. - - - A string describing the state of this object. - - - - - Attempts to parse property expression first and falls back to full expression - if that fails. Performance optimization. - - Property expression to parse. - Parsed proeprty expression. - - - - The object wrapped by this . - - - If the object cannot be changed; or an attempt is made to set the - value of this property to . - - - - - Convenience method to return the of the wrapped object. - - -

- Do not use this (convenience) method prior to setting the - property. -

-
- - The of the wrapped object. - - - If the property - is . - -
- - - Return the collection of property descriptors. - - - - - Combined exception, composed of individual binding - s. - - -

- An object of this class is created at the beginning of the binding - process, and errors added to it as necessary. -

-

- The binding process continues when it encounters application-level - s, applying those changes - that can be applied and storing rejected changes in an instance of this class. -

-
- Rod Johnson - Juergen Hoeller - Mark Pollack (.NET) -
- - - Creates a new instance of the PropertyAccessExceptionsException class. - - - - - Creates a new instance of the PropertyAccessExceptionsException class. - - - A message about the exception. - - - - - Creates a new instance of the PropertyAccessExceptionsException class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Create new empty PropertyAccessExceptionsException. - We'll add errors to it as we attempt to bind properties. - - - - - Creates a new instance of the PropertyAccessExceptionsException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Populates a with - the data needed to serialize the target object. - - - The to populate - with data. - - - The destination (see ) - for this serialization. - - - - - The IObjectWrapper wrapping the target object at the root of the exception. - - - - The list of PropertyAccessException objects. - - - - Return the - for the supplied , or - if there isn't one. - - - - - Describe the number of exceptions contained in this container class. - - A description of the instance contents. - - - - Return the that generated - this exception. - - - - - Return the object we're binding to. - - - - - If this returns zero (0), no errors were encountered during binding. - - - - - Return an array of the s - stored in this object. - - -

- Will return the empty array (not ) if there were no errors. -

-
-
- - - Describe the group of exceptions. - - - - - Holds information and value for an individual property. - - -

- Using an object here, rather than just storing all properties in a - map keyed by property name, allows for more flexibility, and the - ability to handle indexed properties in a special way if necessary. -

-

- Note that the value doesn't need to be the final required - : an - implementation must - handle any necessary conversion, as this object doesn't know anything - about the objects it will be applied to. -

-
- Rod Johnson - Mark Pollack (.NET) -
- - - Creates a new instance of the - class. - - The name of the property. - - The value of the property (possibly before type conversion). - - - If the supplied is or - contains only whitespace character(s). - - - - - Creates a new instance of the - class. - - The name of the property. - - The value of the property (possibly before type conversion). - - Pre-parsed property name. - - If the supplied or - is , or if the name contains only whitespace characters. - - - - - Print a string representation of the property. - - A string representation of the property. - - - - Determines whether the supplied - is equal to the current . - - The other instance. - - if they are equal in content. - - - - - Serves as a hash function for a particular type, suitable for use - in hashing algorithms and data structures like a hash table. - - - A hash code for the current . - - - - The name of the property. - The name of the property. - - - - Parsed property expression. - - - - - Return the value of the property. - - -

- Note that type conversion will not have occurred here. - It is the responsibility of the - implementation to - perform type conversion. -

-
- The (possibly unresolved) value of the property. -
- - - A simple pool implementation - - -

- Based on the implementation found in Concurrent Programming in Java, - 2nd ed., by Doug Lea. -

-
- Doug Lea - Federico Spinazzi - Mark Pollack -
- - - A simple pooling interface for managing and monitoring a pool - of objects. - - -

- Based on the Jakarta Commons Pool API. -

-
- Federico Spinazzi - -
- - - Obtain an instance from the pool. - - -

- By contract, clients must return the borrowed - instance using - or a related method as defined in an implementation or - sub-interface. -

-
- An instance from the pool. - - In case the pool is unusable. - - -
- - - Return an instance to the pool. - - -

- By contract, the object must have been obtained using - - or a related method as defined in an implementation or sub-interface. -

-
- The instance to be returned to the pool. - -
- - - Create an object using the factory set by - the property - or other implementation dependent mechanism - and place it into the pool. - - -

- This is an optional operation. AddObject is useful for "pre-loading" a - pool with idle objects. -

-
- - If the implementation does not support the operation. - -
- - - Close the pool and free any resources associated with it. - - - - - Clear objects sitting idle in the pool, releasing any - associated resources. - - -

- This is an optional operation. -

-
- - If the implementation does not support the operation. - -
- - - Gets the number of instances currently borrowed from the pool. - - -

- This is an optional operation. -

-
- - If the implementation does not support the operation. - -
- - - Gets the number of instances currently idle in the pool. - - -

- This is an optional operation. -

-

- This may be considered an approximation of the number of objects - that can be borrowed without creating any new instances. -

-
- - If the implementation does not support the operation. - -
- - - Set the factory used to create new instances. - - -

- This is an optional operation. -

-
- - If the implementation does not support the operation. - -
- - - Set of permits - - - - - Creates a new instance of the - class. - - - The factory used to instantiate and manage the lifecycle of pooled objects. - - The initial size of the pool. - - If the supplied is . - - - If the supplied is less than or equal to zero. - - - - - Obtain an instance from the pool. - - - In case the pool is unusable. - - - - - - - Return an instance to the pool. - - The instance to be returned to the pool. - - - - - - Create an object using the factory set by - the property - or other implementation dependent mechanism - and place it into the pool. - - -

- This implementation always throws a - . -

-
- - If the implementation does not support the operation. - -
- - - Synchronized borrow logic. - - - - - - Synchronized release logic. - - - The object to release to the pool. - - - if the object was not a busy one. - - - - - Instantiates the supplied number of instances and adds - them to the pool. - - - The initial number of objects to build. - - - If the supplied number of is - less than or equal to zero. - - - - - Close the pool and free any resources associated with it. - - - - - Clear objects sitting idle in the pool, releasing any - associated resources. - - -

- This implementation always throws a - . -

-
- - If the implementation does not support the operation. - -
- - - Change the state of the pool to unusable. - - - - - Gets the number of instances currently borrowed from the pool. - - - If the implementation does not support the operation. - - - - - - Gets the number of instances currently idle in the pool. - - - If the implementation does not support the operation. - - - - - - Set the factory used to create new instances. - - -

- This implementation always throws a - . -

-
- - If the implementation does not support the operation. - -
- - - Defines lifecycle methods for objects that are to be used in an - implementation. - - -

- The following methods summarize the contract between an - and an - an . -

- - - - is called whenever a new instance is needed. - - - - is invoked on every instance before it is returned from - the pool. - - - - is invoked on every instance when it is returned to the pool. - - - - is invoked on every instance when it is being dropped from the - pool (see - - - -

- Based on the Jakarta Commons Pool API. -

-
- Federico Spinazzi - -
- - - Creates an instance that can be returned by the pool. - - - An instance that can be returned by the pool. - - - - - Destroys an instance no longer needed by the pool. - - -

- Invoked on every instance when it is being "dropped" - from the pool (whether due to the return value from a call to the - - method, or for reasons specific to the pool implementation.) -

-
- The instance to be destroyed. -
- - - Ensures that the instance is safe to be returned by the pool. - Returns false if this object should be destroyed. - - -

- Invoked in an implementation-specific fashion to determine if an - instance is still valid to be returned by the pool. - It will only be invoked on an "activated" instance. -

-
- The instance to validate. - - if this object is not valid and - should be dropped from the pool, otherwise . - -
- - - Reinitialize an instance to be returned by the pool. - - -

- Invoked on every instance before it is returned from the pool. -

-
- The instance to be activated. -
- - - Uninitialize an instance to be returned to the pool. - - -

- Invoked on every instance when it is returned to the pool. -

-
- The instance returned to the pool. -
- - - Base class for all pooling exceptions. - - Federico Spinazzi - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - - - Creates a new instance of the - class. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Base class for method builders that contains common functionalities. - - Bruno Baia - - - - Defines interface that proxy method builders have to implement. - - Aleksandar Seovic - Bruno Baia - - - - Dynamically builds proxy method. - - The method to proxy. - - The interface definition of the method, if applicable. - - - The for the proxy method. - - - - - The type builder to use. - - - - - The implementation to use. - - - - - Indicates whether interfaces should be implemented explicitly. - - - - - Creates a new instance of the method builder. - - The type builder to use. - - The implementation to use. - - - if the interface is to be - implemented explicitly; otherwise . - - - - - Dynamically builds proxy method. - - The method to proxy. - - The interface definition of the method, if applicable. - - - The for the proxy method. - - - - - Generates the IL instructions that pushes - the proxy instance on stack. - - The IL generator to use. - - - - Generates the IL instructions that pushes - the target instance on which calls should be delegated to. - - The IL generator to use. - - - - Defines proxy method for the target object. - - The method to proxy. - - The interface definition of the method, if applicable. - - - if the supplied is to be - implemented explicitly; otherwise . - - - The for the proxy method. - - - - - Defines method parameters based on proxied method metadata. - - - The to use. - - The method to proxy. - - - - Defines generic method parameters based on proxied method metadata. - - - The to use. - - The method to proxy. - - - - Generates the proxy method. - - The IL generator to use. - The method to proxy. - - The interface definition of the method, if applicable. - - - - - Calls target method directly. - - The IL generator to use. - - The interface definition of the method, if applicable. - - - - - Calls base method directly. - - The IL generator to use. - The method to proxy. - - - - Replaces a raw reference with a reference to a proxy. - - -

- If the target object returns reference to itself -- 'this' -- - we need to treat it as a special case and return a reference - to a proxy object instead. -

-
- The IL generator to use. - The location of the return value. -
- - - Base class for proxy builders that can be used - to create a proxy for any class. - - -

- This class provides a set of template - methods that derived classes can override to provide custom behaviour - appropriate to the type of proxy that is being generated (one of - inheritance or composition-based proxying). -

-
- Aleksandar Seovic - Bruno Baia -
- - - Describes the operations for a generic proxy type builder that can be - used to create a proxy type for any class. - - Aleksandar Seovic - - - - Creates the proxy type. - - The generated proxy class. - - - - The name of the proxy . - - The name of the proxy . - - - - The of the target object. - - - - - The of the class that the proxy must - inherit from. - - - - - Gets or sets the list of interfaces proxy should implement. - - - - - Should we proxy target attributes? - - - by default. - Target type attributes, method attributes, method's return type attributes - and method's parameter attributes are copied to the proxy. - - - - - The list of custom s that the proxy - class must be decorated with. - - -

- Note that the list is composed of instances of the actual - s that are to be applied, not the - s of the s. -

-
- -

- The following code snippets show examples of how to decorate the - the proxied class with one or more s. -

- - // get a concrete implementation of an IProxyTypeBuilder... - IProxyTypeBuilder builder = ... ; - builder.TargetType = typeof( ... ); - - IDictionary typeAtts = new Hashtable(); - builder.TypeAttributes = typeAtts; - - // applies a single Attribute to the proxied class... - typeAtts = new Attribute[] { new MyCustomAttribute() }); - - // applies a number of Attributes to the proxied class... - typeAtts = new Attribute[] - { - new MyCustomAttribute(), - new AnotherAttribute(), - }); - -
-
- - - The custom s that the proxy - members must be decorated with. - - -

- This dictionary must use simple s for keys - (denoting the member names that the attributes are to be applied to), - with the corresponding values being - s. -

-

- The key may be wildcarded using the '*' character... if so, - then those proxy members that match against the key will be - decorated with the attendant list of - s. This naturally implies that using - the '*' character as a key will result in the attendant list - of s being applied to every member of - the proxied class. -

-
- -

- The following code snippets show examples of how to decorate the - members of a proxied class with one or more - s. -

- - // get a concrete implementation of an IProxyTypeBuilder... - IProxyTypeBuilder builder = ... ; - builder.TargetType = typeof( ... ); - - IDictionary memAtts = new Hashtable(); - builder.MemberAttributes = memAtts; - - // applies a single Attribute to all members of the proxied class... - memAtts ["*"] = new Attribute[] { new MyCustomAttribute() }); - - // applies a number of Attributes to all members of the proxied class... - memAtts ["*"] = new Attribute[] - { - new MyCustomAttribute(), - new AnotherAttribute(), - }); - - // applies a single Attribute to those members of the proxied class - // that have identifiers starting with 'Do' ... - memAtts ["Do*"] = new Attribute[] { new MyCustomAttribute() }); - - // applies a number of Attributes to those members of the proxied class - // that have identifiers starting with 'Do' ... - memAtts ["Do*"] = new Attribute[] - { - new MyCustomAttribute(), - new AnotherAttribute(), - }); - -
-
- - - Describes the operations that generates IL instructions - used to build the proxy type. - - Bruno Baia - - - - Generates the IL instructions that pushes - the proxy instance on stack. - - The IL generator to use. - - - - Generates the IL instructions that pushes - the target instance on which calls should be delegated to. - - The IL generator to use. - - - - The shared instance for this class (and derived classes). - - - - - Creates the proxy type. - - The generated proxy class. - - - - Generates the IL instructions that pushes - the proxy instance on stack. - - The IL generator to use. - - - - Generates the IL instructions that pushes - the target instance on which calls should be delegated to. - - The IL generator to use. - - - - Creates an appropriate type builder. - - The name to use for the proxy type name. - The type to extends if provided. - The type builder to use. - - - - Applies attributes to the proxy class. - - The type builder to use. - The proxied class. - - - - - - Applies attributes to the proxied method. - - The method builder to use. - The proxied method. - - - - - - Applies attributes to the proxied method's return type. - - The method builder to use. - The proxied method. - - - - - Applies attributes to proxied method's parameters. - - The method builder to use. - The proxied method. - - - - - Calculates and returns the list of attributes that apply to the - specified type. - - The type to find attributes for. - - A list of custom attributes that should be applied to type. - - - - - - - Calculates and returns the list of attributes that apply to the - specified method. - - The method to find attributes for. - - A list of custom attributes that should be applied to method. - - - - - - - Calculates and returns the list of attributes that apply to the - specified method's return type. - - The method to find attributes for. - - A list of custom attributes that should be applied to method's return type. - - - - - - Calculates and returns the list of attributes that apply to the - specified method's parameters. - - The method to find attributes for. - The method's parameter to find attributes for. - - A list of custom attributes that should be applied to the specified method's parameter. - - - - - - Check that the specified object is matching the passed attribute type. - - -

- The specified object can be of different type : -

- - - - - - System.Reflection.CustomAttributeData (Only with .NET 2.0) - - - - - -
- The object instance to check. - The attribute type to test against. - - if the object instance matches the attribute type; - otherwise . - -
- - - Defines the types of the parameters for the specified constructor. - - The constructor to use. - The types for constructor's parameters. - - - - Implements constructors for the proxy class. - - - The builder to use. - - - - - Generates the proxy constructor. - - The constructor builder to use. - The IL generator to use. - The constructor to use. - - - - Implements an interface. - - - Generates proxy methods that belongs to the interface - using the specified . - - The type builder to use. - - The implementation to use - - The interface to implement. - - The of the target object. - - - - - Implements an interface. - - - Generates proxy methods that belongs to the interface - using the specified . - - The type builder to use. - - The implementation to use - - The interface to implement. - - The of the target object. - - - if target virtual methods should not be proxied; - otherwise . - - - - - Gets the mapping of the interface to proxy - into the actual methods on the target type - that does not need to implement that interface. - - -

- If the target type does not implement the interface, - we return the interfaces methods as the target methods for many reasons : -

    -
  • - The target object can change for an object that implements the interface. - (See 'Spring.Aop.Framework.DynamicProxy.IAdvisedProxyMethodBuilder' - implementation in the Spring AOP framework for an example) -
  • -
  • - Allow Transparent proxies to be proxied. - (See Spring Remoting framework for an example) -
  • -
  • - Allow null target to be proxied. - (See Spring AOP framework which avoid calls to the target object - by intercepting all methods. Think "dynamic mock") - (See 'Spring.Web.Services.WebServiceProxyFactory' implementation for another example) -
  • -
-

-
- - The of the target object. - - The interface to implement. - - An interface mapping for the interface to proxy. - -
- - - Inherit from a type. - - - Generates proxy methods for base virtual methods - using the specified . - - - The builder to use for code generation. - - - The implementation to use to override base virtual methods. - - The to inherit from. - - - - Inherit from a type. - - - Generates proxy methods for base virtual methods - using the specified . - - - The builder to use for code generation. - - - The implementation to use to override base virtual methods. - - The to inherit from. - - if only members declared at the level - of the supplied 's hierarchy should be proxied; - otherwise . - - - - - Implements the specified . - - The type builder to use. - The type the property is defined on. - The property to proxy. - The implemented methods map. - - - - Implements the specified event. - - The type builder to use. - The type the event is defined on. - The event to proxy. - The implemented methods map. - - - - Returns an array of s that represent - the proxiable interfaces. - - - An interface is proxiable if it's not marked with the - . - - - The array of interfaces from which - we want to get the proxiable interfaces. - - - An array containing the interface s. - - - - - Checks if specified interface is of a special type - that should never be proxied (i.e. ISerializable). - - Interface type to check. - - true if it is, false otherwise. - - - - - The name of the proxy . - - The name of the proxy . - - - - The of the target object. - - - - - The of the class that the proxy must - inherit from. - - -

- The default value of this property is the - . -

-
-
- - - Gets or sets the list of interfaces proxy should implement. - - - The default value of this property is all the interfaces - implemented or inherited by the target type. - - - - - Should we proxy target attributes? - - - - - - The list of custom s that the proxy - class must be decorated with. - - - - - - The custom s that the proxy - members must be decorated with. - - - - - - Implementation of IProxyMethodBuilder that delegates method calls to the base class. - - Bruno Baia - - - - Creates a new instance of the method builder. - - The type builder to use. - - The implementation to use. - - - if the interface is to be - implemented explicitly; otherwise . - - - - - Generates the proxy method. - - The IL generator to use. - The method to proxy. - - The interface definition of the method, if applicable. - - - - - Builds a proxy type using composition. - - - - In order for this builder to work, the target must implement - one or more interfaces. - - - Aleksandar Seovic - Bruno Baia - - - - Target instance calls should be delegated to. - - - - - Creates a new instance of the - class. - - - - - Creates a proxy that delegates calls to an instance of the - target object. - - -

- Only interfaces can be proxied using composition, so the target - must implement one or more interfaces. -

-
- The generated proxy class. - - If the - does not implement any interfaces. - -
- - - Generates the IL instructions that pushes - the target instance on which calls should be delegated to. - - The IL generator to use. - - - - Deaclares a field that holds the target object instance. - - - The builder to use for code generation. - - - - - Generates the proxy constructor. - - -

- This implementation creates instance of the target object for delegation - using constructor arguments. -

-
- The constructor builder to use. - The IL generator to use. - The constructor to delegate the creation to. -
- - - Gets or sets a value indicating whether interfaces should be implemented explicitly. - - - if they should be; otherwise, . - - - - - Allows easy access to existing and creation of new dynamic proxies. - - Aleksandar Seovic - Bruno Baia - - - - The name of the assembly that defines proxy types created. - - - - - The attributes of the proxy type to generate. - - - - - Creates an appropriate type builder. - - The proxy type name. - The type to extends if provided. - The type builder to use. - - - - Saves dynamically generated assembly to disk. - Can only be called in DEBUG_DYNAMIC mode, per ConditionalAttribute rules. - - - - - Builds a proxy type using inheritance. - - - - In order for this builder to work, target methods have to be either - , or belong to an interface. - - - Aleksandar Seovic - Bruno Baia - - - - Creates a new instance of the - class. - - - - - Creates a proxy that inherits the proxied object's class. - - -

- Only (non-final) methods can be proxied, - unless they are members of one of the interfaces that target class - implements. In that case, methods will be proxied using explicit - interface implementation, which means that client code will have - to cast the proxy to a specific interface in order to invoke the - methods. -

-
- The generated proxy class. -
- - - Generates the IL instructions that pushes - the target instance on which calls should be delegated to. - - The IL generator to use. - - - - Generates the proxy constructor. - - -

- This implementation delegates the call to a base class constructor. -

-
- The constructor builder to use. - The IL generator to use. - - The base class constructor to delegate the call to. - -
- - - Gets or sets a value indicating whether inherited members should be proxied. - - - if they should be; otherwise, . - - - - - This attribute can be used to mark interfaces that should not be proxied - - Bruno Baia - - - - Creates a new instance of the - class. - - - - - Implementation of IProxyMethodBuilder that delegates method calls to target object. - - Bruno Baia - - - - Creates a new instance of the method builder. - - The type builder to use. - - The implementation to use. - - - if the interface is to be - implemented explicitly; otherwise . - - - - - Generates the proxy method. - - The IL generator to use. - The method to proxy. - - The interface definition of the method, if applicable. - - - - - Base class for dynamic members. - - Aleksandar Seovic - - - - Method attributes constant. - - - - - Sets up target instance for invocation. - - IL generator to use. - Type of target instance. - - - - Sets up invocation argument. - - IL generator to use. - Argument type. - Argument position. - - - - Generates method invocation code. - - IL generator to use. - Flag specifying whether method is static. - Flag specifying whether method is on the value type. - Method to invoke. - - - - Generates code to process return value if necessary. - - IL generator to use. - Type of the return value. - - - - Generates code that throws . - - IL generator to use. - Error message to use. - - - - Defines constructors that dynamic constructor class has to implement. - - - - - Invokes dynamic constructor. - - - Constructor arguments. - - - A constructor value. - - - - - Safe wrapper for the dynamic constructor. - - - will attempt to use dynamic - constructor if possible, but it will fall back to standard - reflection if necessary. - - - - - Obtains cached constructor info or creates a new entry, if none is found. - - - - - Creates a new instance of the safe constructor wrapper. - - Constructor to wrap. - - - - Invokes dynamic constructor. - - - Constructor arguments. - - - A constructor value. - - - - - Factory class for dynamic constructors. - - Aleksandar Seovic - - - - Creates dynamic constructor instance for the specified . - - Constructor info to create dynamic constructor for. - Dynamic constructor for the specified . - - - - Defines methods that dynamic field class has to implement. - - - - - Gets the value of the dynamic field for the specified target object. - - - Target object to get field value from. - - - A field value. - - - - - Gets the value of the dynamic field for the specified target object. - - - Target object to set field value on. - - - A new field value. - - - - - Safe wrapper for the dynamic field. - - - will attempt to use dynamic - field if possible, but it will fall back to standard - reflection if necessary. - - - - - Obtains cached fieldInfo or creates a new entry, if none is found. - - - - - Creates a new instance of the safe field wrapper. - - Field to wrap. - - - - Gets the value of the dynamic field for the specified target object. - - - Target object to get field value from. - - - A field value. - - - - - Gets the value of the dynamic field for the specified target object. - - - Target object to set field value on. - - - A new field value. - - - - - Holds cached Getter/Setter delegates for a Field - - - - - Factory class for dynamic fields. - - Aleksandar Seovic - - - - Creates dynamic field instance for the specified . - - Field info to create dynamic field for. - Dynamic field for the specified . - - - - Defines methods that dynamic indexer class has to implement. - - - - - Gets the value of the dynamic indexer for the specified target object. - - - Target object to get the indexer value from. - - - Indexer argument. - - - A indexer value. - - - - - Gets the value of the dynamic indexer for the specified target object. - - - Target object to get the indexer value from. - - - Indexer argument. - - - A indexer value. - - - - - Gets the value of the dynamic indexer for the specified target object. - - - Target object to get the indexer value from. - - - Indexer arguments. - - - A indexer value. - - - - - Gets the value of the dynamic indexer for the specified target object. - - - Target object to set the indexer value on. - - - Indexer argument. - - - A new indexer value. - - - - - Gets the value of the dynamic indexer for the specified target object. - - - Target object to set the indexer value on. - - - Indexer argument. - - - A new indexer value. - - - - - Gets the value of the dynamic indexer for the specified target object. - - - Target object to set the indexer value on. - - - Indexer arguments. - - - A new indexer value. - - - - - Safe wrapper for the dynamic indexer. - - - will attempt to use dynamic - indexer if possible, but it will fall back to standard - reflection if necessary. - - - - - Creates a new instance of the safe indexer wrapper. - - Indexer to wrap. - - - - Gets the value of the dynamic indexer for the specified target object. - - - Target object to get indexer value from. - - - Indexer arguments. - - - A indexer value. - - - - - Gets the value of the dynamic indexer for the specified target object. - - - Target object to get the indexer value from. - - - Indexer argument. - - - A indexer value. - - - - - Gets the value of the dynamic indexer for the specified target object. - - - Target object to get indexer value from. - - - Indexer arguments. - - - A indexer value. - - - - - Sets the value of the dynamic indexer for the specified target object. - - - Target object to set indexer value on. - - - Indexer arguments. - - - A new indexer value. - - - - - Sets the value of the dynamic indexer for the specified target object. - - - Target object to set indexer value on. - - - Indexer arguments. - - - A new indexer value. - - - - - Sets the value of the dynamic indexer for the specified target object. - - - Target object to set indexer value on. - - - Indexer arguments. - - - A new indexer value. - - - - - Internal PropertyInfo accessor. - - - - - Factory class for dynamic indexers. - - Aleksandar Seovic - - - - Prevent instantiation - - - - - Creates dynamic indexer instance for the specified . - - Indexer info to create dynamic indexer for. - Dynamic indexer for the specified . - - - - Defines methods that dynamic method class has to implement. - - - - - Invokes dynamic method on the specified target object. - - - Target object to invoke method on. - - - Method arguments. - - - A method return value. - - - - - Safe wrapper for the dynamic method. - - - will attempt to use dynamic - method if possible, but it will fall back to standard - reflection if necessary. - - - - - Obtains cached property info or creates a new entry, if none is found. - - - - - Creates a new instance of the safe method wrapper. - - Method to wrap. - - - - Invokes dynamic method. - - - Target object to invoke method on. - - - Method arguments. - - - A method return value. - - - - - Gets the class, that declares this method - - - - - Factory class for dynamic methods. - - Aleksandar Seovic - - - - Creates dynamic method instance for the specified . - - Method info to create dynamic method for. - Dynamic method for the specified . - - - - Defines methods that dynamic property class has to implement. - - - - - Gets the value of the dynamic property for the specified target object. - - - Target object to get property value from. - - - A property value. - - - - - Gets the value of the dynamic property for the specified target object. - - - Target object to set property value on. - - - A new property value. - - - - - Gets the value of the dynamic property for the specified target object. - - - Target object to get property value from. - - Optional index values for indexed properties. This value should be null reference for non-indexed properties. - - A property value. - - - - - Gets the value of the dynamic property for the specified target object. - - - Target object to set property value on. - - - A new property value. - - Optional index values for indexed properties. This value should be null reference for non-indexed properties. - - - - Safe wrapper for the dynamic property. - - - will attempt to use dynamic - property if possible, but it will fall back to standard - reflection if necessary. - - - - - Obtains cached property info or creates a new entry, if none is found. - - - - - Creates a new instance of the safe property wrapper. - - Property to wrap. - - - - Gets the value of the dynamic property for the specified target object. - - - Target object to get property value from. - - - A property value. - - - - - Gets the value of the dynamic property for the specified target object. - - - Target object to get property value from. - - Optional index values for indexed properties. This value should be null reference for non-indexed properties. - - A property value. - - - - - Gets the value of the dynamic property for the specified target object. - - - Target object to set property value on. - - - A new property value. - - - - - Gets the value of the dynamic property for the specified target object. - - - Target object to set property value on. - - - A new property value. - - Optional index values for indexed properties. This value should be null reference for non-indexed properties. - - - - Internal PropertyInfo accessor. - - - - - Holds cached Getter/Setter delegates for a Property - - - - - Factory class for dynamic properties. - - Aleksandar Seovic - - - - Creates safe dynamic property instance for the specified . - - -

This factory method will create a dynamic property with a "safe" wrapper.

-

Safe wrapper will attempt to use generated dynamic property if possible, - but it will fall back to standard reflection if necessary.

-
- Property info to create dynamic property for. - Safe dynamic property for the specified . - -
- - - Creates dynamic property instance for the specified . - - Property info to create dynamic property for. - Dynamic property for the specified . - - - - Represents a Get method - - the target instance when calling an instance method - the value return by the Get method - - - - Represents a Set method - - the target instance when calling an instance method - the value to be set - - - - Represents an Indexer Get method - - the target instance when calling an instance method - - the value return by the Get method - - - - Represents a Set method - - the target instance when calling an instance method - the value to be set - - - - - Represents a method - - the target instance when calling an instance method - arguments to be passed to the method - the value return by the method. null when calling a void method - - - - Represents a constructor - - arguments to be passed to the method - the new object instance - - - - Represents a callback method used to create an from a instance. - - - - - Represents a callback method used to create an from a instance. - - - - - Represents a callback method used to create an from a instance. - - - - - Represents a callback method used to create an from a instance. - - - - - Represents a callback method used to create an from a instance. - - - - - Allows easy access to existing and creation of new dynamic relection members. - - Aleksandar Seovic - - - - The name of the assembly that defines reflection types created. - - - - - The attributes of the reflection type to generate. - - - - - Cache for dynamic property types. - - - - - Cache for dynamic field types. - - - - - Cache for dynamic indexer types. - - - - - Cache for dynamic method types. - - - - - Cache for dynamic constructor types. - - - - - Creates an appropriate type builder. - - - The base name to use for the reflection type name. - - The type builder to use. - - - - Returns dynamic property if one exists. - - Property to look up. - callback function that will be called to create the dynamic property - An for the given property info. - - - - Returns dynamic field if one exists. - - Field to look up. - callback function that will be called to create the dynamic field - An for the given field info. - - - - Returns dynamic indexer if one exists. - - Indexer to look up. - callback function that will be called to create the dynamic indexer - An for the given indexer. - - - - Returns dynamic method if one exists. - - Method to look up. - callback function that will be called to create the dynamic method - An for the given method. - - - - Returns dynamic constructor if one exists. - - Constructor to look up. - callback function that will be called to create the dynamic constructor - An for the given constructor. - - - - Saves dynamically generated assembly to disk. - Can only be called in DEBUG mode, per ConditionalAttribute rules. - - - - - Create a new Get method delegate for the specified field using - - the field to create the delegate for - a delegate that can be used to read the field - - - - Create a new Set method delegate for the specified field using - - the field to create the delegate for - a delegate that can be used to read the field. - - If the field's returns true, the returned method - will throw an when called. - - - - - Create a new Get method delegate for the specified property using - - the property to create the delegate for - a delegate that can be used to read the property. - - If the property's returns false, the returned method - will throw an when called. - - - - - Create a new Set method delegate for the specified property using - - the property to create the delegate for - a delegate that can be used to write the property. - - If the property's returns false, the returned method - will throw an when called. - - - - - Create a new method delegate for the specified method using - - the method to create the delegate for - a delegate that can be used to invoke the method. - - - - Creates a new delegate for the specified constructor. - - the constructor to create the delegate for - delegate that can be used to invoke the constructor. - - - - Delegates a Method(object target, params object[] args) call to the actual underlying method. - - - - - Generates code to process return value if necessary. - - IL generator to use. - Type of the return value. - - - - Converts to an instance of if necessary to - e.g. avoid e.g. double/int cast exceptions. - - - - This method mimics the behavior of the compiler that - automatically performs casts like int to double in "Math.Sqrt(4)".
- See about implicit, widening type conversions on MSDN - Type Conversion Tables -
- - Note: is expected to be a value type! - -
-
- - - Generates code that throws . - - IL generator to use. - Error message to use. - - - - Indicates that an annotated class is a "component". - Such classes are considered as candidates for future features such - as auto-detection when using attribute-based configuration and assembly scanning. - - Other class-level annotations may be considered as identifying - a component as well, typically a special kind of component: - e.g. the Repository attribute. - - Mark Fisher - Mark Pollack (.NET) - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The name of the component. - - - - Gets or sets the name of the component - - The name of the component. - - - - Indicates that an annotated class is a "Repository" (or "DAO"). - - - A class with this attribute is eligible for Spring DataAccessException translation. A class - with the Repository attribute is also clarified as to its role in the overall application - architecture for the purpose of tools, aspects, etc. - - This attribute also serves as a specialization of the ComponentAttribute, allowing implementation - classes to be autodetected in future releases through assembly scanning. - - - Rod Johnson - Jueren Hoeller - Mark Pollack (.NET) - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The name of the repository. - - - - Indicates that an annotated class is a "Service" (e.g. a business service facade). - - - - This attribute also serves as a specialization of the ComponentAttribute, allowing implementation - classes to be autodetected in future releases through assembly scanning. - - - Juergen Hoeller - Mark Pollack (.NET) - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The name. - - - - Implements by using . - - Erich Eichinger - - - - Specifies the contract a strategy must be implement to store and - retrieve data that is specific to the executing thread. - - - All implementations of this interface must treat keys case-sensitive. - - Erich Eichinger - - - - Retrieves an object with the specified . - - The name of the item. - - The object in the current thread's context associated with the - specified or null if no object has been stored previously - - - - - Stores a given object and associates it with the specified . - - The name with which to associate the new item. - The object to store in the current thread's context. - - - - Empties a data slot with the specified name. - - - If the object with the specified is not found, the method does nothing. - - The name of the object to remove. - - - - Retrieves an object with the specified name. - - The name of the item. - The object in the call context associated with the specified name or null if no object has been stored previously - - - - Stores a given object and associates it with the specified name. - - The name with which to associate the new item. - The object to store in the call context. - - - - Empties a data slot with the specified name. - - The name of the data slot to empty. - - - - Acquire/Release protocol, base of many concurrency utilities. - - - -

objects isolate waiting and notification for particular logical - states, resource availability, events, and the like that are shared - across multiple threads.

- -

Use of s sometimes (but by no means always) adds - flexibility and efficiency compared to the use of plain - .Net monitor methods and locking, and are sometimes (but by no means - always) simpler to program with.

- -

Used for implementation of a

-
- - Doug Lea - Federico Spinazzi (.Net) -
- - Wait (possibly forever) until successful passage. - Fail only upon interuption. Interruptions always result in - `clean' failures. On failure, you can be sure that it has not - been acquired, and that no - corresponding release should be performed. Conversely, - a normal return guarantees that the acquire was successful. - - - - - Potentially enable others to pass. -

- Because release does not raise exceptions, - it can be used in `finally' clauses without requiring extra - embedded try/catch blocks. But keep in mind that - as with any java method, implementations may - still throw unchecked exceptions such as Error or NullPointerException - when faced with uncontinuable errors. However, these should normally - only be caught by higher-level error handlers. -

-
-
- - - Wait at most msecs to pass; report whether passed. -

- The method has best-effort semantics: - The msecs bound cannot - be guaranteed to be a precise upper bound on wait time in Java. - Implementations generally can only attempt to return as soon as possible - after the specified bound. Also, timers in Java do not stop during garbage - collection, so timeouts can occur just because a GC intervened. - So, msecs arguments should be used in - a coarse-grained manner. Further, - implementations cannot always guarantee that this method - will return at all without blocking indefinitely when used in - unintended ways. For example, deadlocks may be encountered - when called in an unintended context. -

-
- the number of milleseconds to wait - An argument less than or equal to zero means not to wait at all. - However, this may still require - access to a synchronization lock, which can impose unbounded - delay if there is a lot of contention among threads. - - true if acquired -
- - A latch is a boolean condition that is set at most once, ever. - Once a single release is issued, all acquires will pass. -

- Sample usage. Here are a set of classes that use - a latch as a start signal for a group of worker threads that - are created and started beforehand, and then later enabled. -

- - class Worker implements IRunnable { - private readonly Latch startSignal; - Worker(Latch l) - { - startSignal = l; - } - - public void Run() { - startSignal.acquire(); - DoWork(); - } - - void DoWork() { ... } - } - - class Driver { // ... - void Main() { - Latch go = new Latch(); - for (int i = 0; i < N; ++i) // make threads - new Thread(new ThreadStart(new Worker(go)).Start(); - DoSomethingElse(); // don't let run yet - go.Release(); // let all threads proceed - } - } - -
- Doug Lea - Federico Spinazzi (.Net) -
- - - can acquire ? - - - - - Method mainly used by clients who are trying to get the latch - - - - Wait at most msecs millisconds for a permit - - - - Enable all current and future acquires to pass - - - - - An abstraction to safely store "ThreadStatic" data. - - - By default, is used to store thread-specific data. - You may switch the storage strategy by calling .

- NOTE: Access to the underlying storage is not synchronized for performance reasons. - You should call only once at application startup! - - Erich Eichinger - - -

- Holds the current strategy. - - - Access to this variable is not synchronized on purpose for performance reasons. - Setting a different strategy should happen only once - at application startup. - -
- - - Set the new strategy. - - - - - Retrieves an object with the specified name. - - The name of the item. - The object in the context associated with the specified name or null if no object has been stored previously - - - - Stores a given object and associates it with the specified name. - - The name with which to associate the new item. - The object to store in the current thread's context. - - - - Empties a data slot with the specified name. - - The name of the data slot to empty. - - - -

Base class for counting semaphores based on Semaphore implementation - from Doug Lea.

-
- - -

Conceptually, a semaphore - maintains a set of permits. Each acquire() blocks if - necessary until a permit is available, and then takes it.

- -

Each release adds a permit. However, no actual permit objects are used; - the Semaphore just keeps a count of the number available - and acts accordingly.

- -

A semaphore initialized to 1 can serve as a mutual exclusion lock.

- - Used for implementation of a -
- Doug Lea - Federico Spinazzi (.Net) -
- - - current number of available permits - - - - -

Create a Semaphore with the given initial number of permits.

-

Using a seed of 1 makes the semaphore act as a mutual - exclusion lock.

- -

Negative seeds are also allowed, - in which case no acquires will proceed until the number of - releases has pushed the number of permits past 0.

-
-
- - - Release a permit - - - - - Acquire a permit - - - - - Wait at most msecs millisconds for a permit - - number of ms to wait - true if aquired - - - Release N permits. release(n) is - equivalent in effect to: -
-            for (int i = 0; i < n; ++i) release();
-            
- But may be more efficient in some semaphore implementations. -
- if n is negative. - - -
- - Return the current number of available permits. - Returns an accurate, but possibly unstable value, - that may change immediately after returning. - - - - - Utility class to use an with the - C# using () {} idiom - - - - - Creates a new trying to the given - - - the to be held - - - - Creates a new trying to the given - - - the to be held - millisecond to try to acquire the lock - - - - Releases the held - - - - - initializes and acquire access to the - - - - - - Implements by using a hashtable. - - Erich Eichinger - - - - Retrieves an object with the specified name. - - The name of the item. - The object in the call context associated with the specified name or null if no object has been stored previously - - - - Stores a given object and associates it with the specified name. - - The name with which to associate the new item. - The object to store in the call context. - - - - Empties a data slot with the specified name. - - The name of the data slot to empty. - - - Thrown by synchronization classes that report - timeouts via exceptions. The exception is treated - as a form (subclass) of InterruptedException. This both - simplifies handling, and conceptually reflects the fact that - timed-out operations are artificially interrupted by timers. - - - - - The approximate time that the operation lasted before - this timeout exception was thrown. - - - - - - Creates a new instance of the - class. - - - - - Creates a new instance of the - class with the - specified message. - - - A message about the exception. - - - - - Creates a new instance of the - class with the - specified message. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the - class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Override of GetObjectData to allow for private serialization - - serialization info - streaming context - - - Constructs a TimeoutException with given duration value. - - - - - Constructs a TimeoutException with the - specified duration value and detail message. - - - - - Gets the approximate time that the operation lasted before - this timeout exception was thrown. - - - - A TimeoutSync is an adaptor class that transforms all - calls to acquire to instead invoke attempt with a predetermined - timeout value. - - - - - - the adapted sync - - - - - timeout value - - - - Create a TimeoutSync using the given Sync object, and - using the given timeout value for all calls to acquire. - - - - - Try to acquire the sync before the timeout - - In case a time out occurred - - - - - - - - - - - - - - Support to account for differences between java nad .NET: -
    -
-
-
- - - .NET threads have not a method to check if they have been interrupted. - Moreover, differently from java threads, when entering locked - blocks, Monitor, Sleep, SpinWait and so on, a - will be raised by the runtime. -

Spring.Threading classes usually call this method before entering a lock block, to mirror java code -

Usually this is non issue because the same exception will be raised entering the monitor - associated with the lock () -

-
- if the thread has been interrupted -
- - - Normalize the given so that - is is comparable with . - - Date. - - - - - - - - - the difference between millisecodns of the first and second date - - - - Returns the number of nanoseconds for the current value of - - Current number of nanoseconds - - - - Returns the number of nano seconds represented by the - - to use - Number of nano seconds for - - - - Returns a representing the number of nanoseconds passed in via . - - Number of nanoseconds. - representing the number of nanoseconds passed in. - - - - Placeholder for java.lang.System.currentTimeMillis - - The current machine time in milliseconds - - - - Has been interrupted this thread - - - - - Miscellaneous generic collection utility methods. - - - Mainly for internal use within the framework. - - Mark Pollack (.NET) - - - - Determine whether a given collection only contains - a single unique object - - - - - - - Determines whether the contains the specified . - - The collection to check. - The object to locate in the collection. - if the element is in the collection, otherwise. - - - - Determines whether the collection contains all the elements in the specified collection. - - The collection to check. - Collection whose elements would be checked for containment. - true if the target collection contains all the elements of the specified collection. - - - - Various utility methods relating to the manipulation of arrays. - - Aleksandar Seovic - - - - Checks if the given array or collection has elements and none of the elements is null. - - the collection to be checked. - true if the collection has a length and contains only non-null elements. - - - - Checks if the given array or collection is null or has no elements. - - - - - - - Tests equality of two single-dimensional arrays by checking each element - for equality. - - The first array to be checked. - The second array to be checked. - True if arrays are the same, false otherwise. - - - - Returns hash code for an array that is generated based on the elements. - - - Hash code returned by this method is guaranteed to be the same for - arrays with equal elements. - - - Array to calculate hash code for. - - - A hash code for the specified array. - - - - - Returns string representation of an array. - - - Array to return as a string. - - - String representation of the specified . - - - - - Assertion utility methods that simplify things such as argument checks. - - -

- Not intended to be used directly by applications. -

-
- Aleksandar Seovic -
- - - Checks the value of the supplied and throws an - if it is . - - The object to check. - The argument name. - - If the supplied is . - - - - - Checks the value of the supplied and throws an - if it is . - - The object to check. - The argument name. - - An arbitrary message that will be passed to any thrown - . - - - If the supplied is . - - - - - Checks the value of the supplied string and throws an - if it is or - contains only whitespace character(s). - - The string to check. - The argument name. - - If the supplied is or - contains only whitespace character(s). - - - - - Checks the value of the supplied string and throws an - if it is or - contains only whitespace character(s). - - The string to check. - The argument name. - - An arbitrary message that will be passed to any thrown - . - - - If the supplied is or - contains only whitespace character(s). - - - - - Checks the value of the supplied and throws - an if it is or contains no elements. - - The array or collection to check. - The argument name. - - If the supplied is or - contains no elements. - - - - - Checks the value of the supplied and throws - an if it is or contains no elements. - - The array or collection to check. - The argument name. - An arbitrary message that will be passed to any thrown . - - If the supplied is or - contains no elements. - - - - - Checks the value of the supplied and throws - an if it is , contains no elements or only null elements. - - The array or collection to check. - The argument name. - - If the supplied is , - contains no elements or only null elements. - - - - - Checks whether the specified can be cast - into the . - - - The argument to check. - - - The name of the argument to check. - - - The required type for the argument. - - - An arbitrary message that will be passed to any thrown - . - - - - - Assert a boolean expression, throwing ArgumentException - if the test result is false. - - a boolean expression. - The exception message to use if the assertion fails. - - if expression is false - - - - - Assert a boolean expression, throwing ArgumentException - if the test result is false. - - a boolean expression. - - if expression is false - - - - - Assert a bool expression, throwing InvalidOperationException - if the expression is false. - - a boolean expression. - The exception message to use if the assertion fails - if expression is false - - - - Creates a new instance of the class. - - -

- This is a utility class, and as such exposes no public constructors. -

-
-
- - - General utility methods for working with annotations - - - - - Find a single Attribute of the type 'attributeType' from the supplied class, - traversing it interfaces and super classes if no attribute can be found on the - class iteslf. - - - This method explicitly handles class-level attributes which are not declared as - inherited as well as attributes on interfaces. - - The class to look for attributes on . - Type of the attribibute to look for. - the attribute of the given type found, or null - - - - Miscellaneous collection utility methods. - - - Mainly for internal use within the framework. - - Mark Pollack (.NET) - - - - Determine whether a given collection only contains - a single unique object - - - - - - - Determines whether the contains the specified . - - The collection to check. - The object to locate in the collection. - if the element is in the collection, otherwise. - - - - Adds the specified to the specified . - - The collection to add the element to. - The object to add to the collection. - - - - Determines whether the collection contains all the elements in the specified collection. - - The collection to check. - Collection whose elements would be checked for containment. - true if the target collection contains all the elements of the specified collection. - - - - Removes all the elements from the target collection that are contained in the source collection. - - Collection where the elements will be removed. - Elements to remove from the target collection. - - - - Converts an instance to an instance. - - The instance to be converted. - An instance in which its elements are the elements of the instance. - if the is null. - - - - Copies the elements of the to a - new array of the specified element type. - - The instance to be converted. - The element of the destination array to create and copy elements to - An array of the specified element type containing copies of the elements of the . - - - - Finds a value of the given type in the given collection. - - The collection to search. - The type to look for. - a value of the given type found, or null if none. - If more than one value of the given type is found - - - - Find a value of one of the given types in the given Collection, - searching the Collection for a value of the first type, then - searching for a value of the second type, etc. - - The collection to search. - The types to look for, in prioritized order. - a value of the given types found, or null if none - If more than one value of the given type is found - - - - Determines whether the specified collection is null or empty. - - The collection to check. - - true if the specified collection is empty or null; otherwise, false. - - - - - Determines whether the specified dictionary is null empty. - - The dictionary to check. - - true if the specified dictionary is empty or null; otherwise, false. - - - - - Utility class containing helper methods for object comparison. - - Aleksandar Seovic - - - Compares two objects. - First object. - Second object. - - 0, if objects are equal; - less than zero, if the first object is smaller than the second one; - greater than zero, if the first object is greater than the second one. - - - - Utility class for .NET configuration files management. - - Aleksandar Seovic - - - - Parses the configuration section. - - -

- Primary purpose of this method is to allow us to parse and - load configuration sections using the same API regardless - of the .NET framework version. -

-

- If Microsoft paid a bit more attention to preserving backwards - compatibility we would not even need it, but... :( -

-
- Name of the configuration section. - Object created by a corresponding . -
- - - Refresh the configuration section. - - -

- Primary purpose of this method is to allow us to parse and - load configuration sections using the same API regardless - of the .NET framework version. -

-

- If Microsoft paid a bit more attention to preserving backwards - compatibility we would not even need it, but... :( -

-
- Name of the configuration section. -
- - - Creates the configuration exception. - - The message to display to the client when the exception is thrown. - The inner exception. - Name of the configuration file. - The line where exception occured. - Configuration exception. - - - - Creates the configuration exception. - - The message to display to the client when the exception is thrown. - Name of the configuration file. - The line where exception occured. - Configuration exception. - - - - Creates the configuration exception. - - The message to display to the client when the exception is thrown. - The inner exception. - XML node where exception occured. - Configuration exception. - - - - Creates the configuration exception. - - The message to display to the client when the exception is thrown. - XML node where exception occured. - Configuration exception. - - - - Creates the configuration exception. - - The message to display to the client when the exception is thrown. - The inner exception. - Configuration exception. - - - - Creates the configuration exception. - - The message to display to the client when the exception is thrown. - Configuration exception. - - - - Creates the configuration exception. - - Configuration exception. - - - - Determines whether the specified exception is configuration exception. - - The exception to check. - - true if the specified exception is configuration exception; otherwise, false. - - - - - Returns the line number of the specified node. - - Node to get the line number for. - The line number of the specified node. - - - - Returns the name of the file specified node is defined in. - - Node to get the file name for. - The name of the file specified node is defined in. - - - - An holding information about its original text source location. - - Erich Eichinger - - - - Holds text position information for e.g. error reporting purposes. - - - - - - - Gets a string specifying the file/resource name related to the configuration details. - - - - - Gets an integer specifying the line number related to the configuration details. - - - - - Gets an integer specifying the line position related to the configuration details. - - - - - Creates a new instance of , storing a copy of the passed - . - - - - - Creates a duplicate of this node. - - true to recursively clone the subtree under the specified node; false to clone only the node itself - - - - The name of the resource this element was read from - - - - - The line number within the resource this element was read from - - - - - The line position within the resource this element was read from. - - - - - An implementation, who's elements retain information - about their location in the original XML text document the were read from. - - - When loading a document, the used must implement . - Typical XmlReader implementations like support this interface. - - Erich Eichinger - - - - Overridden to create a retaining the current - text position information. - - - - - Overridden to create a retaining the current - text position information. - - - - - Load the document from the given . - Child nodes will store as their property. - - the name of the resource - The XML source - - - - Load the document from the given . - Child nodes will store as their property. - - the name of the resource - The XML source - - - - Load the document from the given . - Child nodes will store as their property. - - the name of the resource - The XML source - - - - Load the document from the given . - Child nodes will store as their property. - - the name of the resource - The XML source - - - - Load the document from the given . - Child nodes will store null as their property. - - The XML source - - - - Creates an object based on the information in the . The reader must be positioned on a node or attribute. - Child nodes will store as their property. - - - The new XmlNode or null if no more nodes exist. - - the name of the resource - The XML source - The reader is positioned on a node type that does not translate to a valid DOM node (for example, EndElement or EndEntity). - - - - Creates an object based on the information in the . The reader must be positioned on a node or attribute. - Child nodes will store null as their property. - - - The new XmlNode or null if no more nodes exist. - - The XML source - The reader is positioned on a node type that does not translate to a valid DOM node (for example, EndElement or EndEntity). - - - - Get info about the current text position during loading a document. - Outside loading a document, the properties of - will always be null. - - - - - Holds the current text position during loading a document - - - - - An holding information about its original text source location. - - Erich Eichinger - - - - Creates a new instance of , storing a copy of the passed - . - - - - - Creates a duplicate of this node. - - true to recursively clone the subtree under the specified node; false to clone only the node itself - - - - The name of the resource this element was read from - - - - - The line number within the resource this element was read from - - - - - The line position within the resource this element was read from. - - - - - Discovers the attributes of a - and provides access to the - s metadata. - - Rick Evans - - - - The method name associated with a delegate invocation. - - - - - Creates a new instance of the - class. - - - The event used to extract the delegate - from. - - - if the supplied is - . - - - - - Creates a new instance of the - class. - - - The delegate . - - - If the supplied is not a subclass of the - class, or is . - - - - - Checks to see if the method encapsulated by the supplied method - metadata is compatible with the method signature associated with - this delegate type. - - The method to be checked. - - if the method signature is compatible with - the signature of this delegate; if not, or - if the supplied parameter is - . - - - - - Gets the s of the parameters of the - method signature associated with this delegate type. - - -

- This method will never return ; the returned - array may be empty, but it most certainly - will not be . -

-
- - A array of the parameter - s; or the - array if the method signature has no parameters. - -
- - - Gets the return of the - method signature associated with this delegate type. - - The return . - - - - Gets the metadata about the method signature associated - with this delegate type. - - - The metadata about the method signature associated - with this delegate type. - - - - - Determines whether the supplied - is a type. - - - The to be checked. - - - if the supplied - is a ; - if not or the supplied - is . - - - - - Checks if the signature of the supplied - is compatible with the signature expected by the supplied - . - - The event to be checked against. - - The method signature to check for compatibility. - - - if the signature of the supplied - is compatible with the signature - expected by the supplied ; - if not or either of the supplied - parameters is . - - - - - - The of the delegate. - - - - - Use this class for obtaining instances for dynamic code generation. - - -

- The purpose of this class is to provide a simple abstraction for creating and managing dynamic assemblies. -

- - Using this factory you can't define several modules within a single dynamic assembly - only a simple one2one relation between assembly/module is used. - -
- -

The following excerpt from demonstrates usage:

- - public class DynamicProxyManager - { - public const string PROXY_ASSEMBLY_NAME = "Spring.Proxy"; - - public static TypeBuilder CreateTypeBuilder(string name, Type baseType) - { - // Generates type name - string typeName = String.Format("{0}.{1}_{2}", PROXY_ASSEMBLY_NAME, name, Guid.NewGuid().ToString("N")); - ModuleBuilder module = DynamicCodeManager.GetModuleBuilder(PROXY_ASSEMBLY_NAME); - return module.DefineType(typeName, PROXY_TYPE_ATTRIBUTES); - } - } - -
- Erich Eichinger - - - -
- - - prevent instantiation - - - - - Returns the for the dynamic module within the specified assembly. - - - If the assembly does not exist yet, it will be created.
- This factory caches any dynamic assembly it creates - calling GetModule() twice with - the same name will *not* create 2 distinct modules! -
- The assembly-name of the module to be returned - the that can be used to define new types within the specified assembly -
- - - Persists the specified dynamic assembly to the file-system - - the name of the dynamic assembly to persist - - Can only be called in DEBUG_DYNAMIC mode, per ConditionalAttribute rules. - - - - - Removes all registered s. - - - - - A utility class for raising events in a generic and consistent fashion. - - Rick Evans - - - - Raises the event encapsulated by the supplied - , passing the supplied - to the event. - - The event to be raised. - The arguments to the event. - - - - Invokes the supplied , passing the supplied - to the sink. - - The sink to be invoked. - The arguments to the sink. - - - - Raises events defensively. - - -

- Raising events defensively means that as the raised event is passed to each handler, - any thrown by a handler will be caught and silently - ignored. -

-
- Rick Evans -
- - - Defensively invokes the supplied , passing the - supplied to the sink. - - The sink to be invoked. - The arguments to the sink. - - - - Utility methods for IO handling - - - - - Copies one stream into another. - (Don't forget to call on the destination stream!) - - - Does not close the input stream! - - - - - Reads a stream into a byte array. - - - Does not close the input stream! - - - - - Various utility methods relating to numbers. - - -

- Mainly for internal use within the framework. -

-
- Aleksandar Seovic -
- - - Determines whether the supplied is an integer. - - The object to check. - - if the supplied is an integer. - - - - - Determines whether the supplied is a decimal number. - - The object to check. - - if the supplied is a decimal number. - - - - - Determines whether the supplied is of numeric type. - - The object to check. - - true if the specified object is of numeric type; otherwise, false. - - - - - Determines whether the supplied can be converted to an integer. - - The object to check. - - if the supplied can be converted to an integer. - - - - - Determines whether the supplied can be converted to an integer. - - The object to check. - - if the supplied can be converted to an integer. - - - - - Determines whether the supplied can be converted to a number. - - The object to check. - - true if the specified object is decimal number; otherwise, false. - - - - - Is the supplied equal to zero (0)? - - The number to check. - - id the supplied is equal to zero (0). - - - - - Negates the supplied . - - The number to negate. - The supplied negated. - - If the supplied is not a supported numeric type. - - - - - Adds the specified numbers. - - The first number. - The second number. - - - - Subtracts the specified numbers. - - The first number. - The second number. - - - - Multiplies the specified numbers. - - The first number. - The second number. - - - - Divides the specified numbers. - - The first number. - The second number. - - - - Calculates remainder for the specified numbers. - - The first number (dividend). - The second number (divisor). - - - - Raises first number to the power of the second one. - - The first number. - The second number. - - - - Coerces the types so they can be compared. - - The right. - The left. - - - - Creates a new instance of the class. - - -

- This is a utility class, and as such exposes no public constructors. -

-
-
- - - Helper methods with regard to objects, types, properties, etc. - - -

- Not intended to be used directly by applications. -

-
- Rod Johnson - Juergen Hoeller - Rick Evans (.NET) -
- - - The instance for this class. - - - - - An empty object array. - - - - - Creates a new instance of the class. - - -

- This is a utility class, and as such exposes no public constructors. -

-
-
- - - Instantiates the type using the assembly specified to load the type. - - This is a convenience in the case of needing to instantiate a type but not - wanting to specify in the string the version, culture and public key token. - The assembly. - Name of the type. - - - If the or is - - - If cannot load the type from the assembly or the call to InstantiateType(Type) fails. - - - - - Convenience method to instantiate a using - its no-arg constructor. - - -

- As this method doesn't try to instantiate s - by name, it should avoid loading issues. -

-
- - The to instantiate* - - A new instance of the . - - If the is - - - If the is an abstract class, an interface, - an open generic type or does not have a public no-argument constructor. - -
- - - Gets the zero arg ConstructorInfo object, if the type offers such functionality. - - The type. - Zero argument ConstructorInfo - - If the type is an interface, abstract, open generic type, or does not have a zero-arg constructor. - - - - - Determines whether the specified type is instantiable, i.e. not an interface, abstract class or contains - open generic type parameters. - - The type. - - - - Convenience method to instantiate a using - the given constructor. - - -

- As this method doesn't try to instantiate s - by name, it should avoid loading issues. -

-
- - The constructor to use for the instantiation. - - - The arguments to be passed to the constructor. - - A new instance. - - If the is - - - If the 's declaring type is an abstract class, - an interface, an open generic type or does not have a public no-argument constructor. - -
- - - Checks whether the supplied is not a transparent proxy and is - assignable to the supplied . - - -

- Neccessary when dealing with server-activated remote objects, because the - object is of the type TransparentProxy and regular is testing for assignable - types does not work. -

-

- Transparent proxy instances always return when tested - with the 'is' operator (C#). This method only checks if the object - is assignable to the type if it is not a transparent proxy. -

-
- The target to be checked. - The value that should be assigned to the type. - - if the supplied is not a - transparent proxy and is assignable to the supplied . - -
- - - Determine if the given is assignable from the - given value, assuming setting by reflection. - - -

- Considers primitive wrapper classes as assignable to the - corresponding primitive types. -

-

- For example used in an object factory's constructor resolution. -

-
- The target . - The value that should be assigned to the type. - True if the type is assignable from the value. -
- - - Check if the given represents a - "simple" property, - i.e. a primitive, a , a - , or a corresponding array. - - -

- Used to determine properties to check for a "simple" dependency-check. -

-
- - The to check. - -
- - - Check if the given class represents a primitive array, - i.e. boolean, byte, char, short, int, long, float, or double. - - - - - Determines whether the specified array is null or empty. - - The array to check. - - true if the specified array is null empty; otherwise, false. - - - - - Determine if the given objects are equal, returning - if both are respectively - if only one is . - - The first object to compare. - The second object to compare. - - if the given objects are equal. - - - - - Returns the first element in the supplied . - - - The to use to enumerate - elements. - - - The first element in the supplied . - - - If the supplied did not have any elements. - - - - - Returns the first element in the supplied . - - - The to use to enumerate - elements. - - - The first element in the supplied . - - - If the supplied did not have any elements. - - - If the supplied is . - - - - - Returns the element at the specified index using the supplied - . - - - The to use to enumerate - elements until the supplied is reached. - - - The index of the element in the enumeration to return. - - - The element at the specified index using the supplied - . - - - If the supplied was less than zero, or the - supplied did not contain enough elements - to be able to reach the supplied . - - - - - Returns the element at the specified index using the supplied - . - - - The to use to enumerate - elements until the supplied is reached. - - - The index of the element in the enumeration to return. - - - The element at the specified index using the supplied - . - - - If the supplied was less than zero, or the - supplied did not contain enough elements - to be able to reach the supplied . - - - If the supplied is . - - - - - Gets the qualified name of the given method, consisting of - fully qualified interface/class name + "." method name. - - The method. - qualified name of the method. - - - - Return a String representation of an object's overall identity. - - The object (may be null). - The object's identity as String representation, - or an empty String if the object was null - - - - - Gets a hex String form of an object's identity hash code. - - The obj. - The object's identity code in hex notation - - - - Support matching of file system paths in a manner similar to that of the - NAnt FileSet. - - -

- Any (back)slashes are converted to forward slashes. -

-
- - - // true - PathMatcher.Match("c:/*.bat", @"c:\autoexec.bat"); - PathMatcher.Match("c:\fo*\*.bat", @"c:/foobar/autoexec.bat"); - PathMatcher.Match("c:\fo?\*.bat", @"c:/foo/autoexec.bat"); - // false - PathMatcher.Match("c:\fo?\*.bat", @"c:/fo/autoexec.bat"); - - - Federico Spinazzi -
- - - Determines if a given path matches a NAnt-like pattern. - - - A forward or back-slashed fileset-like pattern. - - A forward or back-slashed full path. - should the match consider the case - - if the path is matched by the pattern; - otherwise . - - - - - Determines if a given path matches a NAnt-like pattern. - - - A forward or back-slashed fileset-like pattern. - - A forward or back-slashed full path. - - if the path is matched by the pattern; - otherwise . - - - - - Replaces back(slashes) with forward slashes. - - - The path or the pattern to modify. - - A forward-slashed string. - - - - Helper method to convert a NAnt-like pattern into the - appropriate pattern for a regular expression. - - The NAnt-like pattern. - A regex-compatible pattern. - - - - Creates a new instance of the class. - - -

- This is a utility class, and as such exposes no public constructors. -

-
-
- - Utility methods for simple pattern matching, in particular for - Spring's typical "xxx*", "*xxx" and "*xxx*" pattern styles. - - Juergen Hoeller - Mark Pollack - - - Match a String against the given pattern, supporting the following simple - pattern styles: "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. - - the pattern to match against - - the String to match - - whether the String matches the given pattern - - - - Match a String against the given patterns, supporting the following simple - pattern styles: "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. - - the patterns to match against - - the String to match - - whether the String matches any of the given patterns - - - - - Convenience method that may be used by derived classes. Iterates over the list of to match against. - - the object's type. Must not be null. - the name of the object Must not be null. - the list of patterns, that shall be matched against. Must not be null. - - the used for - matching against each pattern in . Must not be null. - - the prefix to be used for dereferencing factory object names. - - If is null, will always return true, otherwise - if matches any of the patterns specified in . - - - - - Signature of callbacks that may be used for matching object names. - - the object name to check. - the pattern to match against. - true, if the matches - - - - - An implementation of the Java Properties class. - - Simon White - - - - Creates an empty property list with no default values. - - - - - Creates a property list with the specified initial properties. - - The initial properties. - - - - Reads a property list (key and element pairs) from the input stream. - - The stream to load from. - - - - Reads a property list (key and element pairs) from a text reader. - - The text reader to load from. - - - - Reads a property list (key and element pairs) from the input stream. - - the dictionary to put it in - The stream to load from. - - - - Reads a property list (key and element pairs) from a text reader. - - the dictionary to put it in - The text reader to load from. - - - - Strips whitespace from the front of the specified string. - - The string. - The string with all leading whitespace removed. - - - - Splits the specified string into a key / value pair. - - The line to split. - An array containing the key / value pair. - - - - Searches for the property with the specified key in this property list. - - The key. - The property, or null if the key was not found. - - - - Searches for the property with the specified key in this property list. - - The key. - - The default value to be returned if the key is not found. - - The property, or the default value. - - - - Writes this property list out to the specified stream. - - The stream to write to. - - - - Sets the specified property key / value pair. - - The key. - The value. - - - - Writes the properties in this instance out to the supplied stream. - - The stream to write to. - Arbitrary header information. - - - - Removes the key / value pair identified by the supplied key. - - - The key identifying the key / value pair to be removed. - - - - - Adds the specified key / object pair to this collection. - - The key. - The value. - - - - Adds the specified key / object pair to this collection. - - - - - Various reflection related methods that are missing from the standard library. - - Rod Johnson - Juergen Hoeller - Aleksandar Seovic (.NET) - Stan Dvoychenko (.NET) - Bruno Baia (.NET) - - - - Convenience value that will - match all private and public, static and instance members on a class - in a case inSenSItivE fashion. - - - - - Returns signature for the specified , method name and argument - s. - - The the method is in. - The method name. - - The argument s. - - The method signature. - - - - Returns method for the specified , method - name and argument - s. - - Searches with BindingFlags - - The target to find the method on. - - The method to find. - - The argument s. May be - if the method has no arguments. - - The target method. - - - - Returns an array of parameter s for the specified method - or constructor. - - The method (or constructor). - An array containing the parameter s. - - If is . - - - - - Returns an array of parameter s for the - specified parameter info array. - - The parameter info array. - An array containing parameter s. - - If is or any of the - elements is . - - - - - Returns an array of s that represent - the names of the generic type parameter. - - The method. - An array containing the parameter names. - - If is . - - - - - Returns an array of s that represent - the names of the generic type parameter. - - The parameter info array. - An array containing parameter names. - - If is or any of the - elements is . - - - - - From a given list of methods, selects the method having an exact match on the given ' types. - - the list of methods to choose from - the arguments to the method - the method matching exactly the passed ' types - - If more than 1 matching methods are found in the list. - - - - - From a given list of methods, selects the method having an exact match on the given ' types. - - the type of method (used for exception reporting only) - the list of methods to choose from - the arguments to the method - the method matching exactly the passed ' types - - If more than 1 matching methods are found in the list. - - - - - From a given list of constructors, selects the constructor having an exact match on the given ' types. - - the list of constructors to choose from - the arguments to the method - the constructor matching exactly the passed ' types - - If more than 1 matching methods are found in the list. - - - - - Packages arguments into argument list containing parameter array as a last argument. - - Argument vaklues to package. - Total number of oarameters. - Type of the param array element. - Packaged arguments. - - - - Convenience method to convert an interface - to a array that contains - all the interfaces inherited and the specified interface. - - The interface to convert. - An array of interface s. - - If the specified is not an interface. - - - If is . - - - - - Is the supplied the default indexer for the - supplied ? - - - The name of the property on the supplied to be checked. - - - The to be checked. - - - if the supplied is the - default indexer for the supplied . - - - If the supplied is . - - - - - Is the supplied declared on one of these interfaces? - - The method to check. - The array of interfaces we want to check. - - if the method is declared on one of these interfaces. - - - If any of the s specified is not an interface. - - - If or any of the specified interfaces is - . - - - - - Returns the default value for the specified - - -

- Follows the standard .NET conventions for default values where - relevant; for example, all numeric types default to the value - 0. -

-
- - The to return default value for. - - - The default value for the specified . - - - If the supplied is an enumerated type that - has no values. - -
- - - Returns an array consisting of the default values for the supplied - . - - - The array of s to return default values for. - - - An array consisting of the default values for the supplied - . - - - If any of the elements in the supplied - array is an enumerated type that has no values. - - - - - - Checks that the parameter s of the - supplied match the parameter - s of the supplied - . - - The method to be checked. - - The array of parameter s to check against. - - - if the parameter s - match. - - - - - Returns an array containing the s of the - objects in the supplied array. - - - The objects array for which the corresponding s - are needed. - - - An array containing the s of the objects - in the supplied array; this array will be empty (but not - if the supplied - is null or has no elements. - - -

- [C#]
- Given an array containing the following objects, - [83, "Foo", new object ()], the - array returned from this method call would consist of the following - elements... - [Int32, String, Object]. -

-
-
- - - Does the given and/or it's superclasses - have at least one or more methods with the given name (with any - argument types)? - - -

- Includes non-public methods in the methods searched. -

-
- - The to be checked. - - - The name of the method to be searched for. Case inSenSItivE. - - - if the given or / and it's - superclasses have at least one or more methods (with any argument types); - if not, or either of the parameters is . - -
- - - Within , counts the number of overloads for the method with the given (case-insensitive!) - - The type to be searched - the name of the method for which overloads shall be counted - The number of overloads for method within type - - - - Creates a . - - -

- Note that if a non- - is supplied, any read write properties exposed by the - will be used to overwrite values that may have been passed in via the - . That is, the will be used - to initialize the custom attribute, and then any read-write properties on the - will be plugged in. -

-
- - The desired . - - - Any constructor arguments for the attribute (may be - in the case of no arguments). - - - Source attribute to copy properties from (may be ). - - A custom attribute builder. - - If the parameter is . - - - If the parameter is not a - that derives from the class. - - -
- - - Creates a . - - - The desired . - - - Source attribute to copy properties from (may be ). - - A custom attribute builder. - - - - Creates a . - - - The source attribute to copy properties from. - - A custom attribute builder. - - If the supplied is - . - - - - - Creates a . - - - The desired . - - A custom attribute builder. - - - - Creates a . - - - The desired . - - - Any constructor arguments for the attribute (may be - in the case of no arguments). - - A custom attribute builder. - - - - Creates a . - - - The to create - the custom attribute builder from. - - A custom attribute builder. - - - - Tries to find matching methods in the specified - for each method in the supplied list. - - - The to look for matching methods in. - - The methods to match. - - A flag that specifies whether to throw an exception if a matching - method is not found. - - A list of the matched methods. - - If either of the or - parameters are . - - - - - Returns the of the supplied - . - - -

- If the is a - instance, the return value of this method call with be the - parameter cast to a - . If the is - anything other than a , the return value - will be the result of invoking the 's - method. -

-
- - A or instance. - - - The argument if it is a - or the result of invoking - on the argument if it - is an . - - - If the is . - -
- - - Unwraps the supplied - and returns the inner exception preserving the stack trace. - - - The to unwrap. - - The unwrapped exception. - - - - Is the supplied can be accessed outside the assembly ? - - The type to check. - - if the type can be accessed outside the assembly; - Otherwise . - - - - - Is the supplied can be accessed - from the supplied friendly assembly ? - - The type to check. - The friendly assembly name. - - if the type can be accessed - from the supplied friendly assembly; Otherwise . - - - - - Gets all of the interfaces implemented by - the specified . - - - The object to get the interfaces of. - - - All of the interfaces implemented by the - . - - - - - Returns the explicit that is the root cause of an exception. - - - If the InnerException property of the current exception is a null reference - or a , returns the current exception. - - The last exception thrown. - - The first explicit exception thrown in a chain of exceptions. - - - - - Copies all fields from one object to another. - - - The types of both objects must be related. This means, that either of the following is true: - - fromObject.GetType() == toObject.GetType() - fromObject.GetType() is derived from toObject.GetType() - toObject.GetType() is derived from fromObject.GetType() - - - The source object - The object, who's fields will be populated with values from the source object - If the object's types are not related - - - - Creates a . - - Bruno Baia - - - - Creates a new instance of the - class. - - The custom attribute type. - - - - Creates a new instance of the - class. - - The custom attribute type. - The custom attribute constructor arguments. - - - - Adds the specified values to the constructor argument list - used to create the custom attribute. - - An array of argument values. - - - - Adds a property value to the custom attribute. - - The property name. - The property value. - - - - Creates the . - - The created . - - - - Miscellaneous utility methods. - - -

- Mainly for internal use within the framework. -

-
- Rod Johnson - Juergen Hoeller - Keith Donald - Aleksandar Seovic (.NET) - Mark Pollack (.NET) - Rick Evans (.NET) -
- - - The string that signals the start of an Ant-style expression. - - - - - The string that signals the end of an Ant-style expression. - - - - - An empty array of instances. - - - - - Creates a new instance of the class. - - -

- This is a utility class, and as such exposes no public constructors. -

-
-
- - - Tokenize the given into a - array. - - -

- If is , returns an empty - array. -

-

- If is or the empty - , returns a array with one - element: itself. -

-
- The to tokenize. - - The delimiter characters, assembled as a . - - - Trim the tokens via . - - - Omit empty tokens from the result array. - An array of the tokens. -
- - - Convert a CSV list into an array of s. - - A CSV list. - - An array of s, or the empty array - if is . - - - - - Take a which is a delimited list - and convert it to a array. - - -

- If the supplied is a - or zero-length string, then a single element - array composed of the supplied - will be - eturned. If the supplied - is , then an empty, - zero-length array will be returned. -

-
- - The to be parsed. - - - The delimeter (this will not be returned). Note that only the first - character of the supplied is used. - - - An array of the tokens in the list. - -
- - - Convenience method to return an - as a delimited - (e.g. CSV) . - - - The to parse. - - - The delimiter to use (probably a ','). - - The delimited string representation. - - - - Convenience method to return an - as a CSV - . - - - The to display. - - The delimited string representation. - - - - Convenience method to return an array as a CSV - . - - - The array to parse. Elements may be of any type ( - will be called on each - element). - - - - - Convenience method to return a - array as a delimited (e.g. CSV) . - - - The array to parse. Elements may be of any type ( - will be called on each - element). - - - The delimiter to use (probably a ','). - - - - Checks if a string has length. - - The string to check, may be . - - - if the string has length and is not - . - - - - StringUtils.HasLength(null) = false - StringUtils.HasLength("") = false - StringUtils.HasLength(" ") = true - StringUtils.HasLength("Hello") = true - - - - - - Checks if a has text. - - -

- More specifically, returns if the string is - not , it's is > - zero (0), and it has at least one non-whitespace character. -

-
- - The string to check, may be . - - - if the is not - , - > zero (0), and does not consist - solely of whitespace. - - - - StringUtils.HasText(null) = false - StringUtils.HasText("") = false - StringUtils.HasText(" ") = false - StringUtils.HasText("12345") = true - StringUtils.HasText(" 12345 ") = true - - -
- - - Checks if a is - or an empty string. - - -

- More specifically, returns if the string is - , it's is equal - to zero (0), or it is composed entirely of whitespace - characters. -

-
- - The string to check, may (obviously) be . - - - if the is - , has a length equal to zero (0), or - is composed entirely of whitespace characters. - - - - StringUtils.IsNullOrEmpty(null) = true - StringUtils.IsNullOrEmpty("") = true - StringUtils.IsNullOrEmpty(" ") = true - StringUtils.IsNullOrEmpty("12345") = false - StringUtils.IsNullOrEmpty(" 12345 ") = false - - -
- - - Strips first and last character off the string. - - The string to strip. - The stripped string. - - - - Returns a list of Ant-style expressions from the specified text. - - The text to inspect. - - A list of expressions that exist in the specified text. - - - If any of the expressions in the supplied - is empty (${}). - - - - - Replaces Ant-style expression placeholder with expression value. - - -

- -

-
- The string to set the value in. - The name of the expression to set. - The expression value. - - A new string with the expression value set; the - value if the supplied - is , has a length - equal to zero (0), or is composed entirely of whitespace - characters. - -
- - - Surrounds (prepends and appends) the string value of the supplied - to the supplied . - - -

- The return value of this method call is always guaranteed to be non - . If every value passed as a parameter to this method is - , the string will be returned. -

-
- - The prefix and suffix that respectively will be prepended and - appended to the target . If this value - is not a value, it's attendant - value will be used. - - - The target that is to be surrounded. If this value is not a - value, it's attendant - value will be used. - - The surrounded string. -
- - - Surrounds (prepends and appends) the string values of the supplied - and to the supplied - . - - -

- The return value of this method call is always guaranteed to be non - . If every value passed as a parameter to this method is - , the string will be returned. -

-
- - The value that will be prepended to the . If this value - is not a value, it's attendant - value will be used. - - - The target that is to be surrounded. If this value is not a - value, it's attendant - value will be used. - - - The value that will be appended to the . If this value - is not a value, it's attendant - value will be used. - - The surrounded string. -
- - - Converts escaped characters (for example "\t") within a string - to their real character. - - The string to convert. - The converted string. - - - - Utility class containing miscellaneous system-level functionality. - - Aleksandar Seovic - - - - Registers assembly resolver that iterates over the - assemblies loaded into the current - in order to find an assembly that cannot be resolved. - - - This method has to be called if you need to serialize dynamically - generated types in transient assemblies, such as Spring AOP proxies, - because standard .NET serialization engine always tries to load - assembly from the disk. - - - - - Returns true if running on Mono - - Tests for the presence of the type Mono.Runtime - - - - Gets the thread id for the current thread. Use thread name is available, - otherwise use CurrentThread.GetHashCode() for .NET 1.0/1.1 and - CurrentThread.ManagedThreadId otherwise. - - The thread id. - - - - Holds text position information for e.g. error reporting purposes. - - - - - - - Creates a new TextPositionInfo instance. - - - - - Creates a new TextPositionInfo instance, copying values from another instance. - - - - - The filename related to this text position - - - - - The line number related to this text position - - - - - The line position related to this text position - - - - - UniqueKey allows for generating keys unique to a type or particular instance and a partial name, - that can e.g. be used as keys in . - - - // shows usage type-scoped keys - UniqueKey classAKey = UniqueKey.GetTypeScoped(typeof(ClassA), "myKey"); - UniqueKey classBKey = UniqueKey.GetTypeScoped(typeof(ClassB), "myKey"); - - HttpContext.Current.Items.Add( classAKey, "some value unqiue for class A having key 'myKey'"); - object value = HttpContext.Current.Items[ UniqueKey.GetTypeScoped(typeof(ClassA), "myKey") ]; - Assert.AreEqual( "some value unique for class A having key 'myKey'", value); - - HttpContext.Current.Items.Add( classBKey, "some value unqiue for class B having key 'myKey'"); - object value = HttpContext.Current.Items[ UniqueKey.GetTypeScoped(typeof(ClassB), "myKey") ]; - Assert.AreEqual( "some value unique for class B having key 'myKey'", value); - - - - - Initialize a new instance of from its string representation. - See and See for details. - - The string representation of the new instance. - - - - Compares this instance to another. - - - - - Compares this instance to another. - - - - - Returns the hash code for this key. - - - - - - Returns a string representation of this key. - - - - - Creates a new key instance unique to the given instance. - - The instance the key shall be unique to - The partial key to be made unique - - - If is of type - - - - Creates a new key instance unique to the given type. - - The type the key shall be unique to - The partial key to be made unique - - - - Returns a key unique for the given instance. - - The instance the key shall be unique to - The partial key to be made unique - A key formatted as typename[instance-id].partialkey - - - - Returns a key unique for the given type. - - The type the key shall be unique to - The partial key to be made unique - A key formatted as typename.partialkey - - - - XML utility methods. - - Aleksandar Seovic - - - - Gets an appropriate implementation - for the supplied . - - The XML that is going to be read. - XML schemas that should be used for validation. - Validation event handler. - - A validating implementation. - - - - - Gets an appropriate implementation - for the supplied . - - The XML that is going to be read. - to be used for resolving external references - XML schemas that should be used for validation. - Validation event handler. - - A validating implementation. - - - - - Gets an appropriate implementation - for the supplied . - - The XML that is going to be read. - - A non-validating implementation. - - - - - Implementation of that adds error message - to the validation errors container. - - Aleksandar Seovic - - - - Abstract base class that should be extended by all - validation actions. - - -

- This class implements template Execute method - and defines OnValid and OnInvalid methods that - can be overriden - by specific validation actions. -

-
- Aleksandar Seovic -
- - - An action that should be executed after validator is evaluated. - - -

- This interface allows us to define the actions that should be executed - after validation in a generic fashion. -

-

- For example, addition of error messages to validation errors collection - is performed by one specific implementation of this interface, . -

-
- Aleksandar Seovic -
- - - Executes the action. - - Whether associated validator is valid or not. - Validation context. - Additional context parameters. - Validation errors container. - - - - Initializes a new instance of the class. - - - - - Executes the action. - - Whether associated validator is valid or not. - Validation context. - Additional context parameters. - Validation errors container. - - - - Called when associated validator is valid. - - Validation context. - Additional context parameters. - Validation errors container. - - - - Called when associated validator is not valid. - - Validation context. - Additional context parameters. - Validation errors container. - - - - Evaluates 'when' expression. - - Root context to use for expression evaluation. - Additional context parameters. - True if the condition is true, False otherwise. - - - - Gets or sets the expression that determines if this validator should be evaluated. - - The expression that determines if this validator should be evaluated. - - - - Initializes a new instance of the class. - - Error message resource identifier. - Names of the error providers this message should be added to. - - - - Called when associated validator is invalid. - - Validation context. - Additional context parameters. - Validation errors container. - - - - Resolves the error message. - - Validation context to resolve message parameters against. - Additional context parameters. - Resolved error message - - - - Resolves the message parameters. - - List of parameters to resolve. - Validation context to resolve parameters against. - Additional context parameters. - Resolved message parameters. - - - - Sets the expressions that should be resolved to error message parameters. - - The expressions that should be resolved to error message parameters. - - - - Implementation of that allows you - to define Spring.NET expressions that should be evaluated after - validation. - - Aleksandar Seovic - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - Expression to execute when validator is valid. - Expression to execute when validator is not valid. - - - - Initializes a new instance of the class. - - Expression to execute when validator is valid. - Expression to execute when validator is not valid. - - - - Called when associated validator is valid. - - Validation context. - Additional context parameters. - Validation errors container. - - - - Called when associated validator is invalid. - - Validation context. - Additional context parameters. - Validation errors container. - - - - Gets or sets the expression to execute when validator is valid. - - The expression to execute when validator is valid. - - - - Gets or sets the expression to execute when validator is not valid. - - The expression to execute when validator is not valid. - - - - Implementation of the custom configuration parser for validator definitions. - - Aleksandar Seovic - - - - Initializes a new instance of the class. - - - - - Parse the specified element and register any resulting - IObjectDefinitions with the IObjectDefinitionRegistry that is - embedded in the supplied ParserContext. - - The element to be parsed into one or more IObjectDefinitions - The object encapsulating the current state of the parsing - process. - - The primary IObjectDefinition (can be null as explained above) - - - Implementations should return the primary IObjectDefinition - that results from the parse phase if they wish to used nested - inside (for example) a <property> tag. - Implementations may return null if they will not - be used in a nested scenario. - - - - - - Parses the validator definition. - - Validator's identifier. - The element to parse. - The parser helper. - Validator object definition. - - - - Parses and potentially registers a validator. - - - Only validators that have id attribute specified are registered - as separate object definitions within application context. - - Validator XML element. - The parser helper. - Validator object definition. - - - - Gets the name of the object type for the specified element. - - The element. - The name of the object type. - - - - Creates an error message action based on the specified message element. - - The message element. - The parser helper. - The error message action definition. - - - - Creates a generic action based on the specified element. - - The action definition element. - The parser helper. - Generic validation action definition. - - - - Creates object definition for the validator reference. - - The action definition element. - The parser helper. - Generic validation action definition. - - - - Evaluates validator test using condition evaluator. - - Aleksandar Seovic - - - - Base class that defines common properties for all validators. - - -

- Custom validators should always extend this class instead of - simply implementing interface, in - order to inherit common validator functionality. -

-
- Aleksandar Seovic -
- - - An object that can validate application-specific objects. - - -

- The primary motivation for this interface is to enable validation to be - decoupled from the (user) interface and placed in business objects. -

-

- Application developers writing their own custom - implementations will - typically not implement this interface directly. In most cases, custom - validators woud be better served deriving from the - class, with the - custom validation ligic being implemented in an override of the - - - template method. -

-
- Aleksandar Seovic - -
- - - Validates the specified object. - - The object to validate. - - The instance to add any error - messages to in the case of validation failure. - - - if validation was successful. - - - - - Validates the specified object. - - The object to validate. - Additional context parameters. - - The instance to add any error - messages to in the case of validation failure. - - - if validation was successful. - - - - - Creates a new instance of the class. - - - - - Creates a new instance of the class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Creates a new instance of the class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Validates the specified object. - - The object to validate. - instance to add error messages to. - True if validation was successful, False otherwise. - - - - Validates the specified object. - - The object to validate. - Additional context parameters. - instance to add error messages to. - True if validation was successful, False otherwise. - - - - Validates test object. - - Object to validate. - True if specified object is valid, False otherwise. - - - - Evaluates test expression. - - Root context to use for expression evaluation. - Additional context parameters. - Result of the test expression evaluation, or validation context if test is null. - - - - Evaluates when expression. - - Root context to use for expression evaluation. - Additional context parameters. - True if the condition is true, False otherwise. - - - - Processes the error messages. - - Whether validator is valid or not. - Validation context. - Additional context parameters. - Validation errors container. - - - - Gets or sets the test expression. - - The test expression. - - - - Gets or sets the expression that determines if this validator should be evaluated. - - The expression that determines if this validator should be evaluated. - - - - Gets or sets the validation actions. - - The actions that should be executed after validation. - - - - Creates a new instance of the class. - - - - - Creates a new instance of the class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Creates a new instance of the class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Evaluates the test using condition evaluator. - - -

- Test can be any logical expression that is supported by the Spring.NET logical - expression evaluation engine, and can use any variables that can be resolved - by the variable resolver used by the validation engine. -

-
- The object to validate. - - if the supplied is valid. - -
- - - Perform credit card validations. - - - By default, all supported card types are allowed. You can specify - which credit card type validator should be used by setting - the value of property to a concrete - instance. - - - - - Creates a new instance of the UrlValidator class. - - - - - Creates a new instance of the UrlValidator class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - Credit Card type validator to use. - - - - Creates a new instance of the UrlValidator class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - Credit Card type validator to use. - - - - Validates the supplied . - - - In the case of the class, - the test should be a string variable that will be evaluated and the object - obtained as a result of this evaluation will be checked if it is - a valid credit card number. - - The object to validate. - - if the supplied is valid - credit card number. - - - - - Checks if the is a valid credit card number. - - - The card number to validate. - - - true if the card number is valid. - - - - - Validates card number with the specified validator. - - - Credit card number to validate. - - - true if credit card number is a valid number of credit card type specified. - - - - - Checks for a valid credit card number. - - - Credit Card Number. - - - true if the card number passes the LuhnCheck. - - - - - Credit card type validator to use. - - - Can be concrete implementations of - interface. The following are available implementations: - , , , - . - - - - - CreditCardType interface defines how validation is performed - for one type/brand of credit card. - - - - - Returns true if the card number matches this type of - credit card. - - - The card number, never null. - - - true if the number matches. - - - - - Visa credit card type validation support. - - - - - Indicates, wheter the given credit card number matches a visa number. - - - - - American Express credit card type validation support. - - - - - Indicates, wheter the given credit card number matches an amex number. - - - - - Discover credit card type validation support. - - - - - Indicates, wheter the given credit card number matches a discover number. - - - - - Mastercard credit card type validation support. - - - - - Indicates, wheter the given credit card number matches a mastercard number. - - - - - Perform email validations. - - -

- This implementation is not guaranteed to catch all possible errors in an - email address. For example, an address like nobody@noplace.nowhere will - pass validator, even though there is no TLD "nowhere". - - Goran Milosavljevic - - -

- Creates a new instance of the EmailValidator class. - -
- - - Creates a new instance of the EmailValidator class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Creates a new instance of the EmailValidator class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Validates the supplied . - - - In the case of the class, - the test should be a string variable that will be evaluated and the object - obtained as a result of this evaluation will be checked if it is - a valid e-mail address. - - The object to validate. - - if the supplied is valid - e-mail address. - - - - - Regular expression used for validation of object passed to this . - - - - - Validates that the object is valid ISBN-10 or ISBN-13 value. - - Goran Milosavljevic - - - - Creates a new instance of the ISBNValidator class. - - - - - Creates a new instance of the ISBNValidator class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Creates a new instance of the ISBNValidator class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Validates the supplied . - - - In the case of the class, - the test should be a string variable that will be evaluated and the object - obtained as a result of this evaluation will be tested using the ISBN-10 or - ISBN-13 validation rules. - - The object to validate. - - if the supplied is valid ISBN. - - - - - Validates against ISBN-10 or ISBN-13 validation - rules. - - - ISBN string to validate. - - - true if is a valid ISBN-10 or ISBN-13 code. - - - - - ISBN-10 consists of 4 groups of numbers separated by either - dashes (-) or spaces. - - - The first group is 1-5 characters, second 1-7, third 1-6, - and fourth is 1 digit or an X. - - - - - ISBN-13 consists of 5 groups of numbers separated by either - dashes (-) or spaces. - - - The first group is 978 or 979, the second group is - 1-5 characters, third 1-7, fourth 1-6, and fifth is 1 digit. - - - - - Validates that object matches specified regular expression. - - -

- The test expression must evaluate to a ; - otherwise, an exception is thrown. -

-
- Aleksandar Seovic -
- - - Creates a new instance of the class. - - - - - Creates a new instance of the class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - The regular expression to match against. - - - - Creates a new instance of the class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - The regular expression to match against. - - - - Validates an object. - - Object to validate. - - if the supplied - object is valid. - - - If the supplied is not a - - - - - - The regular expression text to match against. - - The regular expression text. - - - - The for the regular expression evaluation. - - The regular expression evaluation options. - - - - - Validates that required value is not empty. - - -

- This validator uses following rules to determine if target value is valid: - - - - - - - - - - - - - - - - - - - - - - - - - -
Target Valid Value
A .Not or an empty string.
A .Not and not .
One of the number types.Not zero.
A .Not or whitespace.
Any reference type other than .Not .
-

-

- You cannot use this validator to validate any value types other than the ones - specified in the table above. -

-
- Aleksandar Seovic -
- - - Creates a new instance of the class. - - - - - Creates a new instance of the class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Creates a new instance of the class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Validates the supplied . - - - In the case of the class, - the test should be a variable expression that will be evaluated and the object - obtained as a result of this evaluation will be tested using the rules described - in the class overview of the - class. - - The object to validate. - - if the supplied is valid. - - - - - Validates that the value is valid URL. - - Goran Milosavljevic - - - - Creates a new instance of the UrlValidator class. - - - - - Creates a new instance of the UrlValidator class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Creates a new instance of the UrlValidator class. - - The expression to validate. - The expression that determines if this validator should be evaluated. - - - - Validates the supplied . - - - In the case of the class, - the test should be a string variable that will be evaluated and the object - obtained as a result of this evaluation will be tested using the URL validation rules. - - The object to validate. - - if the supplied is valid. - - - - - Regular expression used for validation of object passed to this . - - - - - implementation that supports grouping of validators. - - -

- This validator will be valid when one or more of the validators in the Validators - collection are valid. -

-

- ValidationErrors property will return a union of all validation error messages - for the contained validators, but only if this validator is not valid (meaning, when none - of the contained validators are valid). -

-
- Aleksandar Seovic -
- - - implementation that supports grouping of validators. - - -

- This validator will be valid only when all of the validators in the Validators - collection are valid. -

-

- ValidationErrors property will return a union of all validation error messages - for the contained validators. -

-
- Aleksandar Seovic -
- - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The expression that determines if this validator should be evaluated. - - - - Initializes a new instance of the class. - - The expression that determines if this validator should be evaluated. - - - - Validates the specified object. - - The object to validate. - Additional context parameters. - instance to add error messages to. - True if validation was successful, False otherwise. - - - - Actual implementation how to validate the specified object. - - The object to validate. - Additional context parameters. - instance to add error messages to. - True if validation was successful, False otherwise. - - - - Doesn't do anything for validator group as there is no single test. - - Object to validate. - True if specified object is valid, False otherwise. - - - - Gets or sets the validators. - - The validators. - - - - When set true, shortcircuits evaluation. - - - The validators within the group will only be validated - in order until the first validator fails. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The expression that determines if this validator should be evaluated. - - - - Initializes a new instance of the class. - - The expression that determines if this validator should be evaluated. - - - - Validates the specified object. - - The object to validate. - Additional context parameters. - instance to add error messages to. - True if validation was successful, False otherwise. - - - - implementation that supports validating collections. - - -

- This validator will be valid only when all of the validators in the Validators - collection are valid for all of the objects in the specified collection. -

-

- You can specify if you want to validate all of the collection elements regardless of the errors, by - setting the ValidateAll property to true. -

-

- If you set the IncludeElementErrors property to true, - ValidationErrors collection will contain a union of all validation error messages - for the contained validators; - Otherwise it will contain only error messages that were set for this Validator. -

-
- Damjan Tomic - Aleksandar Seovic -
- - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The bool that determines if all elements of the collection should be evaluated. - regardless of the Errors - - The bool that determines whether Validate method should collect - all error messages returned by the item validators - - - - Initializes a new instance of the class. - - The expression that determines if this validator should be evaluated. - The bool that determines if this all elements of the collection should be evaluated. - regardless of the Errors - - The bool that determines whether Validate method should collect - all error messages returned by the item validators - - - - Initializes a new instance of the class. - - The expression that determines if this validator should be evaluated. - The bool that determines if this all elements of the collection should be evaluated. - regardless of the Errors - - The bool that determines whether Validate method should collect - all error messages returned by the item validators - - - - Validates the specified collection of objects. - If the IncludeElementErrors property was set to true, - collection will contain a union of all validation error messages - for the contained validators; - Otherwise it will contain only error messages that were set for this Validator. - - The collection to validate. - Additional context parameters. - instance to add error messages to. - True if validation was successful, False otherwise. - - - - Actual implementation how to validate the specified object. - - The object to validate. - Additional context parameters. - instance to add error messages to. - True if validation was successful, False otherwise. - - - - Gets or sets the value that indicates whether to validate all elements of the collection - regardless of the errors. - - This is just an alias for - - - - Gets or sets the value that indicates whether to capture all the errors of the specific - elements of the collection - - - - - Gets or sets the expression that should be used to narrow validation context. - - The expression that should be used to narrow validation context. - - - - implementation that supports grouping of validators. - - -

- This validator will be valid when one and only one of the validators in the Validators collection are valid -

-

- ValidationErrors property will return a union of all validation error messages - for the contained validators, but only if this validator is not valid (meaning, when none - of the contained validators are valid). -

-

- By default, this validator group uses == true semantics. -

-
- Aleksandar Seovic -
- - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The expression that determines if this validator should be evaluated. - - - - Initializes a new instance of the class. - - The expression that determines if this validator should be evaluated. - - - - Actual implementation how to validate the specified object. - - The object to validate. - Additional context parameters. - instance to add error messages to. - True if validation was successful, False otherwise. - - - - An interface that validation errors containers have to implement. - - Aleksandar Seovic - - - - Adds the supplied to this - instance's collection of errors. - - - The provider that should be used for message grouping; can't be - . - - The error message to add. - - If the supplied or is . - - - - - Merges another instance of into this one. - - -

- If the supplied is , - then no errors will be added to this instance, and this method will - (silently) return. -

-
- - The validation errors to merge; can be . - -
- - - Gets the list of errors for the supplied error . - - -

- If there are no errors for the supplied , - an empty will be returned. -

-
- Error key that was used to group messages. - - A list of all s for the supplied lookup . - -
- - - Gets the list of resolved error messages for the supplied lookup . - - -

- If there are no errors for the supplied lookup , - an empty will be returned. -

-
- Error key that was used to group messages. - to resolve messages against. - - A list of resolved error messages for the supplied lookup . - -
- - - Does this instance contain any validation errors? - - -

- If this returns , this means that it (obviously) - contains no validation errors. -

-
- if this instance is empty. -
- - - Gets the list of all error providers. - - - - - Allows developers to specify which validator should be used - to validate method argument. - - Damjan Tomic - Aleksandar Seovic - - - - Creates an attribute instance. - - - The name of the validator to use (must be defined within - Spring application context). - - - - - Gets the name of the validator to use. - - The name of the validator to use. - - - - A container for validation errors. - - -

- This class groups validation errors by validator names and allows - access to both the complete errors collection and to the errors for a - certain validator. -

-
- Aleksandar Seovic - Goran Milosavljevic -
- - - Default constructor. - - - - - This property is reserved, apply the - - to the class instead. - - - An that describes the - XML representation of the object that is produced by - the - method and consumed by the - - method. - - - - - Generates an object from its XML representation. - - - The stream - from which the object is deserialized. - - - - - Converts an object into its XML representation. - - - The stream - to which the object is serialized. - - - - - Adds the supplied to this - instance's collection of errors. - - - The provider that should be used for message grouping; can't be - . - - The error message to add. - - If the supplied or is . - - - - - Merges another instance of into this one. - - -

- If the supplied is , - then no errors will be added to this instance, and this method will - (silently) return. -

-
- - The validation errors to merge; can be . - -
- - - Gets the list of errors for the supplied lookup . - - -

- If there are no errors for the supplied lookup , - an empty will be returned. -

-
- Error key that was used to group messages. - - A list of all s for the supplied lookup . - -
- - - Gets the list of resolved error messages for the supplied lookup . - - -

- If there are no errors for the supplied lookup , - an empty will be returned. -

-
- Error key that was used to group messages. - to resolve messages against. - - A list of resolved error messages for the supplied lookup . - -
- - - Does this instance contain any validation errors? - - -

- If this returns , this means that it (obviously) - contains no validation errors. -

-
- if this instance is empty. -
- - - Gets the list of all providers. - - - - - Thrown by the validation advice if the method parameters validation fails. - - Aleksandar Seovic - - - - Creates a new instance of the ValidationException class. - - - - - Creates a new instance of the ValidationException class with - specified validation errors. - - - Validation errors. - - - - - Creates a new instance of the ValidationException class with the - specified message. - - - A message about the exception. - - - - - Creates a new instance of the ValidationException class with the - specified message and validation errors. - - - A message about the exception. - - - Validation errors. - - - - - Creates a new instance of the ValidationException class with the - specified message and root cause. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ValidationException class with the - specified message, root cause and validation errors. - - - A message about the exception. - - - The root exception that is being wrapped. - - - Validation errors. - - - - - Creates a new instance of the ValidationException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Implements object serialization. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Gets validation errors. - - Validation errors. - - - - Represents a reference to an externally defined validator object - - -

- This class allows validation groups to reference validators that - are defined outside of the group itself. -

-

- It also allows users to narrow the context for the referenced validator - by specifying value for the Context property. -

-
- Aleksandar Seovic -
- - - Initializes a new instance of the class. - - - - - Validates the specified object. - - The object to validate. - instance to add error messages to. - True if validation was successful, False otherwise. - - - - Validates the specified object. - - The object to validate. - Additional context parameters. - instance to add error messages to. - True if validation was successful, False otherwise. - - - - Gets or sets the name of the referenced validator. - - The name of the referenced validator. - - - - Gets or sets the expression that should be used to narrow validation context. - - The expression that should be used to narrow validation context. - - - - Callback that supplies the owning factory to an object instance. - - - Owning - (may not be ). The object can immediately - call methods on the factory. - - -

- Invoked after population of normal object properties but before an init - callback like 's - - method or a custom init-method. -

-
- - In case of initialization errors. - -
- - diff --git a/sharedlib/Spring.Net/antlr.runtime.dll b/sharedlib/Spring.Net/antlr.runtime.dll deleted file mode 100644 index f242d02..0000000 Binary files a/sharedlib/Spring.Net/antlr.runtime.dll and /dev/null differ diff --git a/sharedlib/Spring.Net/license.txt b/sharedlib/Spring.Net/license.txt deleted file mode 100644 index 29f81d8..0000000 --- a/sharedlib/Spring.Net/license.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License.