Initial import!

This commit is contained in:
markpollack
2008-05-30 22:55:02 +00:00
commit c478a783c0
2978 changed files with 510966 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Common.2003", "src\Spring.AopQuickStart.Common\Spring.AopQuickStart.Common.2003.csproj", "{C707543A-8F0E-4483-AECC-BC6EE14C3A29}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step1.2003", "src\Spring.AopQuickStart.Step1\Spring.AopQuickStart.Step1.2003.csproj", "{72D32026-23F5-4C62-8E6C-BFB30210BFD3}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step2.2003", "src\Spring.AopQuickStart.Step2\Spring.AopQuickStart.Step2.2003.csproj", "{202672D3-F523-4C62-8E6C-BFB30210BFD3}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step3.2003", "src\Spring.AopQuickStart.Step3\Spring.AopQuickStart.Step3.2003.csproj", "{BFB30210-4C62-F523-8E6C-202672D3BFD3}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step4.2003", "src\Spring.AopQuickStart.Step4\Spring.AopQuickStart.Step4.2003.csproj", "{672D3BFD-4C62-F523-8E6C-20BFB3021023}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step5.2003", "src\Spring.AopQuickStart.Step5\Spring.AopQuickStart.Step5.2003.csproj", "{F5233BFD-8E6C-FB30-4C62-20BFB3021023}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step6.2003", "src\Spring.AopQuickStart.Step6\Spring.AopQuickStart.Step6.2003.csproj", "{8E620210-4D33-F523-BF6C-202672CBBFD3}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step7.2003", "src\Spring.AopQuickStart.Step7\Spring.AopQuickStart.Step7.2003.csproj", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{C707543A-8F0E-4483-AECC-BC6EE14C3A29}.Debug.ActiveCfg = Debug|.NET
{C707543A-8F0E-4483-AECC-BC6EE14C3A29}.Debug.Build.0 = Debug|.NET
{C707543A-8F0E-4483-AECC-BC6EE14C3A29}.Release.ActiveCfg = Release|.NET
{C707543A-8F0E-4483-AECC-BC6EE14C3A29}.Release.Build.0 = Release|.NET
{72D32026-23F5-4C62-8E6C-BFB30210BFD3}.Debug.ActiveCfg = Debug|.NET
{72D32026-23F5-4C62-8E6C-BFB30210BFD3}.Debug.Build.0 = Debug|.NET
{72D32026-23F5-4C62-8E6C-BFB30210BFD3}.Release.ActiveCfg = Release|.NET
{72D32026-23F5-4C62-8E6C-BFB30210BFD3}.Release.Build.0 = Release|.NET
{202672D3-F523-4C62-8E6C-BFB30210BFD3}.Debug.ActiveCfg = Debug|.NET
{202672D3-F523-4C62-8E6C-BFB30210BFD3}.Debug.Build.0 = Debug|.NET
{202672D3-F523-4C62-8E6C-BFB30210BFD3}.Release.ActiveCfg = Release|.NET
{202672D3-F523-4C62-8E6C-BFB30210BFD3}.Release.Build.0 = Release|.NET
{BFB30210-4C62-F523-8E6C-202672D3BFD3}.Debug.ActiveCfg = Debug|.NET
{BFB30210-4C62-F523-8E6C-202672D3BFD3}.Debug.Build.0 = Debug|.NET
{BFB30210-4C62-F523-8E6C-202672D3BFD3}.Release.ActiveCfg = Release|.NET
{BFB30210-4C62-F523-8E6C-202672D3BFD3}.Release.Build.0 = Release|.NET
{672D3BFD-4C62-F523-8E6C-20BFB3021023}.Debug.ActiveCfg = Debug|.NET
{672D3BFD-4C62-F523-8E6C-20BFB3021023}.Debug.Build.0 = Debug|.NET
{672D3BFD-4C62-F523-8E6C-20BFB3021023}.Release.ActiveCfg = Release|.NET
{672D3BFD-4C62-F523-8E6C-20BFB3021023}.Release.Build.0 = Release|.NET
{F5233BFD-8E6C-FB30-4C62-20BFB3021023}.Debug.ActiveCfg = Debug|.NET
{F5233BFD-8E6C-FB30-4C62-20BFB3021023}.Debug.Build.0 = Debug|.NET
{F5233BFD-8E6C-FB30-4C62-20BFB3021023}.Release.ActiveCfg = Release|.NET
{F5233BFD-8E6C-FB30-4C62-20BFB3021023}.Release.Build.0 = Release|.NET
{8E620210-4D33-F523-BF6C-202672CBBFD3}.Debug.ActiveCfg = Debug|.NET
{8E620210-4D33-F523-BF6C-202672CBBFD3}.Debug.Build.0 = Debug|.NET
{8E620210-4D33-F523-BF6C-202672CBBFD3}.Release.ActiveCfg = Release|.NET
{8E620210-4D33-F523-BF6C-202672CBBFD3}.Release.Build.0 = Release|.NET
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}.Debug.ActiveCfg = Debug|.NET
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}.Debug.Build.0 = Debug|.NET
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}.Release.ActiveCfg = Release|.NET
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(SolutionItems) = postSolution
readme.txt = readme.txt
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,66 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Common.2005", "src\Spring.AopQuickStart.Common\Spring.AopQuickStart.Common.2005.csproj", "{C707543A-8F0E-4483-AECC-BC6EE14C3A29}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step1.2005", "src\Spring.AopQuickStart.Step1\Spring.AopQuickStart.Step1.2005.csproj", "{1B3559A0-5274-4968-A628-77F036984F02}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step2.2005", "src\Spring.AopQuickStart.Step2\Spring.AopQuickStart.Step2.2005.csproj", "{4ACE3EB7-B60A-4ACE-B4BB-2C33494D6108}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step3.2005", "src\Spring.AopQuickStart.Step3\Spring.AopQuickStart.Step3.2005.csproj", "{2C33494D-B4BB-4ACE-B60A-4ACE3EB76108}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step4.2005", "src\Spring.AopQuickStart.Step4\Spring.AopQuickStart.Step4.2005.csproj", "{3EB76108-4ACE-4ACE-B60A-B4BB3EB76108}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step5.2005", "src\Spring.AopQuickStart.Step5\Spring.AopQuickStart.Step5.2005.csproj", "{61086108-3EB7-4ACE-B4B6-B4B60AB76108}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step6.2005", "src\Spring.AopQuickStart.Step6\Spring.AopQuickStart.Step6.2005.csproj", "{AB33BB4D-B449-4AC1-760A-4ACE3EA56108}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.AopQuickStart.Step7.2005", "src\Spring.AopQuickStart.Step7\Spring.AopQuickStart.Step7.2005.csproj", "{0077A8CA-4C09-42B1-B227-91095CE4CCA2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{919AF8FE-423F-4A8C-BDA4-CB8B39D64780}"
ProjectSection(SolutionItems) = preProject
readme.txt = readme.txt
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C707543A-8F0E-4483-AECC-BC6EE14C3A29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C707543A-8F0E-4483-AECC-BC6EE14C3A29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C707543A-8F0E-4483-AECC-BC6EE14C3A29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C707543A-8F0E-4483-AECC-BC6EE14C3A29}.Release|Any CPU.Build.0 = Release|Any CPU
{1B3559A0-5274-4968-A628-77F036984F02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B3559A0-5274-4968-A628-77F036984F02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B3559A0-5274-4968-A628-77F036984F02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B3559A0-5274-4968-A628-77F036984F02}.Release|Any CPU.Build.0 = Release|Any CPU
{4ACE3EB7-B60A-4ACE-B4BB-2C33494D6108}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4ACE3EB7-B60A-4ACE-B4BB-2C33494D6108}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4ACE3EB7-B60A-4ACE-B4BB-2C33494D6108}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4ACE3EB7-B60A-4ACE-B4BB-2C33494D6108}.Release|Any CPU.Build.0 = Release|Any CPU
{2C33494D-B4BB-4ACE-B60A-4ACE3EB76108}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C33494D-B4BB-4ACE-B60A-4ACE3EB76108}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C33494D-B4BB-4ACE-B60A-4ACE3EB76108}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2C33494D-B4BB-4ACE-B60A-4ACE3EB76108}.Release|Any CPU.Build.0 = Release|Any CPU
{3EB76108-4ACE-4ACE-B60A-B4BB3EB76108}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3EB76108-4ACE-4ACE-B60A-B4BB3EB76108}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3EB76108-4ACE-4ACE-B60A-B4BB3EB76108}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3EB76108-4ACE-4ACE-B60A-B4BB3EB76108}.Release|Any CPU.Build.0 = Release|Any CPU
{61086108-3EB7-4ACE-B4B6-B4B60AB76108}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61086108-3EB7-4ACE-B4B6-B4B60AB76108}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61086108-3EB7-4ACE-B4B6-B4B60AB76108}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61086108-3EB7-4ACE-B4B6-B4B60AB76108}.Release|Any CPU.Build.0 = Release|Any CPU
{AB33BB4D-B449-4AC1-760A-4ACE3EA56108}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB33BB4D-B449-4AC1-760A-4ACE3EA56108}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB33BB4D-B449-4AC1-760A-4ACE3EA56108}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB33BB4D-B449-4AC1-760A-4ACE3EA56108}.Release|Any CPU.Build.0 = Release|Any CPU
{0077A8CA-4C09-42B1-B227-91095CE4CCA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0077A8CA-4C09-42B1-B227-91095CE4CCA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0077A8CA-4C09-42B1-B227-91095CE4CCA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0077A8CA-4C09-42B1-B227-91095CE4CCA2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" ?>
<project name="Spring.AopQuickStart" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<target name="build">
<nant buildfile="src\Spring.AopQuickStart.Common\Spring.AopQuickStart.Common.build" target="build" />
<nant buildfile="src\Spring.AopQuickStart.Step1\Spring.AopQuickStart.Step1.build" target="build"/>
<nant buildfile="src\Spring.AopQuickStart.Step2\Spring.AopQuickStart.Step2.build" target="build" />
<nant buildfile="src\Spring.AopQuickStart.Step3\Spring.AopQuickStart.Step3.build" target="build" />
<nant buildfile="src\Spring.AopQuickStart.Step4\Spring.AopQuickStart.Step4.build" target="build" />
<nant buildfile="src\Spring.AopQuickStart.Step5\Spring.AopQuickStart.Step5.build" target="build" />
<nant buildfile="src\Spring.AopQuickStart.Step6\Spring.AopQuickStart.Step6.build" target="build" />
<nant buildfile="src\Spring.AopQuickStart.Step7\Spring.AopQuickStart.Step7.build" target="build" />
</target>
</project>

View File

@@ -0,0 +1,20 @@
Step1 :
Use Spring.Aop programmatically
Step2 :
Use Spring.Aop within IoC container
Step3 :
Use Spring.NET convenience pointcuts (Match by method name)
Step4 :
Use Spring.NET convenience pointcuts (Match by attribute)
Step5 :
Create and use custom pointcuts
Step6 :
Use Introductions (mixins)
Step7 :
Use AutoProxy functionality

View File

@@ -0,0 +1,56 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using System.Reflection;
using Spring.Aop;
#endregion
namespace Spring.AopQuickStart.Aspects
{
/// <summary>
/// Simple implementation of the <see cref="Spring.Aop.IAfterReturningAdvice"/> interface
/// for a logging aspect using <see cref="System.Console"/>.
/// </summary>
/// <author>Rick Evans</author>
/// <version>$Id: ConsoleLoggingAfterAdvice.cs,v 1.1 2006/11/26 18:57:59 bbaia Exp $</version>
public class ConsoleLoggingAfterAdvice : IAfterReturningAdvice
{
public void AfterReturning(
object returnValue, MethodInfo method, object[] args, object target)
{
Console.Out.WriteLine("This method call returned successfully : " + method.Name);
Console.Out.WriteLine(" The target was : " + target);
Console.Out.WriteLine(" The arguments were : ");
if (args != null)
{
foreach (object arg in args)
{
Console.Out.WriteLine("\t: " + arg);
}
}
Console.Out.WriteLine(" The return value is : " + returnValue);
}
}
}

View File

@@ -0,0 +1,52 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using AopAlliance.Intercept;
#endregion
namespace Spring.AopQuickStart.Aspects
{
/// <summary>
/// Simple implementation of the <see cref="AopAlliance.Intercept.IMethodInterceptor"/> interface
/// for a logging aspect using <see cref="System.Console"/>.
/// </summary>
/// <author>Rick Evans</author>
/// <version>$Id: ConsoleLoggingAroundAdvice.cs,v 1.2 2006/12/03 23:56:17 bbaia Exp $</version>
public class ConsoleLoggingAroundAdvice : IMethodInterceptor
{
public object Invoke(IMethodInvocation invocation)
{
Console.Out.WriteLine(String.Format(
"Intercepted call : about to invoke method '{0}'", invocation.Method.Name));
object returnValue = invocation.Proceed();
Console.Out.WriteLine(String.Format(
"Intercepted call : returned '{0}'", returnValue));
return returnValue;
}
}
}

View File

@@ -0,0 +1,54 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using System.Reflection;
using Spring.Aop;
#endregion
namespace Spring.AopQuickStart.Aspects
{
/// <summary>
/// Simple implementation of the <see cref="Spring.Aop.IMethodBeforeAdvice"/> interface
/// for a logging aspect using <see cref="System.Console"/>.
/// </summary>
/// <author>Rick Evans</author>
/// <version>$Id: ConsoleLoggingBeforeAdvice.cs,v 1.1 2006/11/26 18:57:59 bbaia Exp $</version>
public class ConsoleLoggingBeforeAdvice : IMethodBeforeAdvice
{
public void Before(MethodInfo method, object[] args, object target)
{
Console.Out.WriteLine("Intercepted call to this method : " + method.Name);
Console.Out.WriteLine(" The target is : " + target);
Console.Out.WriteLine(" The arguments are : ");
if(args != null)
{
foreach (object arg in args)
{
Console.Out.WriteLine("\t: " + arg);
}
}
}
}
}

View File

@@ -0,0 +1,46 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using System.Reflection;
using Spring.Aop;
#endregion
namespace Spring.AopQuickStart.Aspects
{
/// <summary>
/// Simple implementation of the <see cref="Spring.Aop.IThrowsAdvice"/> interface
/// for a logging aspect using <see cref="System.Console"/>.
/// </summary>
/// <author>Rick Evans</author>
/// <version>$Id: ConsoleLoggingThrowsAdvice.cs,v 1.2 2006/12/02 13:30:00 bbaia Exp $</version>
public class ConsoleLoggingThrowsAdvice : IThrowsAdvice
{
public void AfterThrowing(Exception ex)
{
Console.Error.WriteLine(
String.Format("Advised method threw this exception : {0}", ex.Message));
}
}
}

View File

@@ -0,0 +1,49 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
#endregion
namespace Spring.AopQuickStart.Commands
{
/// <summary>
/// A simple interface for Command pattern style usage.
/// </summary>
/// <remarks>
/// <p>
/// Does not strictly adhere to the common conventions of the
/// Command patten, due to the fact that the remit of this interface
/// (and of it's attendant implementations) is to serve as the
/// basis for illustrating AOP advice.
/// </p>
/// </remarks>
/// <author>Rick Evans</author>
/// <version>$Id: ICommand.cs,v 1.1 2006/11/26 18:58:00 bbaia Exp $</version>
public interface ICommand
{
bool IsUndoCapable { get; }
void Execute();
void UnExecute();
}
}

View File

@@ -0,0 +1,59 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
#endregion
namespace Spring.AopQuickStart.Commands
{
/// <summary>
/// Simple implementation of the
/// <see cref="Spring.AopQuickStart.Commands.ICommand"/> interface.
/// </summary>
/// <author>Rick Evans</author>
/// <version>$Id: ServiceCommand.cs,v 1.3 2007/02/06 17:40:52 aseovic Exp $</version>
public class ServiceCommand : ICommand
{
#region ICommand Members
public bool IsUndoCapable
{
get { return true; }
}
public void Execute()
{
Console.Out.WriteLine("--- ServiceCommand implementation : Execute()... ---");
}
public void UnExecute()
{
Console.Out.WriteLine("--- ServiceCommand implementation : UnExecute()... ---");
// Uncomment to see IThrowAdvice implementation in action
//throw new Exception("The method or operation is not supported.");
}
#endregion
}
}

View File

@@ -0,0 +1,120 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{C707543A-8F0E-4483-AECC-BC6EE14C3A29}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.AopQuickStart.Common"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.AopQuickStart"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = "Spring.Examples.AopQuickStart.Application"
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "Spring.Aop"
AssemblyName = "Spring.Aop"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Aop.dll"
/>
<Reference
Name = "Spring.Core"
AssemblyName = "Spring.Core"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Core.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "Aspects\ConsoleLoggingAfterAdvice.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Aspects\ConsoleLoggingAroundAdvice.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Aspects\ConsoleLoggingBeforeAdvice.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Aspects\ConsoleLoggingThrowsAdvice.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Commands\ICommand.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Commands\ServiceCommand.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,104 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C707543A-8F0E-4483-AECC-BC6EE14C3A29}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Spring.AopQuickStart.Common</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>Spring.AopQuickStart</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Spring.Aop, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
</Reference>
<Reference Include="Spring.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
</Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Aspects\ConsoleLoggingAroundAdvice.cs" />
<Compile Include="Aspects\ConsoleLoggingBeforeAdvice.cs" />
<Compile Include="Aspects\ConsoleLoggingAfterAdvice.cs" />
<Compile Include="Aspects\ConsoleLoggingThrowsAdvice.cs" />
<Compile Include="Commands\ICommand.cs" />
<Compile Include="Commands\ServiceCommand.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" ?>
<project name="Spring.AopQuickStart.Common" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* current.build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines for C# compiler
-->
<target name="build">
<csc target="library"
define="${current.build.defines.csc}"
warnaserror="true"
debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.dll">
<sources failonempty="true">
<include name="**/*.cs" />
</sources>
<nowarn>
<warning number="${nowarn.numbers}" />
</nowarn>
<references basedir="${current.bin.dir}">
<include name="Spring.Core.dll" />
<include name="Spring.Aop.dll" />
</references>
</csc>
</target>
</project>

View File

@@ -0,0 +1,73 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using Spring.Aop.Framework;
using Spring.AopQuickStart.Aspects;
using Spring.AopQuickStart.Commands;
#endregion
namespace Spring.AopQuickStart
{
/// <summary>
/// A simple application that demonstrates the AOP functionality of Spring.NET.
/// </summary>
/// <version>$Id: Program.cs,v 1.2 2006/12/02 13:30:00 bbaia Exp $</version>
public class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static void Main(string[] args)
{
try
{
// Create AOP proxy programmatically.
ProxyFactory factory = new ProxyFactory(new ServiceCommand());
factory.AddAdvice(new ConsoleLoggingBeforeAdvice());
factory.AddAdvice(new ConsoleLoggingAfterAdvice());
factory.AddAdvice(new ConsoleLoggingThrowsAdvice());
ICommand command = (ICommand)factory.GetProxy();
command.Execute();
if (command.IsUndoCapable)
{
command.UnExecute();
}
}
catch (Exception ex)
{
Console.Out.WriteLine();
Console.Out.WriteLine(ex);
}
finally
{
Console.Out.WriteLine();
Console.Out.WriteLine("--- hit <return> to quit ---");
Console.ReadLine();
}
}
}
}

