polishing infrastructure

This commit is contained in:
eeichinger
2009-04-17 13:29:35 +00:00
parent 7038992537
commit fb0cb23a7f
4 changed files with 361 additions and 341 deletions

View File

@@ -1,5 +1,28 @@
<?xml version="1.0" ?>
<project name="Spring.NET" default="test">
<!--
Main build targets:
===================
"test":
builds all projects for all available target platforms
"compile-build-<framework id>":
builds all projects for a specific platform, e.g. compile-build-net-2.0 for net-2.0
"docs":
builds the reference documentation
"package":
builds all projects for all target platforms, builds docs and packages everything for distribution
Build properties that may be set:
=================================
"project.build.sign":
signs all assemblies. Requires the key file $/Spring.Net.snk to be in place
"package.version:":
set the package version
-->
<!-- global project settings -->
<property name="project.name" value="Spring.NET"/>
@@ -10,22 +33,23 @@
<!-- debug or release -->
<property name="project.build.config" value="debug"/>
<property name="project.build.package" value="false"/>
<property name="project.build.sign" value="false"/>
<property name="project.build.sign" value="false" overwrite="false" />
<!-- Include spring helpers -->
<include buildfile="${spring.basedir}/Spring.include"/>
<property name="package.version" value="1.2.0" unless="${property::exists('project.version')}"/>
<property name="package.version" value="0.0.0" overwrite="false"/>
<property name="using-clover" value="false"/>
<!-- change this to sync the sdk doc version generated -->
<property name="package.version.docs" value="1.2.0" unless="${property::exists('project.version')}"/>
<property name="package.version.docs" value="${package.version}" />
<!-- make system environment variables available as NAnt properties -->
<sysinfo/>
<property name="project.company" value="SpringSource"/>
<property name="project.copyright" value="Copyright 2002-2008 Spring.NET Framework Team."/>
<property name="project.copyright" value="Copyright 2002-2009 Spring.NET Framework Team."/>
<property name="key.file" value="Spring.Net.snk"/>
<property name="project.year" value="2008"/>
<property name="project.year" value="2009"/>
<!-- Targets that are always executed -->
<call target="set-build-configuration"/>
@@ -197,7 +221,7 @@
<call target="compile-build-1.0"/>
<call target="compile-build-1.1"/>
<call target="compile-build-2.0"/>
<!-- Ignore Compact Framework 1.0 for now -->
<!-- call target="compile-build-netcf-1.0"/ -->
@@ -343,9 +367,9 @@
<nant buildfile="test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.build" target="test" if="${build-data and not net-3.0}"/>
<nant buildfile="test/Spring/Spring.Data.NHibernate.Tests/Spring.Data.NHibernate.Tests.build" target="test" if="${build-data and (nant.settings.currentframework == 'net-1.1' or nant.settings.currentframework == 'net-2.0') and not net-3.0}"/>
<nant buildfile="test/Spring/Spring.Data.NHibernate.Integration.Tests/Spring.Data.NHibernate.Integration.Tests.build" target="test" if="${build-data and (nant.settings.currentframework == 'net-1.1' or nant.settings.currentframework == 'net-2.0') and not net-3.0}"/>
<nant buildfile="test/Spring/Spring.Data.NHibernate20.Tests/Spring.Data.NHibernate20.Tests.build" target="test"
<nant buildfile="test/Spring/Spring.Data.NHibernate20.Tests/Spring.Data.NHibernate20.Tests.build" target="test"
if="${build-data and nant.settings.currentframework == 'net-2.0' and not net-3.0}"/>
<nant buildfile="test/Spring/Spring.Data.NHibernate20.Integration.Tests/Spring.Data.NHibernate20.Integration.Tests.build" target="test"
<nant buildfile="test/Spring/Spring.Data.NHibernate20.Integration.Tests/Spring.Data.NHibernate20.Integration.Tests.build" target="test"
if="${build-data and nant.settings.currentframework == 'net-2.0' and not net-3.0}"/>
<nant buildfile="test/Spring/Spring.Data.NHibernate21.Tests/Spring.Data.NHibernate21.Tests.build" target="test"
if="${build-data and nant.settings.currentframework == 'net-2.0' and not net-3.0}"/>
@@ -567,95 +591,95 @@
</target>
<target name="clean-obj">
<delete dir="src/Spring/Spring.Aop/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Aop/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Core/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Core/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Data/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Data/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate12/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate12/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate20/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate20/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Aop/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Aop/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Core/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Core/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Data/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Data/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate12/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate12/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate20/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate20/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate21/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Data.NHibernate21/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Services/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Services/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Messaging.Nms/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Messaging.Nms/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Messaging/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Messaging/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Scheduling.Quartz/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Scheduling.Quartz/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Testing.NUnit/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Testing.NUnit/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Web/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Web/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Extensions/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Extensions/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Services/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Messaging.Nms/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Messaging.Nms/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Messaging/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Messaging/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Scheduling.Quartz/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Scheduling.Quartz/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Testing.NUnit/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Testing.NUnit/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Web/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Web/bin" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Extensions/obj" failonerror="false"/>
<delete dir="src/Spring/Spring.Web.Extensions/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Aop.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Aop.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Core.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Core.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.Integration.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.Integration.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate.Integration.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate.Integration.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate20.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate20.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate20.Integration.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate20.Integration.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Aop.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Aop.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Core.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Core.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.Integration.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.Integration.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate.Integration.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate.Integration.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate20.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate20.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate20.Integration.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate20.Integration.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate21.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate21.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate21.Integration.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Data.NHibernate21.Integration.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Services.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Services.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Nms.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Nms.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Scheduling.Quartz.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Scheduling.Quartz.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Testing.NUnit.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Testing.NUnit.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Services.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Nms.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Nms.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Messaging.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Scheduling.Quartz.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Scheduling.Quartz.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Web.Tests/bin" failonerror="false"/>
<delete dir="test/Spring/Spring.Testing.NUnit.Tests/obj" failonerror="false"/>
<delete dir="test/Spring/Spring.Testing.NUnit.Tests/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Aspects/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Aspects/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.ClientApp/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.ClientApp/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Contract/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Contract/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.RegisterComponentServices/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.RegisterComponentServices/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.RemoteApp/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.RemoteApp/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Services/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Services/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Web.2003/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Web.2003/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Aspects/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Aspects/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.ClientApp/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.ClientApp/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Contract/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Contract/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.RegisterComponentServices/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.RegisterComponentServices/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.RemoteApp/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.RemoteApp/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Services/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Services/bin" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Web.2003/obj" failonerror="false"/>
<delete dir="examples/Spring/Spring.Calculator/src/Spring.Calculator.Web.2003/bin" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Core/obj" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Core/bin" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Data.Ado/obj" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Data.Ado/bin" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Data.IBatis/obj" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Data.IBatis/bin" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Core/obj" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Core/bin" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Data.Ado/obj" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Data.Ado/bin" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Data.IBatis/obj" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/src/SpringAir.Data.IBatis/bin" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/test/SpringAir.Core.Tests/obj" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/test/SpringAir.Core.Tests/bin" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/obj" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/bin" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/test/SpringAir.Core.Tests/obj" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/test/SpringAir.Core.Tests/bin" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/obj" failonerror="false"/>
<delete dir="examples/Spring/SpringAir/test/SpringAir.Data.Ado.Tests/bin" failonerror="false"/>
</target>
@@ -717,7 +741,7 @@
<target name="build-all-function" description="Build what is in cvs taking into account approrpiate clr versions and root target name">
<call target="${nant.target.root.name}-1.0" />
<call target="${nant.target.root.name}-1.0" />
<call target="${nant.target.root.name}-1.1" />
<call target="${nant.target.root.name}-2.0" />
<call target="${nant.target.root.name}-3.0" />
@@ -876,7 +900,7 @@
<include name="changelog.txt"/>
<include name="license.txt"/>
<include name="Spring.build"/>
<include name="Spring.include"/>
<include name="Spring.include"/>
<include name="BreakingChanges-1.2.txt"/>
<!-- exclude VS.Net stuff -->
<exclude name="**/sdk-web/**"/>
@@ -950,9 +974,9 @@
<include name="**/antlr.runtime.dll"/>
<include name="**/Common.Logging.dll"/>
<exclude name="**/3.0/**"/>
<exclude name="**/release/Spring/**"/>
<exclude name="**/debug/Spring/**"/>
<exclude name="**/3.0/**"/>
<exclude name="**/release/Spring/**"/>
<exclude name="**/debug/Spring/**"/>
<exclude name="**/examples/**"/>
<exclude name="**/results/**"/>
<exclude name="mono/**"/>
@@ -1036,8 +1060,8 @@
<include name="**/Apache.NMS.pdb"/>
<include name="**/Apache.NMS.ActiveMQ.dll"/>
<include name="**/Apache.NMS.ActiveMQ.pdb"/>
<include name="**/Quartz.dll"/>
<include name="**/Nullables.dll"/>
<include name="**/Quartz.dll"/>
<include name="**/Nullables.dll"/>
<include name="**/EULA.rtf"/>
</fileset>
</copy>
@@ -1342,9 +1366,9 @@
<include name="examples/SpringAir/src/SpringAir.Web.2005/bin/*.refresh"/>
<include name="examples/Spring/Spring.Scheduling.Quartz.Example/**"/>
<include name="examples/Spring/Spring.NmsQuickStart/**"/>
<include name="examples/Spring/Spring.MsmqQuickStart/**"/>
<include name="examples/Spring/Spring.WcfQuickStart/**"/>
<include name="examples/Spring/Spring.Scheduling.Quartz.Example/**"/>
<include name="examples/Spring/Spring.MsmqQuickStart/**"/>
<include name="examples/Spring/Spring.WcfQuickStart/**"/>
<include name="examples/Spring/Spring.Scheduling.Quartz.Example/**"/>
<!-- exclude VS.Net stuff -->

