From fa1a9a235bbd5add4dd6c3e36e511083b0ceea8b Mon Sep 17 00:00:00 2001 From: lahma Date: Wed, 18 Jun 2008 10:57:48 +0000 Subject: [PATCH] First version of Quartz.NET integration example --- .../Spring.Scheduling.Quartz.Example.2003.sln | 31 +++++ .../Spring.Scheduling.Quartz.Example.2005.sln | 34 +++++ .../Spring.Scheduling.Quartz.Example.build | 8 ++ .../src/App.config | 11 ++ .../src/ExampleJob.cs | 41 ++++++ .../src/Program.cs | 23 ++++ ...ring.Scheduling.Quartz.Example.2003.csproj | 123 ++++++++++++++++++ ...ring.Scheduling.Quartz.Example.2005.csproj | 115 ++++++++++++++++ .../src/spring-objects.xml | 60 +++++++++ 9 files changed, 446 insertions(+) create mode 100644 examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2003.sln create mode 100644 examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2005.sln create mode 100644 examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.build create mode 100644 examples/Spring/Spring.Scheduling.Quartz.Example/src/App.config create mode 100644 examples/Spring/Spring.Scheduling.Quartz.Example/src/ExampleJob.cs create mode 100644 examples/Spring/Spring.Scheduling.Quartz.Example/src/Program.cs create mode 100644 examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2003.csproj create mode 100644 examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2005.csproj create mode 100644 examples/Spring/Spring.Scheduling.Quartz.Example/src/spring-objects.xml diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2003.sln b/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2003.sln new file mode 100644 index 00000000..62e341e1 --- /dev/null +++ b/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2003.sln @@ -0,0 +1,31 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Scheduling.Quartz.2003", "..\..\..\src\Spring\Spring.Scheduling.Quartz\Spring.Scheduling.Quartz.2003.csproj", "{0C0D8C65-90DE-4914-9940-4C684C54971B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Scheduling.Quartz.Example.2003", "src\Spring.Scheduling.Quartz.Example.2003.csproj", "{0C0D8C65-90DE-4914-9940-4C684C54971B}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Debug.ActiveCfg = Debug|.NET + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Debug.Build.0 = Debug|.NET + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Release.ActiveCfg = Release|.NET + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Release.Build.0 = Release|.NET + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Debug.ActiveCfg = Debug|.NET + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Debug.Build.0 = Debug|.NET + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Release.ActiveCfg = Release|.NET + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Release.Build.0 = Release|.NET + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2005.sln b/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2005.sln new file mode 100644 index 00000000..a36f3801 --- /dev/null +++ b/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.2005.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Scheduling.Quartz.2005", "..\..\..\src\Spring\Spring.Scheduling.Quartz\Spring.Scheduling.Quartz.2005.csproj", "{E823D54C-CE82-4868-929F-5F95A999F61E}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Scheduling.Quartz.Example.2005", "src\Spring.Scheduling.Quartz.Example.2005.csproj", "{0C0D8C65-90DE-4914-9940-4C684C54971B}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E823D54C-CE82-4868-929F-5F95A999F61E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E823D54C-CE82-4868-929F-5F95A999F61E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E823D54C-CE82-4868-929F-5F95A999F61E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E823D54C-CE82-4868-929F-5F95A999F61E}.Release|Any CPU.Build.0 = Release|Any CPU + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0C0D8C65-90DE-4914-9940-4C684C54971B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.build b/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.build new file mode 100644 index 00000000..a3813a83 --- /dev/null +++ b/examples/Spring/Spring.Scheduling.Quartz.Example/Spring.Scheduling.Quartz.Example.build @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/src/App.config b/examples/Spring/Spring.Scheduling.Quartz.Example/src/App.config new file mode 100644 index 00000000..b08a3419 --- /dev/null +++ b/examples/Spring/Spring.Scheduling.Quartz.Example/src/App.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/src/ExampleJob.cs b/examples/Spring/Spring.Scheduling.Quartz.Example/src/ExampleJob.cs new file mode 100644 index 00000000..4aadf821 --- /dev/null +++ b/examples/Spring/Spring.Scheduling.Quartz.Example/src/ExampleJob.cs @@ -0,0 +1,41 @@ +using System; + +using Quartz; + +using Spring.Scheduling.Quartz; + +namespace Spring.Scheduling.Quartz.Example +{ + /// + /// Example job. + /// + public class ExampleJob : QuartzJobObject + { + private int timeout; + + /// + /// Simple property that can be injected. + /// + public int Timeout + { + set { timeout = value; } + } + + /// + /// Execute. + /// + /// + protected override void ExecuteInternal(JobExecutionContext context) + { + Console.WriteLine("{0}: ExecuteInternal called, timeout: {1}", DateTime.Now, timeout); + } + + /// + /// Custom job execution method. + /// + public void DoIt() + { + Console.WriteLine("{0}: DoIt called, timeout: {1}", DateTime.Now, timeout); + } + } +} diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/src/Program.cs b/examples/Spring/Spring.Scheduling.Quartz.Example/src/Program.cs new file mode 100644 index 00000000..6d71ac7a --- /dev/null +++ b/examples/Spring/Spring.Scheduling.Quartz.Example/src/Program.cs @@ -0,0 +1,23 @@ +using System; + +using Spring.Context.Support; + +namespace Spring.Scheduling.Quartz.Example +{ + class Program + { + static void Main() + { + try + { + XmlApplicationContext ctx = new XmlApplicationContext("spring-objects.xml"); + Console.WriteLine("Spring configuration succeeded."); + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + Console.ReadLine(); + } + } +} diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2003.csproj b/examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2003.csproj new file mode 100644 index 00000000..c9d964c1 --- /dev/null +++ b/examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2003.csproj @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2005.csproj b/examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2005.csproj new file mode 100644 index 00000000..cfc85a13 --- /dev/null +++ b/examples/Spring/Spring.Scheduling.Quartz.Example/src/Spring.Scheduling.Quartz.Example.2005.csproj @@ -0,0 +1,115 @@ + + + Local + 8.0.50727 + 2.0 + {0C0D8C65-90DE-4914-9940-4C684C54971B} + Debug + AnyCPU + + + + + Spring.Scheduling.Quartz.Example + + + JScript + Grid + IE50 + false + Exe + Spring + OnBuildSuccess + + + + + + + + + ..\..\..\..\build\VS.NET.2005\Spring.Scheduling.Quartz.Example\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + Spring.Scheduling.Quartz.Example.xml + true + 4096 + false + + + false + false + false + false + 4 + full + prompt + + + ..\..\..\..\build\VS.NET.2005\Spring.Scheduling.Quartz.Example\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + false + + + true + false + false + false + 4 + none + prompt + + + + Common.Logging + ..\..\..\..\lib\net\2.0\Common.Logging.dll + + + Quartz + ..\..\..\..\lib\net\2.0\Quartz.dll + + + False + ..\..\..\..\bin\net\2.0\debug\Spring.Core.dll + + + System + + + + + + + Code + + + Code + + + + + {E823D54C-CE82-4868-929F-5F95A999F61E} + Spring.Scheduling.Quartz.2005 + + + + + + + cmd /c copy $(ProjectDir)spring-objects.xml $(OutDir) +cmd /c copy $(ProjectDir)App.config $(OutDir)Spring.Scheduling.Quartz.Example.exe.config + + \ No newline at end of file diff --git a/examples/Spring/Spring.Scheduling.Quartz.Example/src/spring-objects.xml b/examples/Spring/Spring.Scheduling.Quartz.Example/src/spring-objects.xml new file mode 100644 index 00000000..23afe636 --- /dev/null +++ b/examples/Spring/Spring.Scheduling.Quartz.Example/src/spring-objects.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file