View File

@@ -0,0 +1,100 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{72D32026-23F5-4C62-8E6C-BFB30210BFD3}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.AopQuickStart.Step1"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.AopQuickStart"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = "Spring.AopQuickStart.Program"
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "Spring.AopQuickStart.Common.2003"
Project = "{C707543A-8F0E-4483-AECC-BC6EE14C3A29}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Spring.Core"
AssemblyName = "Spring.Core"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Core.dll"
/>
<Reference
Name = "Spring.Aop"
AssemblyName = "Spring.Aop"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Aop.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "Program.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,59 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1B3559A0-5274-4968-A628-77F036984F02}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring.AopQuickStart</RootNamespace>
<AssemblyName>Spring.AopQuickStart.Step1</AssemblyName>
<StartupObject>Spring.AopQuickStart.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Spring.Aop, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
</Reference>
<Reference Include="Spring.Core, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Spring.AopQuickStart.Common\Spring.AopQuickStart.Common.2005.csproj">
<Project>{C707543A-8F0E-4483-AECC-BC6EE14C3A29}</Project>
<Name>Spring.AopQuickStart.Common.2005</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" ?>
<project name="Spring.AopQuickStart.Step1" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* current.build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines for C# compiler
-->
<target name="build">
<csc target="exe"
define="${current.build.defines.csc}"
warnaserror="true"
debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.exe">
<sources failonempty="true">
<include name="**/*.cs" />
</sources>
<nowarn>
<warning number="${nowarn.numbers}" />
</nowarn>
<references basedir="${current.bin.dir}">
<include name="Spring.AopQuickStart.Common.dll" />
<include name="Spring.Core.dll" />
<include name="Spring.Aop.dll" />
</references>
</csc>
</target>
</project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
</configSections>
<spring>
<context>
<resource uri="config://spring/objects" />
</context>
<objects xmlns="http://www.springframework.net">
<description>An example that demonstrates simple AOP functionality.</description>
<object id="aroundAdvice"
type="Spring.AopQuickStart.Aspects.ConsoleLoggingAroundAdvice, Spring.AopQuickStart.Common" />
<object id="throwsAdvice"
type="Spring.AopQuickStart.Aspects.ConsoleLoggingThrowsAdvice, Spring.AopQuickStart.Common" />
<object id="myServiceCommand" type="Spring.Aop.Framework.ProxyFactoryObject">
<property name="Target">
<object type="Spring.AopQuickStart.Commands.ServiceCommand, Spring.AopQuickStart.Common" />
</property>
<property name="InterceptorNames">
<list>
<value>aroundAdvice</value>
<value>throwsAdvice</value>
</list>
</property>
</object>
</objects>
</spring>
</configuration>

View File

@@ -0,0 +1,70 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using Spring.Context;
using Spring.Context.Support;
using Spring.AopQuickStart.Commands;
#endregion
namespace Spring.AopQuickStart
{
/// <summary>
/// A simple application that demonstrates the AOP functionality of Spring.NET.
/// </summary>
/// <version>$Id: Program.cs,v 1.2 2006/12/02 13:30:00 bbaia Exp $</version>
public class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static void Main(string[] args)
{
try
{
// Create AOP proxy using Spring.NET IoC container.
IApplicationContext ctx = ContextRegistry.GetContext();
ICommand command = (ICommand)ctx["myServiceCommand"];
command.Execute();
if (command.IsUndoCapable)
{
command.UnExecute();
}
}
catch (Exception ex)
{
Console.Out.WriteLine();
Console.Out.WriteLine(ex);
}
finally
{
Console.Out.WriteLine();
Console.Out.WriteLine("--- hit <return> to quit ---");
Console.ReadLine();
}
}
}
}

View File

@@ -0,0 +1,104 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{202672D3-F523-4C62-8E6C-BFB30210BFD3}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.AopQuickStart.Step2"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.AopQuickStart"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = "Spring.AopQuickStart.Program"
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "Spring.AopQuickStart.Common.2003"
Project = "{C707543A-8F0E-4483-AECC-BC6EE14C3A29}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Spring.Aop"
AssemblyName = "Spring.Aop"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Aop.dll"
/>
<Reference
Name = "Spring.Core"
AssemblyName = "Spring.Core"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Core.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "App.config"
BuildAction = "None"
/>
<File
RelPath = "Program.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,62 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4ACE3EB7-B60A-4ACE-B4BB-2C33494D6108}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring.AopQuickStart</RootNamespace>
<AssemblyName>Spring.AopQuickStart.Step2</AssemblyName>
<StartupObject>Spring.AopQuickStart.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Spring.Aop, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
</Reference>
<Reference Include="Spring.Core, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Spring.AopQuickStart.Common\Spring.AopQuickStart.Common.2005.csproj">
<Project>{C707543A-8F0E-4483-AECC-BC6EE14C3A29}</Project>
<Name>Spring.AopQuickStart.Common.2005</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" ?>
<project name="Spring.AopQuickStart.Step2" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* current.build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines for C# compiler
-->
<target name="build">
<csc target="exe"
define="${current.build.defines.csc}"
warnaserror="true"
debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.exe">
<sources failonempty="true">
<include name="**/*.cs" />
</sources>
<nowarn>
<warning number="${nowarn.numbers}" />
</nowarn>
<references basedir="${current.bin.dir}">
<include name="Spring.AopQuickStart.Common.dll" />
<include name="Spring.Core.dll" />
<include name="Spring.Aop.dll" />
</references>
</csc>
<copy tofile="${current.bin.dir}/${project::get-name()}.exe.config"
file="App.config" overwrite="true">
</copy>
</target>
</project>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
</configSections>
<spring>
<context>
<resource uri="config://spring/objects" />
</context>
<objects xmlns="http://www.springframework.net">
<description>An example that demonstrates use of a poincut.</description>
<object id="aroundAdvisor" type="Spring.Aop.Support.NameMatchMethodPointcutAdvisor, Spring.Aop">
<property name="Advice">
<object type="Spring.AopQuickStart.Aspects.ConsoleLoggingAroundAdvice, Spring.AopQuickStart.Common" />
</property>
<property name="MappedNames">
<list>
<value>*Execute</value>
</list>
</property>
</object>
<object id="throwsAdvice"
type="Spring.AopQuickStart.Aspects.ConsoleLoggingThrowsAdvice, Spring.AopQuickStart.Common" />
<object id="myServiceCommand" type="Spring.Aop.Framework.ProxyFactoryObject">
<property name="Target">
<object type="Spring.AopQuickStart.Commands.ServiceCommand, Spring.AopQuickStart.Common" />
</property>
<property name="InterceptorNames">
<list>
<value>aroundAdvisor</value>
<value>throwsAdvice</value>
</list>
</property>
</object>
</objects>
</spring>
</configuration>