View File

@@ -29,7 +29,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\..\changelog.txt = ..\..\changelog.txt
..\..\readme.txt = ..\..\readme.txt
..\..\Spring.build = ..\..\Spring.build
..\..\Spring.include = ..\..\Spring.include
EndProjectSection
EndProject
Global

View File

@@ -1,7 +1,7 @@
#region License
/*
* Copyright <20> 2002-2005 the original author or authors.
* Copyright <20> 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Permissions;
[assembly: ComVisible(false)]
[assembly: AssemblyTitle("Spring.Net Core functionality")]
[assembly: AssemblyDescription("Core functionality for Spring.Net IoC container")]

View File

@@ -1,5 +1,5 @@
#region License
#region License
/*
* Copyright 2002-2005 the original author or authors.
*
@@ -14,246 +14,242 @@
* 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.
*/
#endregion
#region Imports
using System;
using System.Globalization;
using System.Runtime.Serialization;
using System.Security.Permissions;
using Spring.Core.IO;
#endregion
namespace Spring.Objects.Factory
{
/// <summary>
/// Thrown when an <see cref="Spring.Objects.Factory.IObjectFactory"/>
/// encounters an internal error, and its definitions are invalid.
/// </summary>
/// <remarks>
/// <p>
/// An example of a situation when this exception would be thrown is
/// in the case of an XML document containing object definitions being
/// malformed.
/// </p>
/// </remarks>
/// <author>Rod Johnson</author>
/// <author>Juergen Hoeller</author>
/// <author>Rick Evans (.NET)</author>
[Serializable]
public class ObjectDefinitionStoreException : FatalObjectException
{
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
public ObjectDefinitionStoreException()
{
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="message">
/// A message about the exception.
/// </param>
public ObjectDefinitionStoreException(string message)
: base(message)
{
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="resourceDescription">
/// The description of the resource that the object definition came from
/// </param>
/// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
/// <param name="message">
/// A message about the exception.
/// </param>
public ObjectDefinitionStoreException(
string resourceDescription, string name, string message)
: this(resourceDescription, name, message, null)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ObjectDefinitionStoreException"/> class.
/// </summary>
/// <param name="resourceDescription">
/// The description of the resource that the object definition came from
/// </param>
/// <param name="msg">The detail message (used as exception message as-is)</param>
/// <param name="cause">The root cause. (may be <code>null</code></param>
public ObjectDefinitionStoreException(string resourceDescription, string msg, Exception cause)
: this(msg, cause)
{
_resourceDescription = resourceDescription;
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="resourceLocation">
/// The resource location (e.g. an XML object definition file) associated
/// with the offending object definition.
/// </param>
/// <param name="message">
/// A message about the exception.
/// </param>
/// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
public ObjectDefinitionStoreException(
IResource resourceLocation,
string name,
string message) : this
(resourceLocation == null ? string.Empty : resourceLocation.Description,
name, message)
{
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="resourceLocation">
/// The resource location (e.g. an XML object definition file) associated
/// with the offending object definition.
/// </param>
/// <param name="message">
/// A message about the exception.
/// </param>
/// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
/// <param name="rootCause">
/// The root exception that is being wrapped.
/// </param>
public ObjectDefinitionStoreException(
IResource resourceLocation,
string name,
string message,
Exception rootCause)
: this( (resourceLocation == null ? string.Empty : resourceLocation.Description), name, message, rootCause)
{
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="resourceDescription">
/// The description of the resource that the object definition came from
/// </param>
/// <param name="message">
/// A message about the exception.
/// </param>
/// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
/// <param name="rootCause">
/// The root exception that is being wrapped.
/// </param>
public ObjectDefinitionStoreException(
string resourceDescription,
string name,
string message,
Exception rootCause)
: base(
string.Format(
"Error registering object {0}defined in '{1}' : {2}",
name == null ? string.Empty : string.Format("with name '{0}' ", name),
resourceDescription,
message),
rootCause)
{
_resourceDescription = resourceDescription;
_objectName = name;
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="message">
/// A message about the exception.
/// </param>
/// <param name="rootCause">
/// The root exception that is being wrapped.
/// </param>
public ObjectDefinitionStoreException(string message, Exception rootCause)
: base(message, rootCause)
{
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="info">
/// The <see cref="System.Runtime.Serialization.SerializationInfo"/>
/// that holds the serialized object data about the exception being thrown.
/// </param>
/// <param name="context">
/// The <see cref="System.Runtime.Serialization.StreamingContext"/>
/// that contains contextual information about the source or destination.
/// </param>
protected ObjectDefinitionStoreException(
SerializationInfo info, StreamingContext context)
: base(info, context)
{
_resourceDescription = info.GetValue ("_resourceDescription", typeof (object)) as string;
_objectName = info.GetValue ("_objectName", typeof (object)) as string;
}
/// <summary>
/// Populates a <see cref="System.Runtime.Serialization.SerializationInfo"/> with
/// the data needed to serialize the target object.
/// </summary>
/// <param name="info">
/// The <see cref="System.Runtime.Serialization.SerializationInfo"/> to populate
/// with data.
/// </param>
/// <param name="context">
/// The destination (see <see cref="System.Runtime.Serialization.StreamingContext"/>)
/// for this serialization.
/// </param>
[SecurityPermission (SecurityAction.Demand,SerializationFormatter=true)]
public override void GetObjectData (
SerializationInfo info, StreamingContext context)
{
base.GetObjectData (info, context);
info.AddValue ("_resourceDescription", ResourceDescription);
info.AddValue ("_objectName", ObjectName);
}
/// <summary>
/// The name of the object that triggered the exception (if any).
/// </summary>
public string ObjectName
{
get { return _objectName; }
}
/// <summary>
/// The description of the resource associated with the object (if any).
/// </summary>
public string ResourceDescription
{
get { return _resourceDescription; }
}
/// <summary>
/// The description of the resource associated with the object
/// </summary>
protected string _resourceDescription = string.Empty;
/// <summary>
/// The name of the object that trigger the exception.
/// </summary>
protected string _objectName = string.Empty;
}
}
*/
#endregion
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
using Spring.Core.IO;
namespace Spring.Objects.Factory
{
/// <summary>
/// Thrown when an <see cref="Spring.Objects.Factory.IObjectFactory"/>
/// encounters an internal error, and its definitions are invalid.
/// </summary>
/// <remarks>
/// <p>
/// An example of a situation when this exception would be thrown is
/// in the case of an XML document containing object definitions being
/// malformed.
/// </p>
/// </remarks>
/// <author>Rod Johnson</author>
/// <author>Juergen Hoeller</author>
/// <author>Rick Evans (.NET)</author>
[Serializable]
public class ObjectDefinitionStoreException : FatalObjectException
{
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
public ObjectDefinitionStoreException()
{
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="message">
/// A message about the exception.
/// </param>
public ObjectDefinitionStoreException(string message)
: base(message)
{
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="resourceDescription">
/// The description of the resource that the object definition came from
/// </param>
/// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
/// <param name="message">
/// A message about the exception.
/// </param>
public ObjectDefinitionStoreException(
string resourceDescription, string name, string message)
: this(resourceDescription, name, message, null)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ObjectDefinitionStoreException"/> class.
/// </summary>
/// <param name="resourceDescription">
/// The description of the resource that the object definition came from
/// </param>
/// <param name="msg">The detail message (used as exception message as-is)</param>
/// <param name="cause">The root cause. (may be <code>null</code></param>
public ObjectDefinitionStoreException(string resourceDescription, string msg, Exception cause)
: this(msg, cause)
{
_resourceDescription = resourceDescription;
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="resourceLocation">
/// The resource location (e.g. an XML object definition file) associated
/// with the offending object definition.
/// </param>
/// <param name="message">
/// A message about the exception.
/// </param>
/// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
public ObjectDefinitionStoreException(
IResource resourceLocation,
string name,
string message)
: this
(resourceLocation == null ? string.Empty : resourceLocation.Description,
name, message)
{
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="resourceLocation">
/// The resource location (e.g. an XML object definition file) associated
/// with the offending object definition.
/// </param>
/// <param name="message">
/// A message about the exception.
/// </param>
/// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
/// <param name="rootCause">
/// The root exception that is being wrapped.
/// </param>
public ObjectDefinitionStoreException(
IResource resourceLocation,
string name,
string message,
Exception rootCause)
: this((resourceLocation == null ? string.Empty : resourceLocation.Description), name, message, rootCause)
{
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="resourceDescription">
/// The description of the resource that the object definition came from
/// </param>
/// <param name="message">
/// A message about the exception.
/// </param>
/// <param name="name">
/// The name of the object that triggered the exception.
/// </param>
/// <param name="rootCause">
/// The root exception that is being wrapped.
/// </param>
public ObjectDefinitionStoreException(
string resourceDescription,
string name,
string message,
Exception rootCause)
: base(
string.Format(
"Error registering object {0}defined in '{1}' : {2}",
name == null ? string.Empty : string.Format("with name '{0}' ", name),
resourceDescription,
message),
rootCause)
{
_resourceDescription = resourceDescription;
_objectName = name;
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="message">
/// A message about the exception.
/// </param>
/// <param name="rootCause">
/// The root exception that is being wrapped.
/// </param>
public ObjectDefinitionStoreException(string message, Exception rootCause)
: base(message, rootCause)
{
}
/// <summary>
/// Creates a new instance of the ObjectDefinitionStoreException class.
/// </summary>
/// <param name="info">
/// The <see cref="System.Runtime.Serialization.SerializationInfo"/>
/// that holds the serialized object data about the exception being thrown.
/// </param>
/// <param name="context">
/// The <see cref="System.Runtime.Serialization.StreamingContext"/>
/// that contains contextual information about the source or destination.
/// </param>
protected ObjectDefinitionStoreException(
SerializationInfo info, StreamingContext context)
: base(info, context)
{
_resourceDescription = info.GetValue("_resourceDescription", typeof(object)) as string;
_objectName = info.GetValue("_objectName", typeof(object)) as string;
}
/// <summary>
/// Populates a <see cref="System.Runtime.Serialization.SerializationInfo"/> with
/// the data needed to serialize the target object.
/// </summary>
/// <param name="info">
/// The <see cref="System.Runtime.Serialization.SerializationInfo"/> to populate
/// with data.
/// </param>
/// <param name="context">
/// The destination (see <see cref="System.Runtime.Serialization.StreamingContext"/>)
/// for this serialization.
/// </param>
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(
SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("_resourceDescription", ResourceDescription);
info.AddValue("_objectName", ObjectName);
}
/// <summary>
/// The name of the object that triggered the exception (if any).
/// </summary>
public string ObjectName
{
get { return _objectName; }
}
/// <summary>
/// The description of the resource associated with the object (if any).
/// </summary>
public string ResourceDescription
{
get { return _resourceDescription; }
}
/// <summary>
/// The description of the resource associated with the object
/// </summary>
private readonly string _resourceDescription = string.Empty;
/// <summary>
/// The name of the object that trigger the exception.
/// </summary>
private readonly string _objectName = string.Empty;
}
}