Fixing compilation and configuration issues in Spring.Scheduling.Quartz.Example
This commit is contained in:
@@ -2,8 +2,6 @@ using System;
|
||||
|
||||
using Quartz;
|
||||
|
||||
using Spring.Scheduling.Quartz;
|
||||
|
||||
namespace Spring.Scheduling.Quartz.Example
|
||||
{
|
||||
/// <summary>
|
||||
@@ -26,7 +24,7 @@ namespace Spring.Scheduling.Quartz.Example
|
||||
/// Execute.
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
protected override void ExecuteInternal(JobExecutionContext context)
|
||||
protected override void ExecuteInternal(IJobExecutionContext context)
|
||||
{
|
||||
Console.WriteLine("{0}: ExecuteInternal called, user name: {1}, next fire time {2}",
|
||||
DateTime.Now, userName, context.NextFireTimeUtc.Value.ToLocalTime());
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Spring</RootNamespace>
|
||||
<RootNamespace>Spring.Scheduling.Quartz.Example</RootNamespace>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
@@ -76,21 +76,25 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="C5">
|
||||
<Name>C5</Name>
|
||||
<HintPath>..\..\..\..\lib\Quartz20\net\3.5\C5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Common.Logging">
|
||||
<Name>Common.Logging</Name>
|
||||
<HintPath>..\..\..\..\lib\net\2.0\Common.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Quartz">
|
||||
<Name>Quartz</Name>
|
||||
<HintPath>..\..\..\..\lib\Quartz10\net\3.5\Quartz.dll</HintPath>
|
||||
<HintPath>..\..\..\..\lib\Quartz20\net\3.5\Quartz.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Core">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\bin\net\3.5\debug\Spring.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Scheduling.Quartz">
|
||||
<Reference Include="Spring.Scheduling.Quartz20">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\bin\net\3.5\debug\Spring.Scheduling.Quartz.dll</HintPath>
|
||||
<HintPath>..\..\..\..\bin\net\3.5\debug\Spring.Scheduling.Quartz20.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Spring</RootNamespace>
|
||||
<RootNamespace>Spring.Scheduling.Quartz.Example</RootNamespace>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
@@ -54,7 +54,7 @@
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
@@ -94,13 +94,17 @@
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="C5">
|
||||
<Name>C5</Name>
|
||||
<HintPath>..\..\..\..\lib\Quartz20\net\3.5\C5.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Common.Logging">
|
||||
<Name>Common.Logging</Name>
|
||||
<HintPath>..\..\..\..\lib\net\2.0\Common.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Quartz">
|
||||
<Name>Quartz</Name>
|
||||
<HintPath>..\..\..\..\lib\Quartz10\net\3.5\Quartz.dll</HintPath>
|
||||
<HintPath>..\..\..\..\lib\Quartz20\net\4.0\Quartz.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Spring.Core">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
@@ -108,7 +112,7 @@
|
||||
</Reference>
|
||||
<Reference Include="Spring.Scheduling.Quartz">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\bin\net\4.0\debug\Spring.Scheduling.Quartz.dll</HintPath>
|
||||
<HintPath>..\..\..\..\bin\net\4.0\debug\Spring.Scheduling.Quartz20.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<objects xmlns="http://www.springframework.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd">
|
||||
|
||||
<object name="exampleJob" type="Spring.Scheduling.Quartz.JobDetailObject, Spring.Scheduling.Quartz">
|
||||
<object name="exampleJob" type="Spring.Scheduling.Quartz.JobDetailObject, Spring.Scheduling.Quartz20">
|
||||
<property name="JobType" value="Spring.Scheduling.Quartz.Example.ExampleJob, Spring.Scheduling.Quartz.Example" />
|
||||
<!-- We can inject values throgh JobDataMap -->
|
||||
<property name="JobDataAsMap">
|
||||
@@ -17,20 +17,20 @@
|
||||
<property name="UserName" value="Gabriel" />
|
||||
</object>
|
||||
|
||||
<object id="jobDetail" type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject, Spring.Scheduling.Quartz">
|
||||
<object id="jobDetail" type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject, Spring.Scheduling.Quartz20">
|
||||
<!-- We don't actually need to implement IJob as we can use delegation -->
|
||||
<property name="TargetObject" ref="adminService" />
|
||||
<property name="TargetMethod" value="DoAdminWork" />
|
||||
</object>
|
||||
|
||||
<object id="jobDetailNonConcurrent" type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject, Spring.Scheduling.Quartz">
|
||||
<object id="jobDetailNonConcurrent" type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject, Spring.Scheduling.Quartz20">
|
||||
<property name="targetObject" ref="adminService" />
|
||||
<property name="targetMethod" value="DoAdminWork" />
|
||||
<!-- Automatic IStatefulJob wrapping -->
|
||||
<property name="concurrent" value="false" />
|
||||
</object>
|
||||
|
||||
<object id="simpleTrigger" type="Spring.Scheduling.Quartz.SimpleTriggerObject, Spring.Scheduling.Quartz">
|
||||
<object id="simpleTrigger" type="Spring.Scheduling.Quartz.SimpleTriggerObject, Spring.Scheduling.Quartz20">
|
||||
<!-- see the example of method invoking job above -->
|
||||
<property name="jobDetail" ref="jobDetail" />
|
||||
<!-- 5 seconds -->
|
||||
@@ -40,13 +40,13 @@
|
||||
</object>
|
||||
|
||||
|
||||
<object id="cronTrigger" type="Spring.Scheduling.Quartz.CronTriggerObject, Spring.Scheduling.Quartz">
|
||||
<object id="cronTrigger" type="Spring.Scheduling.Quartz.CronTriggerObject, Spring.Scheduling.Quartz20">
|
||||
<property name="jobDetail" ref="exampleJob" />
|
||||
<!-- run every 20 second of minute -->
|
||||
<property name="cronExpressionString" value="0/20 * * * * ?" />
|
||||
</object>
|
||||
|
||||
<object type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz">
|
||||
<object type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz20">
|
||||
<property name="triggers">
|
||||
<list>
|
||||
<ref object="cronTrigger" />
|
||||
|
||||
Reference in New Issue
Block a user