View File

@@ -0,0 +1,70 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using Spring.Context;
using Spring.Context.Support;
using Spring.AopQuickStart.Commands;
#endregion
namespace Spring.AopQuickStart
{
/// <summary>
/// A simple application that uses a pointcut.
/// </summary>
/// <version>$Id: Program.cs,v 1.2 2007/07/26 00:50:11 bbaia Exp $</version>
public class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static void Main(string[] args)
{
try
{
// Create AOP proxy using Spring.NET IoC container.
IApplicationContext ctx = ContextRegistry.GetContext();
ICommand command = (ICommand)ctx["myServiceCommand"];
command.Execute();
if (command.IsUndoCapable)
{
command.UnExecute();
}
}
catch (Exception ex)
{
Console.Out.WriteLine();
Console.Out.WriteLine(ex);
}
finally
{
Console.Out.WriteLine();
Console.Out.WriteLine("--- hit <return> to quit ---");
Console.ReadLine();
}
}
}
}

View File

@@ -0,0 +1,104 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{BFB30210-4C62-F523-8E6C-202672D3BFD3}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.AopQuickStart.Step3"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.AopQuickStart"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "Spring.AopQuickStart.Common.2003"
Project = "{C707543A-8F0E-4483-AECC-BC6EE14C3A29}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Spring.Aop"
AssemblyName = "Spring.Aop"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Aop.dll"
/>
<Reference
Name = "Spring.Core"
AssemblyName = "Spring.Core"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Core.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "App.config"
BuildAction = "None"
/>
<File
RelPath = "Program.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,62 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2C33494D-B4BB-4ACE-B60A-4ACE3EB76108}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring.AopQuickStart</RootNamespace>
<AssemblyName>Spring.AopQuickStart.Step3</AssemblyName>
<StartupObject>Spring.AopQuickStart.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Spring.Aop, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
</Reference>
<Reference Include="Spring.Core, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Spring.AopQuickStart.Common\Spring.AopQuickStart.Common.2005.csproj">
<Project>{C707543A-8F0E-4483-AECC-BC6EE14C3A29}</Project>
<Name>Spring.AopQuickStart.Common.2005</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" ?>
<project name="Spring.AopQuickStart.Step3" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* current.build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines for C# compiler
-->
<target name="build">
<csc target="exe"
define="${current.build.defines.csc}"
warnaserror="true"
debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.exe">
<sources failonempty="true">
<include name="**/*.cs" />
</sources>
<nowarn>
<warning number="${nowarn.numbers}" />
</nowarn>
<references basedir="${current.bin.dir}">
<include name="Spring.AopQuickStart.Common.dll" />
<include name="Spring.Core.dll" />
<include name="Spring.Aop.dll" />
</references>
</csc>
<copy tofile="${current.bin.dir}/${project::get-name()}.exe.config"
file="App.config" overwrite="true">
</copy>
</target>
</project>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
</configSections>
<spring>
<context>
<resource uri="config://spring/objects" />
</context>
<objects xmlns="http://www.springframework.net">
<description>An example that demonstrates use of a poincut.</description>
<object id="aroundAdvisor" type="Spring.Aop.Support.AttributeMatchMethodPointcutAdvisor, Spring.Aop">
<property name="Advice">
<object type="Spring.AopQuickStart.Aspects.ConsoleLoggingAdvice, Spring.AopQuickStart.Step4" />
</property>
<property name="Attribute"
value="Spring.AopQuickStart.Attributes.ConsoleLoggingAttribute, Spring.AopQuickStart.Step4" />
</object>
<object id="throwsAdvice"
type="Spring.AopQuickStart.Aspects.ConsoleLoggingThrowsAdvice, Spring.AopQuickStart.Common" />
<object id="myServiceCommand" type="Spring.Aop.Framework.ProxyFactoryObject">
<property name="Target">
<object type="Spring.AopQuickStart.Commands.AnotherServiceCommand, Spring.AopQuickStart.Step4" />
</property>
<property name="InterceptorNames">
<list>
<value>aroundAdvisor</value>
<value>throwsAdvice</value>
</list>
</property>
</object>
</objects>
</spring>
</configuration>

View File

@@ -0,0 +1,90 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using AopAlliance.Intercept;
using Spring.AopQuickStart.Attributes;
#endregion
namespace Spring.AopQuickStart.Aspects
{
/// <summary>
/// Simple implementation of the <see cref="AopAlliance.Intercept.IMethodInterceptor"/> interface
/// for a logging aspect using <see cref="System.Console"/> and informations from the
/// <see cref="Spring.AopQuickStart.Attributes.ConsoleLoggingAttribute" /> attribute.
/// </summary>
/// <author>Bruno Baia</author>
/// <version>$Id: ConsoleLoggingAdvice.cs,v 1.2 2006/12/03 23:56:28 bbaia Exp $</version>
public class ConsoleLoggingAdvice : IMethodInterceptor
{
#if NET_2_0
private ConsoleColor _color = ConsoleColor.Gray;
public ConsoleColor Color
{
get { return _color; }
set { _color = value; }
}
public object Invoke(IMethodInvocation invocation)
{
ConsoleLoggingAttribute[] consoleLoggingInfo =
(ConsoleLoggingAttribute[])invocation.Method.GetCustomAttributes(typeof(ConsoleLoggingAttribute), false);
if (consoleLoggingInfo.Length > 0)
{
Color = consoleLoggingInfo[0].Color;
}
ConsoleColor currentColor = Console.ForegroundColor;
Console.ForegroundColor = Color;
Console.Out.WriteLine(String.Format(
"Intercepted call : about to invoke method '{0}'", invocation.Method.Name));
Console.ForegroundColor = currentColor;
object returnValue = invocation.Proceed();
Console.ForegroundColor = Color;
Console.Out.WriteLine(String.Format(
"Intercepted call : returned '{0}'", returnValue));
Console.ForegroundColor = currentColor;
return returnValue;
}
#else
public object Invoke(IMethodInvocation invocation)
{
Console.Out.WriteLine("Intercepted call : about to invoke next item in chain...");
object returnValue = invocation.Proceed();
Console.Out.WriteLine("Intercepted call : returned " + returnValue);
return returnValue;
}
#endif
}
}

View File

@@ -0,0 +1,70 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
#endregion
namespace Spring.AopQuickStart.Attributes
{
/// <summary>
/// This attribute can be used to mark properties and methods
/// on which each call should be logged.
/// </summary>
/// <author>Bruno Baia</author>
/// <version>$Id: ConsoleLoggingAttribute.cs,v 1.1 2006/12/02 13:30:02 bbaia Exp $</version>
public class ConsoleLoggingAttribute : Attribute
{
#if NET_2_0
private ConsoleColor _color = ConsoleColor.Gray;
/// <summary>
/// Gets or sets the foreground color of the console.
/// </summary>
public ConsoleColor Color
{
get { return _color; }
set { _color = value; }
}
/// <summary>
/// Creates a new instance of the
/// <see cref="Spring.AopQuickStart.Attributes.ConsoleLoggingAttribute"/> class.
/// </summary>
/// <param name="level">
/// The foreground color of the console.
/// </param>
public ConsoleLoggingAttribute(ConsoleColor color)
{
_color = color;
}
#endif
/// <summary>
/// Creates a new instance of the
/// <see cref="Spring.AopQuickStart.Attributes.ConsoleLoggingAttribute"/> class.
/// </summary>
public ConsoleLoggingAttribute()
{
}
}
}

View File

@@ -0,0 +1,66 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using Spring.AopQuickStart.Attributes;
#endregion
namespace Spring.AopQuickStart.Commands
{
/// <summary>
/// Another simple implementation of the
/// <see cref="Spring.Examples.AopQuickStart.ICommand"/> interface.
/// </summary>
/// <author>Bruno Baia</author>
/// <version>$Id: AnotherServiceCommand.cs,v 1.1 2006/12/02 13:30:02 bbaia Exp $</version>
public class AnotherServiceCommand : ICommand
{
#region ICommand Members
public bool IsUndoCapable
{
get { return true; }
}
#if NET_2_0
[ConsoleLogging(Color = ConsoleColor.Red)]
#else
[ConsoleLogging]
#endif
public void Execute()
{
Console.Out.WriteLine("--- AnotherServiceCommand implementation : Execute()... ---");
}
public void UnExecute()
{
Console.Out.WriteLine("--- AnotherServiceCommand implementation : UnExecute()... ---");
// Uncomment to see IThrowAdvice implementation in action
//throw new Exception("The method or operation is not supported.");
}
#endregion
}
}

View File

@@ -0,0 +1,70 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using Spring.Context;
using Spring.Context.Support;
using Spring.AopQuickStart.Commands;
#endregion
namespace Spring.AopQuickStart
{
/// <summary>
/// A simple application that uses a pointcut.
/// </summary>
/// <version>$Id: Program.cs,v 1.2 2007/07/26 00:50:11 bbaia Exp $</version>
public class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static void Main(string[] args)
{
try
{
// Create AOP proxy using Spring.NET IoC container.
IApplicationContext ctx = ContextRegistry.GetContext();
ICommand command = (ICommand)ctx["myServiceCommand"];
command.Execute();
if (command.IsUndoCapable)
{
command.UnExecute();
}
}
catch (Exception ex)
{
Console.Out.WriteLine();
Console.Out.WriteLine(ex);
}
finally
{
Console.Out.WriteLine();
Console.Out.WriteLine("--- hit <return> to quit ---");
Console.ReadLine();
}
}
}
}

View File

@@ -0,0 +1,119 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{672D3BFD-4C62-F523-8E6C-20BFB3021023}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.AopQuickStart.Step4"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.AopQuickStart"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "Spring.AopQuickStart.Common.2003"
Project = "{C707543A-8F0E-4483-AECC-BC6EE14C3A29}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Spring.Aop"
AssemblyName = "Spring.Aop"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Aop.dll"
/>
<Reference
Name = "Spring.Core"
AssemblyName = "Spring.Core"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Core.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "App.config"
BuildAction = "None"
/>
<File
RelPath = "Program.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Aspects\ConsoleLoggingAdvice.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Attributes\ConsoleLoggingAttribute.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Commands\AnotherServiceCommand.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,67 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3EB76108-4ACE-4ACE-B60A-B4BB3EB76108}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring.AopQuickStart</RootNamespace>
<AssemblyName>Spring.AopQuickStart.Step4</AssemblyName>
<StartupObject>Spring.AopQuickStart.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Spring.Aop, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
</Reference>
<Reference Include="Spring.Core, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Aspects\ConsoleLoggingAdvice.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Attributes\ConsoleLoggingAttribute.cs" />
<Compile Include="Commands\AnotherServiceCommand.cs" />
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Spring.AopQuickStart.Common\Spring.AopQuickStart.Common.2005.csproj">
<Project>{C707543A-8F0E-4483-AECC-BC6EE14C3A29}</Project>
<Name>Spring.AopQuickStart.Common.2005</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" ?>
<project name="Spring.AopQuickStart.Step4" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* current.build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines for C# compiler
-->
<target name="build">
<csc target="exe"
define="${current.build.defines.csc}"
warnaserror="true"
debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.exe">
<sources failonempty="true">
<include name="**/*.cs" />
</sources>
<nowarn>
<warning number="${nowarn.numbers}" />
</nowarn>
<references basedir="${current.bin.dir}">
<include name="Spring.AopQuickStart.Common.dll" />
<include name="Spring.Core.dll" />
<include name="Spring.Aop.dll" />
</references>
</csc>
<copy tofile="${current.bin.dir}/${project::get-name()}.exe.config"
file="App.config" overwrite="true">
</copy>
</target>
</project>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
</configSections>
<spring>
<context>
<resource uri="config://spring/objects" />
</context>
<objects xmlns="http://www.springframework.net">
<description>An example that demonstrates use of a custom poincut.</description>
<object id="aroundAdvisor"
type="Spring.AopQuickStart.Aspects.ExpressionDynamicPointcutAdvisor, Spring.AopQuickStart.Step5">
<property name="Advice">
<object type="Spring.AopQuickStart.Aspects.ConsoleLoggingAroundAdvice, Spring.AopQuickStart.Common" />
</property>
<property name="Expression" value="MethodInfo.ReturnType == T(System.Void) and Args == null" />
</object>
<object id="throwsAdvice"
type="Spring.AopQuickStart.Aspects.ConsoleLoggingThrowsAdvice, Spring.AopQuickStart.Common" />
<object id="myServiceCommand" type="Spring.Aop.Framework.ProxyFactoryObject">
<property name="Target">
<object type="Spring.AopQuickStart.Commands.ServiceCommand, Spring.AopQuickStart.Common" />
</property>
<property name="InterceptorNames">
<list>
<value>aroundAdvisor</value>
<value>throwsAdvice</value>
</list>
</property>
</object>
</objects>
</spring>
</configuration>

View File

@@ -0,0 +1,136 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using System.Reflection;
using Spring.Expressions;
using Spring.Aop.Support;
#endregion
namespace Spring.AopQuickStart.Aspects
{
/// <summary>
/// Dynamic pointcut using Spring expressions.
/// </summary>
/// <author>Bruno Baia</author>
/// <version>$Id: ExpressionDynamicPointcutAdvisor.cs,v 1.1 2007/07/26 00:50:11 bbaia Exp $</version>
public class ExpressionDynamicPointcutAdvisor : DynamicMethodMatcherPointcutAdvisor
{
private string expression;
public string Expression
{
get { return expression; }
set { expression = value; }
}
/// <summary>
/// Is there a runtime (dynamic) match for the supplied method ?
/// </summary>
public override bool Matches(MethodInfo method, Type targetType, object[] args)
{
IExpression expr = Spring.Expressions.Expression.Parse(Expression);
MatchingInfoHolder infoHolder = new MatchingInfoHolder(method, targetType, args);
try
{
// Evaluate the expression using the current matching info as current context
return (bool)expr.GetValue(infoHolder);
}
catch (Exception e)
{
throw new ArgumentException(
"Expression cannot be evaluate or not return a boolean.", "Expression", e);
}
}
#region MatchingInfoHolder inner class definition
public class MatchingInfoHolder
{
#region Fields
private MethodInfo _methodInfo;
private Type _targetType;
private object[] _args;
#endregion
#region Properties
/// <summary>
/// Get or sets the candidate method.
/// </summary>
public MethodInfo MethodInfo
{
get { return _methodInfo; }
set { _methodInfo = value; }
}
/// <summary>
/// Gets or sets the target type.
/// </summary>
public Type TargetType
{
get { return _targetType; }
set { _targetType = value; }
}
/// <summary>
/// Gets or sets the arguments to the method.
/// </summary>
public object[] Args
{
get { return _args; }
set { _args = value; }
}
#endregion
#region Constructor(s) / Destructor
/// <summary>
/// Creates a new instance of the
/// <see cref="Spring.AopQuickStart.Aspects.ExpressionDynamicPoincutAdvisor+MatchingInfoHolder"/> class.
/// </summary>
public MatchingInfoHolder()
{
}
/// <summary>
/// Creates a new instance of the
/// <see cref="Spring.AopQuickStart.Aspects.ExpressionDynamicPoincutAdvisor+MatchingInfoHolder"/> class.
/// </summary>
public MatchingInfoHolder(MethodInfo methodInfo, Type targetType, object[] args)
{
_methodInfo = methodInfo;
_targetType = targetType;
_args = args;
}
#endregion
}
#endregion
}
}

View File

@@ -0,0 +1,70 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using Spring.Context;
using Spring.Context.Support;
using Spring.AopQuickStart.Commands;
#endregion
namespace Spring.AopQuickStart
{
/// <summary>
/// A simple application that uses a custom pointcut.
/// </summary>
/// <version>$Id: Program.cs,v 1.2 2007/07/26 00:50:11 bbaia Exp $</version>
public class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static void Main(string[] args)
{
try
{
// Create AOP proxy using Spring.NET IoC container.
IApplicationContext ctx = ContextRegistry.GetContext();
ICommand command = (ICommand)ctx["myServiceCommand"];
command.Execute();
if (command.IsUndoCapable)
{
command.UnExecute();
}
}
catch (Exception ex)
{
Console.Out.WriteLine();
Console.Out.WriteLine(ex);
}
finally
{
Console.Out.WriteLine();
Console.Out.WriteLine("--- hit <return> to quit ---");
Console.ReadLine();
}
}
}
}

View File

@@ -0,0 +1,114 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{F5233BFD-8E6C-FB30-4C62-20BFB3021023}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.AopQuickStart.Step5"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.AopQuickStart"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "Spring.AopQuickStart.Common.2003"
Project = "{C707543A-8F0E-4483-AECC-BC6EE14C3A29}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Spring.Aop"
AssemblyName = "Spring.Aop"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Aop.dll"
/>
<Reference
Name = "Spring.Core"
AssemblyName = "Spring.Core"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Core.dll"
/>
<Reference
Name = "antlr.runtime"
AssemblyName = "antlr.runtime"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\antlr.runtime.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "App.config"
BuildAction = "None"
/>
<File
RelPath = "Program.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Aspects\ExpressionDynamicPointcutAdvisor.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,67 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{61086108-3EB7-4ACE-B4B6-B4B60AB76108}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring.AopQuickStart</RootNamespace>
<AssemblyName>Spring.AopQuickStart.Step5</AssemblyName>
<StartupObject>Spring.AopQuickStart.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="antlr.runtime, Version=2.7.6.2, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\antlr.runtime.dll</HintPath>
</Reference>
<Reference Include="Spring.Aop, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
</Reference>
<Reference Include="Spring.Core, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Aspects\ExpressionDynamicPointcutAdvisor.cs" />
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Spring.AopQuickStart.Common\Spring.AopQuickStart.Common.2005.csproj">
<Project>{C707543A-8F0E-4483-AECC-BC6EE14C3A29}</Project>
<Name>Spring.AopQuickStart.Common.2005</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" ?>
<project name="Spring.AopQuickStart.Step5" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* current.build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines for C# compiler
-->
<target name="build">
<csc target="exe"
define="${current.build.defines.csc}"
warnaserror="true"
debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.exe">
<sources failonempty="true">
<include name="**/*.cs" />
</sources>
<nowarn>
<warning number="${nowarn.numbers}" />
</nowarn>
<references basedir="${current.bin.dir}">
<include name="Spring.AopQuickStart.Common.dll" />
<include name="antlr.runtime.dll" />
<include name="Spring.Core.dll" />
<include name="Spring.Aop.dll" />
</references>
</csc>
<copy tofile="${current.bin.dir}/${project::get-name()}.exe.config"
file="App.config" overwrite="true">
</copy>
</target>
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
</configuration>

View File

@@ -0,0 +1,26 @@
namespace Spring.AopQuickStart
{
public class Contact
{
private string firstName;
public virtual string FirstName
{
get { return firstName; }
set { firstName = value; }
}
private string lastName;
public virtual string LastName
{
get { return lastName; }
set { lastName = value; }
}
private string emailAddress;
public virtual string EmailAddress
{
get { return emailAddress; }
set { emailAddress = value; }
}
}
}

View File

@@ -0,0 +1,7 @@
namespace Spring.AopQuickStart
{
public interface IIsModified
{
bool IsModified { get; set; }
}
}

View File

@@ -0,0 +1,23 @@
using AopAlliance.Aop;
using Spring.Aop.Support;
namespace Spring.AopQuickStart
{
public class IsModifiedMixin : IIsModified, IAdvice
{
private bool isModified = false;
public virtual bool IsModified
{
get { return isModified; }
set { isModified = value; }
}
}
public class IsModifiedAdvisor : DefaultIntroductionAdvisor
{
public IsModifiedAdvisor()
: base(new IsModifiedMixin())
{}
}
}

View File

@@ -0,0 +1,64 @@
using System;
using System.Reflection;
using AopAlliance.Intercept;
using Spring.Aop.Framework;
namespace Spring.AopQuickStart
{
public class ModificationAdvice : IMethodInterceptor
{
public virtual Object Invoke(IMethodInvocation invocation)
{
MethodInfo method = invocation.Method;
object proxy = invocation.Proxy;
if (proxy is IIsModified)
{
IIsModified obj = (IIsModified) proxy;
if (IsSetter(method))
{
obj.IsModified = HasModificationOccured(method, invocation.This, invocation.Arguments);
}
}
return invocation.Proceed();
}
private bool HasModificationOccured(MethodInfo setter, Object target, Object[] args)
{
PropertyInfo property = target.GetType().GetProperty(setter.Name.Substring(4));
if (property != null)
{
// modification check is unimportant
// for write only methods
Object newVal = args[0];
Object oldVal = property.GetValue(target, null);
if ((newVal == null) && (oldVal == null))
{
return false;
}
else if ((newVal == null) && (oldVal != null))
{
return true;
}
else if ((newVal != null) && (oldVal == null))
{
return true;
}
else
{
return (!newVal.Equals(oldVal));
}
}
return false;
}
private bool IsSetter(MethodInfo method)
{
return (method.Name.StartsWith("set_")) && (method.GetParameters().Length == 1);
}
}
}

View File

@@ -0,0 +1,34 @@
using System;
using Spring.Aop;
using Spring.Aop.Support;
namespace Spring.AopQuickStart
{
public class ModificationAdvisor : DefaultPointcutAdvisor
{
public ModificationAdvisor(Type type)
: base(new SetterPointcut(type), new ModificationAdvice())
{}
private class SetterPointcut : IPointcut
{
private IMethodMatcher methodMatcher = TrueMethodMatcher.True;
private ITypeFilter typeFilter;
public SetterPointcut(Type type)
{
typeFilter = new RootTypeFilter(type);
}
public ITypeFilter TypeFilter
{
get { return typeFilter; }
}
public IMethodMatcher MethodMatcher
{
get { return methodMatcher; }
}
}
}
}

View File

@@ -0,0 +1,83 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using Spring.Aop.Framework;
#endregion
namespace Spring.AopQuickStart
{
/// <summary>
/// A simple application that uses an introduction.
/// </summary>
/// <version>$Id: Program.cs,v 1.4 2007/07/26 00:50:11 bbaia Exp $</version>
public class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static void Main(string[] args)
{
try
{
Contact contact = GetProxy();
IIsModified modificationWatcher = (IIsModified)contact;
contact.FirstName = "Aleksandar";
if (modificationWatcher.IsModified)
Console.WriteLine("Should not flag as modification");
contact.FirstName = "Goran";
if (modificationWatcher.IsModified)
Console.WriteLine("Should flag as modification");
}
catch (Exception ex)
{
Console.Out.WriteLine();
Console.Out.WriteLine(ex);
}
finally
{
Console.Out.WriteLine();
Console.Out.WriteLine("--- hit <return> to quit ---");
Console.ReadLine();
}
}
private static Contact GetProxy()
{
Contact target = new Contact();
target.FirstName = "Aleksandar";
target.LastName = "Seovic";
ProxyFactory pf = new ProxyFactory(target);
pf.AddAdvisor(new ModificationAdvisor(target.GetType()));
pf.AddIntroduction(new IsModifiedAdvisor());
pf.ProxyTargetType = true;
return (Contact)pf.GetProxy();
}
}
}

View File

@@ -0,0 +1,124 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{8E620210-4D33-F523-BF6C-202672CBBFD3}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.AopQuickStart.Step6"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.AopQuickStart"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "Spring.Aop"
AssemblyName = "Spring.Aop"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Aop.dll"
/>
<Reference
Name = "Spring.Core"
AssemblyName = "Spring.Core"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Core.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "App.config"
BuildAction = "None"
/>
<File
RelPath = "Contact.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "IIsModified.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "IsModifiedMixin.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ModificationAdvice.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ModificationAdvisor.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Program.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,61 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AB33BB4D-B449-4AC1-760A-4ACE3EA56108}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring.AopQuickStart</RootNamespace>
<AssemblyName>Spring.AopQuickStart.Step6</AssemblyName>
<StartupObject>Spring.AopQuickStart.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Spring.Aop, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
</Reference>
<Reference Include="Spring.Core, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Contact.cs" />
<Compile Include="IIsModified.cs" />
<Compile Include="IsModifiedMixin.cs" />
<Compile Include="ModificationAdvice.cs" />
<Compile Include="ModificationAdvisor.cs" />
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" ?>
<project name="Spring.AopQuickStart.Step6" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* current.build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines for C# compiler
-->
<target name="build">
<csc target="exe"
define="${current.build.defines.csc}"
warnaserror="true"
debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.exe">
<sources failonempty="true">
<include name="**/*.cs" />
</sources>
<nowarn>
<warning number="${nowarn.numbers}" />
</nowarn>
<references basedir="${current.bin.dir}">
<include name="Spring.AopQuickStart.Common.dll" />
<include name="Spring.Core.dll" />
<include name="Spring.Aop.dll" />
</references>
</csc>
<copy tofile="${current.bin.dir}/${project::get-name()}.exe.config"
file="App.config" overwrite="true">
</copy>
</target>
</project>

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
</configSections>
<spring>
<context>
<resource uri="config://spring/objects" />
</context>
<objects xmlns="http://www.springframework.net">
<description>An example that demonstrates use of AutoProxy functionality.</description>
<!-- Services definitions -->
<object id="myServiceCommand"
type="Spring.AopQuickStart.Commands.ServiceCommand, Spring.AopQuickStart.Common" />
<object id="myAnotherServiceCommand"
type="Spring.AopQuickStart.Commands.AnotherServiceCommand, Spring.AopQuickStart.Step7" />
<!-- The rest of the config file is common no matter how many objects you add -->
<object id="aroundAdvisor" type="Spring.Aop.Support.NameMatchMethodPointcutAdvisor, Spring.Aop">
<property name="Advice">
<object type="Spring.AopQuickStart.Aspects.ConsoleLoggingAroundAdvice, Spring.AopQuickStart.Common" />
</property>
<property name="MappedNames">
<list>
<value>*Execute</value>
</list>
</property>
</object>
<!-- Using ObjectNameAutoProxyCreator -->
<!-- Apply 'aroundAdvisor' on all objects with id that ends by 'Command' -->
<object type="Spring.Aop.Framework.AutoProxy.ObjectNameAutoProxyCreator, Spring.Aop">
<property name="ObjectNames">
<list>
<value>*Command</value>
</list>
</property>
<property name="InterceptorNames">
<list>
<value>aroundAdvisor</value>
</list>
</property>
</object>
<!-- Or Using DefaultAdvisorAutoProxyCreator -->
<!-- Apply all avalaible IAdvisors to all objects -->
<!--<object type="Spring.Aop.Framework.AutoProxy.DefaultAdvisorAutoProxyCreator, Spring.Aop" />-->
</objects>
</spring>
</configuration>

View File

@@ -0,0 +1,59 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
#endregion
namespace Spring.AopQuickStart.Commands
{
/// <summary>
/// Another simple implementation of the
/// <see cref="Spring.Examples.AopQuickStart.ICommand"/> interface.
/// </summary>
/// <author>Bruno Baia</author>
/// <version>$Id: AnotherServiceCommand.cs,v 1.1 2006/12/02 13:30:03 bbaia Exp $</version>
public class AnotherServiceCommand : ICommand
{
#region ICommand Members
public bool IsUndoCapable
{
get { return true; }
}
public void Execute()
{
Console.Out.WriteLine("--- AnotherServiceCommand implementation : Execute()... ---");
}
public void UnExecute()
{
Console.Out.WriteLine("--- AnotherServiceCommand implementation : UnExecute()... ---");
// Uncomment to see IThrowAdvice implementation in action
//throw new Exception("The method or operation is not supported.");
}
#endregion
}
}

View File

@@ -0,0 +1,70 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using System.Collections;
using Spring.Context;
using Spring.Context.Support;
using Spring.AopQuickStart.Commands;
#endregion
namespace Spring.AopQuickStart
{
/// <summary>
/// A simple application that uses AutoProxy functionality.
/// </summary>
/// <version>$Id: Program.cs,v 1.1 2006/12/02 13:30:03 bbaia Exp $</version>
public class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static void Main(string[] args)
{
try
{
// Create AOP proxy using Spring.NET IoC container.
IApplicationContext ctx = ContextRegistry.GetContext();
IDictionary commands = ctx.GetObjectsOfType(typeof(ICommand));
foreach (ICommand command in commands.Values)
{
command.Execute();
}
}
catch (Exception ex)
{
Console.Out.WriteLine();
Console.Out.WriteLine(ex);
}
finally
{
Console.Out.WriteLine();
Console.Out.WriteLine("--- hit <return> to quit ---");
Console.ReadLine();
}
}
}
}

View File

@@ -0,0 +1,109 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.AopQuickStart.Step7"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.AopQuickStart"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "Spring.AopQuickStart.Common.2003"
Project = "{C707543A-8F0E-4483-AECC-BC6EE14C3A29}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Spring.Aop"
AssemblyName = "Spring.Aop"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Aop.dll"
/>
<Reference
Name = "Spring.Core"
AssemblyName = "Spring.Core"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Core.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "App.config"
BuildAction = "None"
/>
<File
RelPath = "Program.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Commands\AnotherServiceCommand.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,63 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0077A8CA-4C09-42B1-B227-91095CE4CCA2}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Spring.AopQuickStart</RootNamespace>
<AssemblyName>Spring.AopQuickStart.Step7</AssemblyName>
<StartupObject>Spring.AopQuickStart.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Spring.Aop, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
</Reference>
<Reference Include="Spring.Core, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Commands\AnotherServiceCommand.cs" />
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Spring.AopQuickStart.Common\Spring.AopQuickStart.Common.2005.csproj">
<Project>{C707543A-8F0E-4483-AECC-BC6EE14C3A29}</Project>
<Name>Spring.AopQuickStart.Common.2005</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" ?>
<project name="Spring.AopQuickStart.Step7" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* current.build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines for C# compiler
-->
<target name="build">
<csc target="exe"
define="${current.build.defines.csc}"
warnaserror="true"
debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.exe">
<sources failonempty="true">
<include name="**/*.cs" />
</sources>
<nowarn>
<warning number="${nowarn.numbers}" />
</nowarn>
<references basedir="${current.bin.dir}">
<include name="Spring.AopQuickStart.Common.dll" />
<include name="Spring.Core.dll" />
<include name="Spring.Aop.dll" />
</references>
</csc>
<copy tofile="${current.bin.dir}/${project::get-name()}.exe.config"
file="App.config" overwrite="true">
</copy>
</target>
</project>

View File

@@ -0,0 +1,73 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.Services.2003", "src\Spring.Calculator.Services\Spring.Calculator.Services.2003.csproj", "{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.Contract.2003", "src\Spring.Calculator.Contract\Spring.Calculator.Contract.2003.csproj", "{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.RemoteApp.2003", "src\Spring.Calculator.RemoteApp\Spring.Calculator.RemoteApp.2003.csproj", "{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.ClientApp.2003", "src\Spring.Calculator.ClientApp\Spring.Calculator.ClientApp.2003.csproj", "{F202BB75-CEFD-400B-9CD3-0914F466EBF5}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.Web.2003", "http://localhost/Spring.Calculator.2003/Spring.Calculator.Web.2003.csproj", "{1AA797F9-51F7-43FE-BDFE-6AC8C1CACC0B}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Aspects.2003", "src\Spring.Aspects\Spring.Aspects.2003.csproj", "{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.RegisterComponentServices.2003", "src\Spring.Calculator.RegisterComponentServices\Spring.Calculator.RegisterComponentServices.2003.csproj", "{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Debug.ActiveCfg = Debug|.NET
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Debug.Build.0 = Debug|.NET
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Release.ActiveCfg = Release|.NET
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Release.Build.0 = Release|.NET
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Debug.ActiveCfg = Debug|.NET
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Debug.Build.0 = Debug|.NET
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Release.ActiveCfg = Release|.NET
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Release.Build.0 = Release|.NET
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Debug.ActiveCfg = Debug|.NET
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Debug.Build.0 = Debug|.NET
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Release.ActiveCfg = Release|.NET
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Release.Build.0 = Release|.NET
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Debug.ActiveCfg = Debug|.NET
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Debug.Build.0 = Debug|.NET
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Release.ActiveCfg = Release|.NET
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Release.Build.0 = Release|.NET
{1AA797F9-51F7-43FE-BDFE-6AC8C1CACC0B}.Debug.ActiveCfg = Debug|.NET
{1AA797F9-51F7-43FE-BDFE-6AC8C1CACC0B}.Debug.Build.0 = Debug|.NET
{1AA797F9-51F7-43FE-BDFE-6AC8C1CACC0B}.Release.ActiveCfg = Release|.NET
{1AA797F9-51F7-43FE-BDFE-6AC8C1CACC0B}.Release.Build.0 = Release|.NET
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Debug.ActiveCfg = Debug|.NET
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Debug.Build.0 = Debug|.NET
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Release.ActiveCfg = Release|.NET
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Release.Build.0 = Release|.NET
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Debug.ActiveCfg = Debug|.NET
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Debug.Build.0 = Debug|.NET
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Release.ActiveCfg = Release|.NET
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(SolutionItems) = postSolution
readme.txt = readme.txt
SpringCalculator.snk = SpringCalculator.snk
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,125 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.Services.2005", "src\Spring.Calculator.Services\Spring.Calculator.Services.2005.csproj", "{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.Contract.2005", "src\Spring.Calculator.Contract\Spring.Calculator.Contract.2005.csproj", "{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.RemoteApp.2005", "src\Spring.Calculator.RemoteApp\Spring.Calculator.RemoteApp.2005.csproj", "{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.ClientApp.2005", "src\Spring.Calculator.ClientApp\Spring.Calculator.ClientApp.2005.csproj", "{F202BB75-CEFD-400B-9CD3-0914F466EBF5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Aspects.2005", "src\Spring.Aspects\Spring.Aspects.2005.csproj", "{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Calculator.RegisterComponentServices.2005", "src\Spring.Calculator.RegisterComponentServices\Spring.Calculator.RegisterComponentServices.2005.csproj", "{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B1FF7E1F-9BF9-4EB3-B38C-39A0E3EA4D0A}"
ProjectSection(SolutionItems) = preProject
readme.txt = readme.txt
SpringCalculator.snk = SpringCalculator.snk
EndProjectSection
EndProject
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "D:\...\Spring.Calculator.Web.2005\", "src\Spring.Calculator.Web.2005", "{9697F719-BA0B-492E-ABAE-6132A8FCEC45}"
ProjectSection(WebsiteProperties) = preProject
ProjectReferences = "{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}|Spring.Aspects.dll;{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}|Spring.Calculator.Contract.dll;{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}|Spring.Calculator.Services.dll;"
Debug.AspNetCompiler.VirtualPath = "/Spring.Calculator.Web.2005"
Debug.AspNetCompiler.PhysicalPath = "Spring.Calculator.Web.2005\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\Spring.Calculator.Web.2005\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/Spring.Calculator.Web.2005"
Release.AspNetCompiler.PhysicalPath = "Spring.Calculator.Web.2005\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\Spring.Calculator.Web.2005\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "1643"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|.NET = Debug|.NET
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Release|.NET = Release|.NET
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Debug|.NET.ActiveCfg = Debug|Any CPU
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Release|.NET.ActiveCfg = Release|Any CPU
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Release|Any CPU.Build.0 = Release|Any CPU
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Debug|.NET.ActiveCfg = Debug|Any CPU
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Release|.NET.ActiveCfg = Release|Any CPU
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Release|Any CPU.Build.0 = Release|Any CPU
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Debug|.NET.ActiveCfg = Debug|Any CPU
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Release|.NET.ActiveCfg = Release|Any CPU
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Release|Any CPU.Build.0 = Release|Any CPU
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{78B542F5-0CE3-4EDD-ACF7-3B2C619ADFC1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Debug|.NET.ActiveCfg = Debug|Any CPU
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Release|.NET.ActiveCfg = Release|Any CPU
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Release|Any CPU.Build.0 = Release|Any CPU
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F202BB75-CEFD-400B-9CD3-0914F466EBF5}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Debug|.NET.ActiveCfg = Debug|Any CPU
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Release|.NET.ActiveCfg = Release|Any CPU
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Release|Any CPU.Build.0 = Release|Any CPU
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Debug|.NET.ActiveCfg = Debug|Any CPU
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Release|.NET.ActiveCfg = Release|Any CPU
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Release|Any CPU.Build.0 = Release|Any CPU
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{75E2042D-1FCF-42F1-8FB9-0C6C40AE4ACD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{9697F719-BA0B-492E-ABAE-6132A8FCEC45}.Debug|.NET.ActiveCfg = Debug|.NET
{9697F719-BA0B-492E-ABAE-6132A8FCEC45}.Debug|.NET.Build.0 = Debug|.NET
{9697F719-BA0B-492E-ABAE-6132A8FCEC45}.Debug|Any CPU.ActiveCfg = Debug|.NET
{9697F719-BA0B-492E-ABAE-6132A8FCEC45}.Debug|Mixed Platforms.ActiveCfg = Debug|.NET
{9697F719-BA0B-492E-ABAE-6132A8FCEC45}.Debug|Mixed Platforms.Build.0 = Debug|.NET
{9697F719-BA0B-492E-ABAE-6132A8FCEC45}.Release|.NET.ActiveCfg = Debug|.NET
{9697F719-BA0B-492E-ABAE-6132A8FCEC45}.Release|.NET.Build.0 = Debug|.NET
{9697F719-BA0B-492E-ABAE-6132A8FCEC45}.Release|Any CPU.ActiveCfg = Debug|.NET
{9697F719-BA0B-492E-ABAE-6132A8FCEC45}.Release|Mixed Platforms.ActiveCfg = Debug|.NET
{9697F719-BA0B-492E-ABAE-6132A8FCEC45}.Release|Mixed Platforms.Build.0 = Debug|.NET
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" ?>
<project name="Spring.Calculator" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<target name="build">
<nant buildfile="src\Spring.Aspects\Spring.Aspects.build" target="build" />
<nant buildfile="src\Spring.Calculator.Contract\Spring.Calculator.Contract.build" target="build"/>
<nant buildfile="src\Spring.Calculator.Services\Spring.Calculator.Services.build" target="build" />
<nant buildfile="src\Spring.Calculator.RemoteApp\Spring.Calculator.RemoteApp.build" target="build" />
<nant buildfile="src\Spring.Calculator.RegisterComponentServices\Spring.Calculator.RegisterComponentServices.build" target="build" />
<nant buildfile="src\Spring.Calculator.ClientApp\Spring.Calculator.ClientApp.build" target="build"/>
</target>
</project>

View File

@@ -0,0 +1,13 @@
In order to be able to run the Calculator example with VS2003 you will need
to create 'Spring.Calculator.2003' virtual directory using IIS Administrator and point it to :
"examples\Spring\Spring.Calculator\Spring.Calculator.Web.2003"
Documentation related to this example :
http://www.springframework.net/doc-latest/reference/html/remoting-quickstart.html

View File

@@ -0,0 +1,36 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
using System;
using System.Reflection;
[assembly: AssemblyTitle("Spring Aspect library")]
[assembly: AssemblyDescription("Aspect library using Spring.Aop for examples")]
[assembly: AssemblyVersion("1.0.0.0")]
#if !NET_2_0
[assembly: AssemblyConfiguration("net-1.1.win32; Release")]
#else
[assembly: AssemblyConfiguration("net-2.0.win32; Release")]
#endif
[assembly: AssemblyCompany("http://www.springframework.net")]
[assembly: AssemblyProduct("Spring.NET Framework")]
[assembly: AssemblyCopyright("Copyright 2002-2006 Spring.NET Framework Team.")]
[assembly: AssemblyTrademark("Apache License, Version 2.0")]

View File

@@ -0,0 +1,103 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using AopAlliance.Intercept;
using Common.Logging;
#endregion
namespace Spring.Aspects.Logging
{
/// <summary>
/// Basic implementation of a logging aspect using Common.Logging library.
/// </summary>
/// <author>Bruno Baia</author>
/// <version>$Id: CommonLoggingAroundAdvice.cs,v 1.2 2007/06/27 16:00:42 bbaia Exp $</version>
public class CommonLoggingAroundAdvice : IMethodInterceptor
{
#region Logging
private static readonly ILog LOG = LogManager.GetLogger(typeof(CommonLoggingAroundAdvice));
#endregion
#region Fields
private LogLevel _level = LogLevel.All;
#endregion
#region Properties
public LogLevel Level
{
get { return _level; }
set { _level = value; }
}
#endregion
#region IMethodInterceptor Members
public object Invoke(IMethodInvocation invocation)
{
Log("Intercepted call : about to invoke method '{0}'", invocation.Method.Name);
object returnValue = invocation.Proceed();
Log("Intercepted call : returned '{0}'", returnValue);
return returnValue;
}
#endregion
#region Private Methods
private void Log(string text, params object[] args)
{
switch(Level)
{
case LogLevel.All :
case LogLevel.Debug :
if (LOG.IsDebugEnabled) LOG.Debug(String.Format(text, args));
break;
case LogLevel.Error :
if (LOG.IsErrorEnabled) LOG.Error(String.Format(text, args));
break;
case LogLevel.Fatal :
if (LOG.IsFatalEnabled) LOG.Fatal(String.Format(text, args));
break;
case LogLevel.Info :
if (LOG.IsInfoEnabled) LOG.Info(String.Format(text, args));
break;
case LogLevel.Warn :
if (LOG.IsWarnEnabled) LOG.Warn(String.Format(text, args));
break;
case LogLevel.Off:
default :
break;
}
}
#endregion
}
}

View File

@@ -0,0 +1,93 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using System.IO;
using AopAlliance.Intercept;
#endregion
namespace Spring.Aspects.Logging
{
/// <summary>
/// Basic implementation of a logging aspect using <see cref="System.Console"/>.
/// </summary>
/// <author>Bruno Baia</author>
/// <version>$Id: ConsoleLoggingAroundAdvice.cs,v 1.1 2006/11/26 12:26:34 bbaia Exp $</version>
public class ConsoleLoggingAroundAdvice : IMethodInterceptor
{
#region Fields
#if NET_2_0
private ConsoleColor _foregroundColor = ConsoleColor.Gray;
#endif
#endregion
#region Properties
#if NET_2_0
/// <summary>
/// Gets or sets the foreground color of the console.
/// </summary>
public ConsoleColor ForegroundColor
{
get { return _foregroundColor; }
set { _foregroundColor = value; }
}
#else
/// <summary>
/// The ConsoleColor is only avalaible since 2.0 only.
/// </summary>
/// <remarks>
/// Avoid dependency injection errors.
/// </remarks>
public string ForegroundColor
{
get { throw new Exception("The method or operation is not supported."); }
set { }
}
#endif
#endregion
#region IMethodInterceptor Members
public object Invoke(IMethodInvocation invocation)
{
#if NET_2_0
ConsoleColor previousColor = Console.ForegroundColor;
Console.ForegroundColor = _foregroundColor;
#endif
Console.Out.WriteLine(String.Format("Intercepted call : about to invoke method '{0}'", invocation.Method.Name));
object returnValue = invocation.Proceed();
Console.Out.WriteLine(String.Format("Intercepted call : returned '{0}'", returnValue));
#if NET_2_0
Console.ForegroundColor = previousColor;
#endif
return returnValue;
}
#endregion
}
}

View File

@@ -0,0 +1,105 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.Aspects"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.Aspects"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\system.dll"
/>
<Reference
Name = "Spring.Aop"
AssemblyName = "Spring.Aop"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Aop.dll"
/>
<Reference
Name = "Common.Logging"
AssemblyName = "Common.Logging"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Common.Logging.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Logging\CommonLoggingAroundAdvice.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Logging\ConsoleLoggingAroundAdvice.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,104 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Spring.Aspects</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>Spring.Aspects</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;NET_2_0,STRONG</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=1.1.0.2, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Common.Logging.dll</HintPath>
</Reference>
<Reference Include="Spring.Aop, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
</Reference>
<Reference Include="System">
<Name>System</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Logging\ConsoleLoggingAroundAdvice.cs" />
<Compile Include="Logging\CommonLoggingAroundAdvice.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" ?>
<project name="Spring.Aspects" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines
-->
<target name="build">
<csc target="library" define="${current.build.defines.csc}"
warnaserror="false" debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.dll">
<sources failonempty="true">
<include name="**/*.cs" />
</sources>
<nowarn>
<warning number="${nowarn.numbers}" />
</nowarn>
<references basedir="${current.bin.dir}">
<include name="log4net.dll" />
<include name="Common.Logging.dll"/>
<include name="Spring.Aop.dll" />
</references>
</csc>
</target>
</project>

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
<section name="parsers" type="Spring.Context.Support.NamespaceParsersSectionHandler, Spring.Core" />
</sectionGroup>
</configSections>
<spring>
<parsers>
<parser type="Spring.Remoting.Config.RemotingNamespaceParser, Spring.Services" />
</parsers>
<context>
<resource uri="config://spring/objects" />
<!-- Only one at a time ! -->
<!-- ================================== -->
<!-- In process (local) implementations -->
<!-- ================================== -->
<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.InProcess/inProcess.xml" />
<!-- ======================== -->
<!-- Remoting implementations -->
<!-- ======================== -->
<!-- Make sure 'RemoteApp' console application is running and listening. -->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.Remoting/cao.xml" />-->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.Remoting/cao-aop.xml" />-->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.Remoting/cao-ctor.xml" />-->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.Remoting/saoSingleton.xml" />-->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.Remoting/saoSingleton-aop.xml" />-->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.Remoting/saoSingleCall.xml" />-->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.Remoting/saoSingleCall-aop.xml" />-->
<!-- =========================== -->
<!-- Web Service implementations -->
<!-- =========================== -->
<!-- Web.Services VS2003 -->
<!-- Make sure 'http://localhost/SpringCalculator/' web application is running -->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.WebServices2003/webServices.xml" />-->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.WebServices2003/webServices-aop.xml" />-->
<!-- Web.Services VS2005 -->
<!-- Make sure 'http://localhost:1643/Spring.Calculator.Web.2005/' web application is running -->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.WebServices2005/webServices.xml" />-->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.WebServices2005/webServices-aop.xml" />-->
<!-- ================================= -->
<!-- EnterpriseService implementations -->
<!-- ================================= -->
<!-- Make sure you register components with 'RegisterComponentServices' console application. -->
<!--<resource uri="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.EnterpriseServices/enterpriseServices.xml" />-->
</context>
<objects xmlns="http://www.springframework.net">
<description>Definitions of objects to be exported.</description>
<object id="ConsoleLoggingAroundAdvice" type="Spring.Aspects.Logging.ConsoleLoggingAroundAdvice, Spring.Aspects">
<property name="ForegroundColor" value="Red" />
</object>
</objects>
</spring>
</configuration>

View File

@@ -0,0 +1,36 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
using System;
using System.Reflection;
[assembly: AssemblyTitle("Spring Calculator client application")]
[assembly: AssemblyDescription("Client application for Spring Calculator example")]
[assembly: AssemblyVersion("1.0.0.0")]
#if !NET_2_0
[assembly: AssemblyConfiguration("net-1.1.win32; Release")]
#else
[assembly: AssemblyConfiguration("net-2.0.win32; Release")]
#endif
[assembly: AssemblyCompany("http://www.springframework.net")]
[assembly: AssemblyProduct("Spring.NET Framework")]
[assembly: AssemblyCopyright("Copyright 2002-2006 Spring.NET Framework Team.")]
[assembly: AssemblyTrademark("Apache License, Version 2.0")]

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<description>enterpriseServices</description>
<object id="calculatorService" type="Spring.EnterpriseServices.ServicedComponentFactory, Spring.Services">
<property name="Name" value="calculatorComponent" />
<!-- To allow dependency injection (Optional)
<property name="ProductTemplate">
<object>
<property name="MyProperty" value="MyValue" />
</object>
</property>
-->
</object>
</objects>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<description>inProcess</description>
<object id="calculatorService" type="Spring.Calculator.Services.AdvancedCalculator, Spring.Calculator.Services" />
</objects>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:r="http://www.springframework.net/remoting">
<description>cao</description>
<r:caoFactory id="remoteCalculatorService" remoteTargetName="prototypeCalculatorWeaved"
serviceUrl="tcp://localhost:8005" />
<!--
Old fashion way without remoting config parser...
<object id="remoteCalculatorService" type="Spring.Remoting.CaoFactoryObject, Spring.Services">
<property name="RemoteTargetName" value="prototypeCalculatorWeaved" />
<property name="ServiceUrl" value="tcp://localhost:8005" />
</object>
-->
<object id="calculatorService" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
<property name="target" ref="remoteCalculatorService"/>
<property name="interceptorNames">
<list>
<value>ConsoleLoggingAroundAdvice</value>
</list>
</property>
<property name="ProxyInterfaces">
<list>
<value>Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract</value>
</list>
</property>
</object>
</objects>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:r="http://www.springframework.net/remoting">
<description>Not supported</description>
</objects>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:r="http://www.springframework.net/remoting">
<description>cao</description>
<r:caoFactory id="calculatorService" remoteTargetName="prototypeCalculator"
serviceUrl="tcp://localhost:8005">
<r:constructor-args>
<value type="int">3</value>
</r:constructor-args>
</r:caoFactory>
<!--
Old fashion way without remoting config parser...
<object id="calculatorService" type="Spring.Remoting.CaoFactoryObject, Spring.Services">
<property name="RemoteTargetName" value="prototypeCalculator" />
<property name="ServiceUrl" value="tcp://localhost:8005" />
<property name="constructorArguments">
<list>
<value type="int">3</value>
</list>
</property>
</object>
-->
</objects>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:r="http://www.springframework.net/remoting">
<description>cao</description>
<r:caoFactory id="calculatorService" remoteTargetName="prototypeCalculator"
serviceUrl="tcp://localhost:8005" />
<!--
Old fashion way without remoting config parser...
<object id="calculatorService" type="Spring.Remoting.CaoFactoryObject, Spring.Services">
<property name="RemoteTargetName" value="prototypeCalculator" />
<property name="ServiceUrl" value="tcp://localhost:8005" />
</object>
-->
</objects>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:r="http://www.springframework.net/remoting">
<description>saoSingleCall-aop</description>
<r:saoFactory id="remoteCalculatorService"
serviceInterface="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"
serviceUrl="tcp://localhost:8005/RemotedSaoSingleCallCalculatorWeaved"/>
<!--
Old fashion way without remoting config parser...
<object id="remoteCalculatorService" type="Spring.Remoting.SaoFactoryObject, Spring.Services">
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract" />
<property name="ServiceUrl" value="tcp://localhost:8005/RemotedSaoSingleCallCalculatorWeaved" />
</object>
-->
<object id="calculatorService" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
<property name="target" ref="remoteCalculatorService"/>
<property name="interceptorNames">
<list>
<value>ConsoleLoggingAroundAdvice</value>
</list>
</property>
<property name="ProxyInterfaces">
<list>
<value>Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract</value>
</list>
</property>
</object>
</objects>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:r="http://www.springframework.net/remoting">
<description>saoSingleCall</description>
<r:saoFactory id="calculatorService"
serviceInterface="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"
serviceUrl="tcp://localhost:8005/RemotedSaoSingleCallCalculator"/>
<!--
Old fashion way without remoting config parser...
<object id="calculatorService" type="Spring.Remoting.SaoFactoryObject, Spring.Services">
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract" />
<property name="ServiceUrl" value="tcp://localhost:8005/RemotedSaoSingleCallCalculator" />
</object>
-->
</objects>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:r="http://www.springframework.net/remoting">
<description>saoSingleton-aop</description>
<r:saoFactory id="remoteCalculatorService"
serviceInterface="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"
serviceUrl="tcp://localhost:8005/RemotedSaoSingletonCalculatorWeaved"/>
<!--
Old fashion way without remoting config parser...
<object id="remoteCalculatorService" type="Spring.Remoting.SaoFactoryObject, Spring.Services">
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract" />
<property name="ServiceUrl" value="tcp://localhost:8005/RemotedSaoSingletonCalculatorWeaved" />
</object>
-->
<object id="calculatorService" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
<property name="target" ref="remoteCalculatorService"/>
<property name="interceptorNames">
<list>
<value>ConsoleLoggingAroundAdvice</value>
</list>
</property>
<property name="ProxyInterfaces">
<list>
<value>Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract</value>
</list>
</property>
</object>
</objects>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"
xmlns:r="http://www.springframework.net/remoting">
<description>saoSingleton</description>
<r:saoFactory id="calculatorService"
serviceInterface="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"
serviceUrl="tcp://localhost:8005/RemotedSaoSingletonCalculator"/>
<!--
Old fashion way without remoting config parser...
<object id="calculatorService" type="Spring.Remoting.SaoFactoryObject, Spring.Services">
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract" />
<property name="ServiceUrl" value="tcp://localhost:8005/RemotedSaoSingletonCalculator" />
</object>
-->
</objects>

View File

@@ -0,0 +1,272 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://SpringCalculator/WebServices" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://SpringCalculator/WebServices" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://SpringCalculator/WebServices">
<s:element name="MemoryAdd">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="num" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="MemoryAddResponse">
<s:complexType />
</s:element>
<s:element name="MemoryClear">
<s:complexType />
</s:element>
<s:element name="MemoryClearResponse">
<s:complexType />
</s:element>
<s:element name="SetMemory">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="memoryValue" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SetMemoryResponse">
<s:complexType />
</s:element>
<s:element name="GetMemory">
<s:complexType />
</s:element>
<s:element name="GetMemoryResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="GetMemoryResult" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Multiply">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="n1" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="n2" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="MultiplyResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="MultiplyResult" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Divide">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="n1" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="n2" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="DivideResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DivideResult" type="tns:DivisionResult" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="DivisionResult">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Quotient" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="Rest" type="s:int" />
</s:sequence>
</s:complexType>
<s:element name="Substract">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="n1" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="n2" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SubstractResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="SubstractResult" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Add">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="n1" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="n2" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="AddResult" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="MemoryAddSoapIn">
<wsdl:part name="parameters" element="tns:MemoryAdd" />
</wsdl:message>
<wsdl:message name="MemoryAddSoapOut">
<wsdl:part name="parameters" element="tns:MemoryAddResponse" />
</wsdl:message>
<wsdl:message name="MemoryClearSoapIn">
<wsdl:part name="parameters" element="tns:MemoryClear" />
</wsdl:message>
<wsdl:message name="MemoryClearSoapOut">
<wsdl:part name="parameters" element="tns:MemoryClearResponse" />
</wsdl:message>
<wsdl:message name="SetMemorySoapIn">
<wsdl:part name="parameters" element="tns:SetMemory" />
</wsdl:message>
<wsdl:message name="SetMemorySoapOut">
<wsdl:part name="parameters" element="tns:SetMemoryResponse" />
</wsdl:message>
<wsdl:message name="GetMemorySoapIn">
<wsdl:part name="parameters" element="tns:GetMemory" />
</wsdl:message>
<wsdl:message name="GetMemorySoapOut">
<wsdl:part name="parameters" element="tns:GetMemoryResponse" />
</wsdl:message>
<wsdl:message name="MultiplySoapIn">
<wsdl:part name="parameters" element="tns:Multiply" />
</wsdl:message>
<wsdl:message name="MultiplySoapOut">
<wsdl:part name="parameters" element="tns:MultiplyResponse" />
</wsdl:message>
<wsdl:message name="DivideSoapIn">
<wsdl:part name="parameters" element="tns:Divide" />
</wsdl:message>
<wsdl:message name="DivideSoapOut">
<wsdl:part name="parameters" element="tns:DivideResponse" />
</wsdl:message>
<wsdl:message name="SubstractSoapIn">
<wsdl:part name="parameters" element="tns:Substract" />
</wsdl:message>
<wsdl:message name="SubstractSoapOut">
<wsdl:part name="parameters" element="tns:SubstractResponse" />
</wsdl:message>
<wsdl:message name="AddSoapIn">
<wsdl:part name="parameters" element="tns:Add" />
</wsdl:message>
<wsdl:message name="AddSoapOut">
<wsdl:part name="parameters" element="tns:AddResponse" />
</wsdl:message>
<wsdl:portType name="calculatorServiceSoap">
<wsdl:operation name="MemoryAdd">
<wsdl:input message="tns:MemoryAddSoapIn" />
<wsdl:output message="tns:MemoryAddSoapOut" />
</wsdl:operation>
<wsdl:operation name="MemoryClear">
<wsdl:input message="tns:MemoryClearSoapIn" />
<wsdl:output message="tns:MemoryClearSoapOut" />
</wsdl:operation>
<wsdl:operation name="SetMemory">
<wsdl:input message="tns:SetMemorySoapIn" />
<wsdl:output message="tns:SetMemorySoapOut" />
</wsdl:operation>
<wsdl:operation name="GetMemory">
<wsdl:input message="tns:GetMemorySoapIn" />
<wsdl:output message="tns:GetMemorySoapOut" />
</wsdl:operation>
<wsdl:operation name="Multiply">
<wsdl:input message="tns:MultiplySoapIn" />
<wsdl:output message="tns:MultiplySoapOut" />
</wsdl:operation>
<wsdl:operation name="Divide">
<wsdl:input message="tns:DivideSoapIn" />
<wsdl:output message="tns:DivideSoapOut" />
</wsdl:operation>
<wsdl:operation name="Substract">
<wsdl:input message="tns:SubstractSoapIn" />
<wsdl:output message="tns:SubstractSoapOut" />
</wsdl:operation>
<wsdl:operation name="Add">
<wsdl:input message="tns:AddSoapIn" />
<wsdl:output message="tns:AddSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="calculatorServiceSoap" type="tns:calculatorServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="MemoryAdd">
<soap:operation soapAction="http://SpringCalculator/WebServices/MemoryAdd" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="MemoryClear">
<soap:operation soapAction="http://SpringCalculator/WebServices/MemoryClear" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="SetMemory">
<soap:operation soapAction="http://SpringCalculator/WebServices/SetMemory" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetMemory">
<soap:operation soapAction="http://SpringCalculator/WebServices/GetMemory" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Multiply">
<soap:operation soapAction="http://SpringCalculator/WebServices/Multiply" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Divide">
<soap:operation soapAction="http://SpringCalculator/WebServices/Divide" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Substract">
<soap:operation soapAction="http://SpringCalculator/WebServices/Substract" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Add">
<soap:operation soapAction="http://SpringCalculator/WebServices/Add" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="calculatorService">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Spring Calculator Web Services</documentation>
<wsdl:port name="calculatorServiceSoap" binding="tns:calculatorServiceSoap">
<soap:address location="http://localhost/Spring.Calculator.2003/calculatorService.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<description>webServices-aop</description>
<object id="webCalculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
<property name="ServiceUri" value="http://localhost/Spring.Calculator.2003/calculatorServiceWeaved.asmx"/>
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
</object>
<object id="calculatorService" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
<property name="target" ref="webCalculatorService"/>
<property name="interceptorNames">
<list>
<value>ConsoleLoggingAroundAdvice</value>
</list>
</property>
</object>
</objects>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<description>webServices</description>
<object id="calculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
<!--<property name="ServiceUri" value="http://localhost/Spring.Calculator.2003/calculatorService.asmx"/>-->
<property name="ServiceUri" value="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.WebServices2003/calculatorService.wsdl"/>
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
<!-- Dependency injection on Factory's product : the proxy instance of type SoapHttpClientProtocol -->
<property name="ProductTemplate">
<object>
<property name="Timeout" value="10000" /> <!-- 10s -->
</object>
</property>
</object>
</objects>

View File

@@ -0,0 +1,351 @@
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://SpringCalculator/WebServices" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://SpringCalculator/WebServices" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Spring Calculator Web Services</wsdl:documentation>
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://SpringCalculator/WebServices">
<s:element name="Add">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="n1" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="n2" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="AddResult" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Substract">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="n1" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="n2" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SubstractResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="SubstractResult" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Divide">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="n1" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="n2" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="DivideResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DivideResult" type="tns:DivisionResult" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="DivisionResult">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Quotient" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="Rest" type="s:int" />
</s:sequence>
</s:complexType>
<s:element name="Multiply">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="n1" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="n2" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="MultiplyResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="MultiplyResult" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetMemory">
<s:complexType />
</s:element>
<s:element name="GetMemoryResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="GetMemoryResult" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SetMemory">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="memoryValue" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SetMemoryResponse">
<s:complexType />
</s:element>
<s:element name="MemoryClear">
<s:complexType />
</s:element>
<s:element name="MemoryClearResponse">
<s:complexType />
</s:element>
<s:element name="MemoryAdd">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="num" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="MemoryAddResponse">
<s:complexType />
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="AddSoapIn">
<wsdl:part name="parameters" element="tns:Add" />
</wsdl:message>
<wsdl:message name="AddSoapOut">
<wsdl:part name="parameters" element="tns:AddResponse" />
</wsdl:message>
<wsdl:message name="SubstractSoapIn">
<wsdl:part name="parameters" element="tns:Substract" />
</wsdl:message>
<wsdl:message name="SubstractSoapOut">
<wsdl:part name="parameters" element="tns:SubstractResponse" />
</wsdl:message>
<wsdl:message name="DivideSoapIn">
<wsdl:part name="parameters" element="tns:Divide" />
</wsdl:message>
<wsdl:message name="DivideSoapOut">
<wsdl:part name="parameters" element="tns:DivideResponse" />
</wsdl:message>
<wsdl:message name="MultiplySoapIn">
<wsdl:part name="parameters" element="tns:Multiply" />
</wsdl:message>
<wsdl:message name="MultiplySoapOut">
<wsdl:part name="parameters" element="tns:MultiplyResponse" />
</wsdl:message>
<wsdl:message name="GetMemorySoapIn">
<wsdl:part name="parameters" element="tns:GetMemory" />
</wsdl:message>
<wsdl:message name="GetMemorySoapOut">
<wsdl:part name="parameters" element="tns:GetMemoryResponse" />
</wsdl:message>
<wsdl:message name="SetMemorySoapIn">
<wsdl:part name="parameters" element="tns:SetMemory" />
</wsdl:message>
<wsdl:message name="SetMemorySoapOut">
<wsdl:part name="parameters" element="tns:SetMemoryResponse" />
</wsdl:message>
<wsdl:message name="MemoryClearSoapIn">
<wsdl:part name="parameters" element="tns:MemoryClear" />
</wsdl:message>
<wsdl:message name="MemoryClearSoapOut">
<wsdl:part name="parameters" element="tns:MemoryClearResponse" />
</wsdl:message>
<wsdl:message name="MemoryAddSoapIn">
<wsdl:part name="parameters" element="tns:MemoryAdd" />
</wsdl:message>
<wsdl:message name="MemoryAddSoapOut">
<wsdl:part name="parameters" element="tns:MemoryAddResponse" />
</wsdl:message>
<wsdl:portType name="calculatorServiceSoap">
<wsdl:operation name="Add">
<wsdl:input message="tns:AddSoapIn" />
<wsdl:output message="tns:AddSoapOut" />
</wsdl:operation>
<wsdl:operation name="Substract">
<wsdl:input message="tns:SubstractSoapIn" />
<wsdl:output message="tns:SubstractSoapOut" />
</wsdl:operation>
<wsdl:operation name="Divide">
<wsdl:input message="tns:DivideSoapIn" />
<wsdl:output message="tns:DivideSoapOut" />
</wsdl:operation>
<wsdl:operation name="Multiply">
<wsdl:input message="tns:MultiplySoapIn" />
<wsdl:output message="tns:MultiplySoapOut" />
</wsdl:operation>
<wsdl:operation name="GetMemory">
<wsdl:input message="tns:GetMemorySoapIn" />
<wsdl:output message="tns:GetMemorySoapOut" />
</wsdl:operation>
<wsdl:operation name="SetMemory">
<wsdl:input message="tns:SetMemorySoapIn" />
<wsdl:output message="tns:SetMemorySoapOut" />
</wsdl:operation>
<wsdl:operation name="MemoryClear">
<wsdl:input message="tns:MemoryClearSoapIn" />
<wsdl:output message="tns:MemoryClearSoapOut" />
</wsdl:operation>
<wsdl:operation name="MemoryAdd">
<wsdl:input message="tns:MemoryAddSoapIn" />
<wsdl:output message="tns:MemoryAddSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="calculatorServiceSoap" type="tns:calculatorServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Add">
<soap:operation soapAction="http://SpringCalculator/WebServices/Add" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Substract">
<soap:operation soapAction="http://SpringCalculator/WebServices/Substract" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Divide">
<soap:operation soapAction="http://SpringCalculator/WebServices/Divide" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Multiply">
<soap:operation soapAction="http://SpringCalculator/WebServices/Multiply" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetMemory">
<soap:operation soapAction="http://SpringCalculator/WebServices/GetMemory" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="SetMemory">
<soap:operation soapAction="http://SpringCalculator/WebServices/SetMemory" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="MemoryClear">
<soap:operation soapAction="http://SpringCalculator/WebServices/MemoryClear" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="MemoryAdd">
<soap:operation soapAction="http://SpringCalculator/WebServices/MemoryAdd" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="calculatorServiceSoap12" type="tns:calculatorServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Add">
<soap12:operation soapAction="http://SpringCalculator/WebServices/Add" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Substract">
<soap12:operation soapAction="http://SpringCalculator/WebServices/Substract" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Divide">
<soap12:operation soapAction="http://SpringCalculator/WebServices/Divide" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Multiply">
<soap12:operation soapAction="http://SpringCalculator/WebServices/Multiply" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetMemory">
<soap12:operation soapAction="http://SpringCalculator/WebServices/GetMemory" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="SetMemory">
<soap12:operation soapAction="http://SpringCalculator/WebServices/SetMemory" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="MemoryClear">
<soap12:operation soapAction="http://SpringCalculator/WebServices/MemoryClear" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="MemoryAdd">
<soap12:operation soapAction="http://SpringCalculator/WebServices/MemoryAdd" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="calculatorService">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Spring Calculator Web Services</wsdl:documentation>
<wsdl:port name="calculatorServiceSoap" binding="tns:calculatorServiceSoap">
<soap:address location="http://localhost:1643/Spring.Calculator.Web.2005/calculatorService.asmx" />
</wsdl:port>
<wsdl:port name="calculatorServiceSoap12" binding="tns:calculatorServiceSoap12">
<soap12:address location="http://localhost:1643/Spring.Calculator.Web.2005/calculatorService.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<description>webServices-aop</description>
<object id="webCalculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
<property name="ServiceUri" value="http://localhost:1643/Spring.Calculator.Web.2005/calculatorServiceWeaved.asmx"/>
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
</object>
<object id="calculatorService" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
<property name="target" ref="webCalculatorService"/>
<property name="interceptorNames">
<list>
<value>ConsoleLoggingAroundAdvice</value>
</list>
</property>
</object>
</objects>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<description>webServices</description>
<object id="calculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
<!--<property name="ServiceUri" value="http://localhost:1643/Spring.Calculator.Web.2005/calculatorService.asmx"/>-->
<property name="ServiceUri" value="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.WebServices2005/calculatorService.wsdl"/>
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
<!-- Dependency injection on Factory's product : the proxy instance of type SoapHttpClientProtocol -->
<property name="ProductTemplate">
<object>
<property name="Timeout" value="10000" /><!-- 10s -->
</object>
</property>
</object>
</objects>

View File

@@ -0,0 +1,72 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
using Spring.Context;
using Spring.Context.Support;
using Spring.Calculator.Interfaces;
#endregion
namespace Spring.Calculator.ClientApp
{
class Program
{
[STAThread]
static void Main()
{
try
{
Pause();
IApplicationContext ctx = ContextRegistry.GetContext();
Console.WriteLine("Get Calculator...");
IAdvancedCalculator firstCalc = (IAdvancedCalculator) ctx.GetObject("calculatorService");
Console.WriteLine("Divide(11, 2) : " + firstCalc.Divide(11, 2));
Console.WriteLine("Memory = " + firstCalc.GetMemory());
firstCalc.MemoryAdd(2);
Console.WriteLine("Memory + 2 = " + firstCalc.GetMemory());
Console.WriteLine("Get Calculator...");
IAdvancedCalculator secondCalc = (IAdvancedCalculator) ctx.GetObject("calculatorService");
Console.WriteLine("Memory = " + secondCalc.GetMemory());
}
catch (Exception e)
{
Console.WriteLine(e);
}
finally
{
Pause();
}
}
public static void Pause()
{
Console.Write("--- Press <return> to continue ---");
Console.ReadLine();
}
}
}

View File

@@ -0,0 +1,181 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{F202BB75-CEFD-400B-9CD3-0914F466EBF5}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.Calculator.ClientApp"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.Calculator.ClientApp"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "system.web.services"
AssemblyName = "System.Web.Services"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\system.web.services.dll"
/>
<Reference
Name = "system"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\system.dll"
/>
<Reference
Name = "Spring.Aspects.2003"
Project = "{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Spring.Calculator.Contract.2003"
Project = "{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Spring.Calculator.Services.2003"
Project = "{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Spring.Services"
AssemblyName = "Spring.Services"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Services.dll"
/>
<Reference
Name = "Spring.Aop"
AssemblyName = "Spring.Aop"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Aop.dll"
/>
<Reference
Name = "Spring.Core"
AssemblyName = "Spring.Core"
HintPath = "..\..\..\..\..\bin\net\1.1\debug\Spring.Core.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "App.config"
BuildAction = "None"
/>
<File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Program.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Config\EnterpriseServices\enterpriseServices.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\InProcess\inProcess.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\Remoting\cao.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\Remoting\cao-aop.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\Remoting\cao-ctor.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\Remoting\cao-ctor-aop.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\Remoting\saoSingleCall.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\Remoting\saoSingleCall-aop.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\Remoting\saoSingleton.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\Remoting\saoSingleton-aop.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\WebServices2003\calculatorService.wsdl"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\WebServices2003\webServices.xml"
BuildAction = "EmbeddedResource"
/>
<File
RelPath = "Config\WebServices2003\webServices-aop.xml"
BuildAction = "EmbeddedResource"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,142 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F202BB75-CEFD-400B-9CD3-0914F466EBF5}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Spring.Calculator.ClientApp</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Exe</OutputType>
<RootNamespace>Spring.Calculator.ClientApp</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG;NET_2_0</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;NET_2_0</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Spring.Aspects\Spring.Aspects.2005.csproj">
<Name>Spring.Aspects.2003</Name>
<Project>{6B34626E-8D2A-4387-BBB6-CB352D4DBDEC}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
</ProjectReference>
<ProjectReference Include="..\Spring.Calculator.Contract\Spring.Calculator.Contract.2005.csproj">
<Name>Spring.Calculator.Contract.2003</Name>
<Project>{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
</ProjectReference>
<ProjectReference Include="..\Spring.Calculator.Services\Spring.Calculator.Services.2005.csproj">
<Name>Spring.Calculator.Services.2003</Name>
<Project>{D9FB04E5-D636-4EC2-A3AB-FAB1C4F37827}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
</ProjectReference>
<Reference Include="Spring.Aop, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Aop.dll</HintPath>
</Reference>
<Reference Include="Spring.Core, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Core.dll</HintPath>
</Reference>
<Reference Include="Spring.Services, Version=1.1.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\bin\net\2.0\debug\Spring.Services.dll</HintPath>
</Reference>
<Reference Include="System">
<Name>system</Name>
</Reference>
<Reference Include="System.Web.Services">
<Name>system.web.services</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Program.cs">
<SubType>Code</SubType>
</Compile>
<EmbeddedResource Include="Config\EnterpriseServices\enterpriseServices.xml" />
<EmbeddedResource Include="Config\InProcess\inProcess.xml" />
<EmbeddedResource Include="Config\Remoting\cao-aop.xml" />
<EmbeddedResource Include="Config\Remoting\cao-ctor-aop.xml" />
<EmbeddedResource Include="Config\Remoting\cao-ctor.xml" />
<EmbeddedResource Include="Config\Remoting\cao.xml" />
<EmbeddedResource Include="Config\Remoting\saoSingleCall-aop.xml" />
<EmbeddedResource Include="Config\Remoting\saoSingleCall.xml" />
<EmbeddedResource Include="Config\Remoting\saoSingleton-aop.xml" />
<EmbeddedResource Include="Config\Remoting\saoSingleton.xml" />
<EmbeddedResource Include="Config\WebServices2005\webServices-aop.xml" />
<EmbeddedResource Include="Config\WebServices2005\webServices.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Config\WebServices2005\calculatorService.wsdl" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" ?>
<project name="Spring.Calculator.ClientApp" default="build" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!--
Required properties:
* current.bin.dir - (path) root level to build to
* current.build.debug - (true|false) debug build?
* current.build.defines.csc - framework-specific build defines for C# compiler
-->
<target name="build">
<csc target="exe" define="${current.build.defines.csc}"
warnaserror="true" debug="${current.build.debug}"
output="${current.bin.dir}/${project::get-name()}.exe">
<sources failonempty="true">
<include name="**/*.cs" />
</sources>
<nowarn>
<warning number="${nowarn.numbers}" />
</nowarn>
<resources prefix="Spring.Calculator.ClientApp" dynamicprefix="true" failonempty="true">
<include name="**/*.xml" />
</resources>
<references basedir="${current.bin.dir}">
<include name="log4net.dll" />
<include name="Common.Logging.dll"/>
<include name="Spring.Core.dll" />
<include name="Spring.Aop.dll" />
<include name="Spring.Services.dll" />
<include name="Spring.Aspects.dll" />
<include name="Spring.Calculator.Contract.dll" />
<include name="Spring.Calculator.Services.dll" />
</references>
</csc>
<copy tofile="${current.bin.dir}/${project::get-name()}.exe.config"
file="App.config"
overwrite="true">
</copy>
</target>
</project>

View File

@@ -0,0 +1,43 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
using System;
using System.Reflection;
[assembly: AssemblyTitle("Spring Calculator contract")]
[assembly: AssemblyDescription("Contract for the Spring Calculator example")]
[assembly: AssemblyVersion("1.0.0.0")]
#if !NET_2_0
[assembly: AssemblyConfiguration("net-1.1.win32; Release")]
#else
[assembly: AssemblyConfiguration("net-2.0.win32; Release")]
#endif
[assembly: AssemblyCompany("http://www.springframework.net")]
[assembly: AssemblyProduct("Spring.NET Framework")]
[assembly: AssemblyCopyright("Copyright 2002-2006 Spring.NET Framework Team.")]
[assembly: AssemblyTrademark("Apache License, Version 2.0")]
#if STRONG
[assembly: AssemblyDelaySign(false)]
#if !NET_2_0
[assembly: AssemblyKeyFile(@"Spring.Calculator.snk")]
#endif
#endif

View File

@@ -0,0 +1,67 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using System;
#endregion
namespace Spring.Calculator.Domain
{
[Serializable]
public class DivisionResult
{
private int _quotient = 0;
private int _rest = 0;
/// <summary>
/// Gets or sets the quotient of the division.
/// </summary>
public int Quotient
{
get { return _quotient; }
set { _quotient = value; }
}
/// <summary>
/// Gets or sets the rest of the division.
/// </summary>
public int Rest
{
get { return _rest; }
set { _rest = value; }
}
/// <summary>
/// Creates a new instance of the <see cref="DivisionResult"/> class.
/// </summary>
public DivisionResult() {}
/// <summary>
/// Rrturns a string represantation of a division's result.
/// </summary>
/// <returns></returns>
public override string ToString()
{
return String.Format("Quotient: '{0}'; Rest: '{1}'", _quotient, _rest);
}
}
}

View File

@@ -0,0 +1,42 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
#endregion
namespace Spring.Calculator.Interfaces
{
/// <summary>
/// An advanced calculator service interface.
/// </summary>
/// <author>Bruno Baia</author>
/// <version>$Id: IAdvancedCalculator.cs,v 1.1 2006/10/29 18:39:04 bbaia Exp $</version>
public interface IAdvancedCalculator : ICalculator
{
int GetMemory();
void SetMemory(int memoryValue);
void MemoryClear();
void MemoryAdd(int num);
}
}

View File

@@ -0,0 +1,44 @@
#region License
/*
* Copyright <20> 2002-2006 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.
* 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.
*/
#endregion
#region Imports
using Spring.Calculator.Domain;
#endregion
namespace Spring.Calculator.Interfaces
{
/// <summary>
/// A simple calculator service interface.
/// </summary>
/// <author>Bruno Baia</author>
/// <version>$Id: ICalculator.cs,v 1.1 2006/10/29 18:39:04 bbaia Exp $</version>
public interface ICalculator
{
int Add(int n1, int n2);
int Substract(int n1, int n2);
DivisionResult Divide(int n1, int n2);
int Multiply(int n1, int n2);
}
}

View File

@@ -0,0 +1,94 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "Spring.Calculator.Contract"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Library"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = "Spring.Calculator"
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE;STRONG"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE;STRONG"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References/>
</Build>
<Files>
<Include>
<File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Domain\DivisionResult.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Interfaces\IAdvancedCalculator.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Interfaces\ICalculator.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,95 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{284C0873-BBB4-4399-B6F7-CB7EDBD001C7}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Spring.Calculator.Contract</AssemblyName>
<AssemblyOriginatorKeyFile>../../Spring.Calculator.snk</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>Spring.Calculator</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG;NET_2_0;STRONG</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;NET_2_0;STRONG</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Domain\DivisionResult.cs" />
<Compile Include="Interfaces\IAdvancedCalculator.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Interfaces\ICalculator.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

Some files were not shown because too many files have changed in this diff Show More