├── .gitignore ├── README.md ├── ServiceStack.Funq.Quartz.Nuget ├── Readme.txt └── ServiceStack.Funq.Quartz.Nuget.nuproj ├── ServiceStack.Funq.Quartz ├── FunqJobFactory.cs ├── Properties │ └── AssemblyInfo.cs ├── QuartzRegistry.cs ├── ServiceStack.Funq.Quartz.csproj ├── job_scheduling_data_2_0.xsd └── packages.config ├── ServiceStackWithQuartz.sln └── ServiceStackWithQuartz ├── ServiceStackWithQuartz.ServiceInterface ├── MyServices.cs ├── Properties │ └── AssemblyInfo.cs ├── ServiceStackWithQuartz.ServiceInterface.csproj └── packages.config ├── ServiceStackWithQuartz.ServiceModel ├── Hello.cs ├── Properties │ └── AssemblyInfo.cs ├── ServiceStackWithQuartz.ServiceModel.csproj └── packages.config ├── ServiceStackWithQuartz.Tests ├── Properties │ └── AssemblyInfo.cs ├── ServiceStackWithQuartz.Tests.csproj ├── UnitTest1.cs └── packages.config └── ServiceStackWithQuartz ├── App.config ├── AppHost.cs ├── Program.cs ├── Properties └── AssemblyInfo.cs ├── Quartz └── Jobs │ └── HelloJob.cs ├── ServiceStackWithQuartz.csproj ├── WinService.Designer.cs ├── WinService.cs ├── WinServiceInstaller.cs ├── WinServiceInstaller.designer.cs ├── WinServiceInstaller.resx ├── install.bat ├── job_scheduling_data_2_0.xsd ├── packages.config ├── start.bat ├── stop.bat └── uninstall.bat /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | # DNX 42 | project.lock.json 43 | artifacts/ 44 | 45 | *_i.c 46 | *_p.c 47 | *_i.h 48 | *.ilk 49 | *.meta 50 | *.obj 51 | *.pch 52 | *.pdb 53 | *.pgc 54 | *.pgd 55 | *.rsp 56 | *.sbr 57 | *.tlb 58 | *.tli 59 | *.tlh 60 | *.tmp 61 | *.tmp_proj 62 | *.log 63 | *.vspscc 64 | *.vssscc 65 | .builds 66 | *.pidb 67 | *.svclog 68 | *.scc 69 | 70 | # Chutzpah Test files 71 | _Chutzpah* 72 | 73 | # Visual C++ cache files 74 | ipch/ 75 | *.aps 76 | *.ncb 77 | *.opensdf 78 | *.sdf 79 | *.cachefile 80 | 81 | # Visual Studio profiler 82 | *.psess 83 | *.vsp 84 | *.vspx 85 | 86 | # TFS 2012 Local Workspace 87 | $tf/ 88 | 89 | # Guidance Automation Toolkit 90 | *.gpState 91 | 92 | # ReSharper is a .NET coding add-in 93 | _ReSharper*/ 94 | *.[Rr]e[Ss]harper 95 | *.DotSettings.user 96 | 97 | # JustCode is a .NET coding add-in 98 | .JustCode 99 | 100 | # TeamCity is a build add-in 101 | _TeamCity* 102 | 103 | # DotCover is a Code Coverage Tool 104 | *.dotCover 105 | 106 | # NCrunch 107 | _NCrunch_* 108 | .*crunch*.local.xml 109 | 110 | # MightyMoose 111 | *.mm.* 112 | AutoTest.Net/ 113 | 114 | # Web workbench (sass) 115 | .sass-cache/ 116 | 117 | # Installshield output folder 118 | [Ee]xpress/ 119 | 120 | # DocProject is a documentation generator add-in 121 | DocProject/buildhelp/ 122 | DocProject/Help/*.HxT 123 | DocProject/Help/*.HxC 124 | DocProject/Help/*.hhc 125 | DocProject/Help/*.hhk 126 | DocProject/Help/*.hhp 127 | DocProject/Help/Html2 128 | DocProject/Help/html 129 | 130 | # Click-Once directory 131 | publish/ 132 | 133 | # Publish Web Output 134 | *.[Pp]ublish.xml 135 | *.azurePubxml 136 | ## TODO: Comment the next line if you want to checkin your 137 | ## web deploy settings but do note that will include unencrypted 138 | ## passwords 139 | #*.pubxml 140 | 141 | *.publishproj 142 | 143 | # NuGet Packages 144 | *.nupkg 145 | # The packages folder can be ignored because of Package Restore 146 | **/packages/* 147 | # except build/, which is used as an MSBuild target. 148 | !**/packages/build/ 149 | # Uncomment if necessary however generally it will be regenerated when needed 150 | #!**/packages/repositories.config 151 | 152 | # Windows Azure Build Output 153 | csx/ 154 | *.build.csdef 155 | 156 | # Windows Store app package directory 157 | AppPackages/ 158 | 159 | # Visual Studio cache files 160 | # files ending in .cache can be ignored 161 | *.[Cc]ache 162 | # but keep track of directories ending in .cache 163 | !*.[Cc]ache/ 164 | 165 | # Others 166 | ClientBin/ 167 | [Ss]tyle[Cc]op.* 168 | ~$* 169 | *~ 170 | *.dbmdl 171 | *.dbproj.schemaview 172 | *.pfx 173 | *.publishsettings 174 | node_modules/ 175 | orleans.codegen.cs 176 | 177 | # RIA/Silverlight projects 178 | Generated_Code/ 179 | 180 | # Backup & report files from converting an old project file 181 | # to a newer Visual Studio version. Backup files are not needed, 182 | # because we have git ;-) 183 | _UpgradeReport_Files/ 184 | Backup*/ 185 | UpgradeLog*.XML 186 | UpgradeLog*.htm 187 | 188 | # SQL Server files 189 | *.mdf 190 | *.ldf 191 | 192 | # Business Intelligence projects 193 | *.rdl.data 194 | *.bim.layout 195 | *.bim_*.settings 196 | 197 | # Microsoft Fakes 198 | FakesAssemblies/ 199 | 200 | # Node.js Tools for Visual Studio 201 | .ntvs_analysis.dat 202 | 203 | # Visual Studio 6 build log 204 | *.plg 205 | 206 | # Visual Studio 6 workspace options file 207 | *.opt 208 | 209 | # LightSwitch generated files 210 | GeneratedArtifacts/ 211 | _Pvt_Extensions/ 212 | ModelManifest.xml 213 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > # This package is no longer maintained 2 | 3 | # ServiceStackWithQuartz [![Build status](https://ci.appveyor.com/api/projects/status/sfp7sg7gh6x1x580/branch/master?svg=true)](https://ci.appveyor.com/project/CodeRevver/servicestackwithquartz/branch/master) 4 | 5 | ServiceStack.Funq.Quartz allows an easy registration of all Quartz Jobs within ServiceStack's Funq container. This allows for dependency injection within any Quartz Job. 6 | 7 | This repository goes alongside my blog post here: [Creating a ServiceStack Windows Service that uses Quartz] (http://michaelclark.tech/2016/04/16/creating-a-servicestack-windows-service-that-uses-quartz/) 8 | 9 | You can install this package via Nuget with: [install-package ServiceStack.Funq.Quartz](https://www.nuget.org/packages/ServiceStack.Funq.Quartz/) 10 | 11 | ##How to use 12 | Register your jobs with the Funq container by calling the RegisterQuartzJobs with the assembly that contains your Jobs: 13 | 14 | ```csharp 15 | //// Add the using 16 | using ServiceStack.Funq.Quartz; 17 | 18 | //// This method scans the assembly for the Jobs 19 | container.RegisterQuartzScheduler(typeof(HelloJob)); 20 | 21 | //// Resolve the Quartz Scheduler as normal 22 | var scheduler = container.Resolve(); 23 | 24 | //// Start Quartz Scheduler 25 | scheduler.Start(); 26 | ``` 27 | 28 | **Advanced Configuration** 29 | 30 | There is also support for [Quartz Configuration](http://www.quartz-scheduler.net/documentation/quartz-2.x/quick-start.html) ("Configuration" section): 31 | 32 | ```csharp 33 | var quartzConfig = new NameValueCollection(); 34 | properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz"; 35 | properties["quartz.threadPool.threadCount"] = "5"; 36 | properties["quartz.threadPool.threadPriority"] = "Normal"; 37 | 38 | container.RegisterQuartzScheduler(typeof(HelloJob), quartzConfig); 39 | ``` 40 | 41 | **Previously asked questions:** 42 | [Resolving a Service with nothing in it](http://stackoverflow.com/questions/36782158/servicestack-funq-quartz-cannot-instantiating-type) 43 | 44 | **ServiceStack** 45 | You can find the ServiceStack framework here: [https://github.com/ServiceStack/ServiceStack](https://github.com/ServiceStack/ServiceStack) 46 | -------------------------------------------------------------------------------- /ServiceStack.Funq.Quartz.Nuget/Readme.txt: -------------------------------------------------------------------------------- 1 | ServiceStackWithQuartz [https://github.com/CodeRevver/ServiceStackWithQuartz] 2 | 3 | ServiceStack.Funq.Quartz allows an easy registration of all Quartz Jobs within ServiceStack's Funq container. This allows for dependency injection within any Quartz Job. 4 | 5 | This repository goes alongside my blog post here: Creating a ServiceStack Windows Service that uses Quartz 6 | 7 | You can install this package via Nuget with: install-package ServiceStack.Funq.Quartz 8 | 9 | How to use 10 | 11 | Register your jobs with the Funq container by calling the RegisterQuartzScheduler with the assembly that contains your Jobs: 12 | 13 | //// This method scans the assembly for the Jobs 14 | container.RegisterQuartzScheduler(typeof(HelloJob)); 15 | 16 | //// Resolve the Quartz Scheduler as normal 17 | var scheduler = container.Resolve(); 18 | 19 | //// Start Quartz Scheduler 20 | scheduler.Start(); -------------------------------------------------------------------------------- /ServiceStack.Funq.Quartz.Nuget/ServiceStack.Funq.Quartz.Nuget.nuproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8 | 9 | Release 10 | AnyCPU 11 | 12 | 13 | 14 | 7da34c06-3c3b-460b-a0c7-b20fc3b84e85 15 | 16 | 17 | $(MSBuildExtensionsPath)\NuProj\ 18 | 19 | 20 | 21 | ServiceStack.Funq.Quartz 22 | 1.0.4 23 | ServiceStack.Funq.Quartz 24 | CodeRevver 25 | CodeRevver 26 | Easily Integrate Quartz with ServiceStack 27 | ServiceStack.Funq.Quartz allows an easy registration of all Quartz Jobs within ServiceStack's Funq container. This allows for dependency injection within any Quartz Job. 28 | 29 | 30 | https://github.com/CodeRevver/ServiceStackWithQuartz 31 | http://mit-license.org/ 32 | Copyright 2016 33 | ServiceStack, Quartz, Funq, IoC 34 | false 35 | true 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /ServiceStack.Funq.Quartz/FunqJobFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Funq; 3 | using Quartz; 4 | using Quartz.Spi; 5 | 6 | namespace ServiceStack.Funq.Quartz 7 | { 8 | /// 9 | /// Resolve Quartz Job and it's dependencies from Funq container 10 | /// 11 | public class FunqJobFactory : IJobFactory 12 | { 13 | private readonly Container _container; 14 | 15 | /// 16 | /// Initialises a new instance of the FunqJobFactory 17 | /// 18 | /// 19 | public FunqJobFactory(Container container) 20 | { 21 | _container = container; 22 | } 23 | 24 | /// 25 | /// Called by the Quartz Scheduler at the time of the trigger firing 26 | /// in order to produce a IJob instance on which to call execute 27 | /// 28 | /// 29 | /// 30 | /// 31 | public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler) 32 | { 33 | if (bundle == null) throw new ArgumentNullException(nameof(bundle)); 34 | if (scheduler == null) throw new ArgumentNullException(nameof(scheduler)); 35 | 36 | var jobDetail = bundle.JobDetail; 37 | var newJob = (IJob)_container.TryResolve(jobDetail.JobType); 38 | 39 | if (newJob == null) 40 | throw new SchedulerConfigException(string.Format("Failed to instantiate Job {0} of type {1}", jobDetail.Key, jobDetail.JobType)); 41 | 42 | return newJob; 43 | } 44 | 45 | /// 46 | /// Allows the job factory to destroy/cleanup the job if needed 47 | /// 48 | /// 49 | public void ReturnJob(IJob job) 50 | { 51 | if (job is IDisposable) 52 | { 53 | var disposableJob = (IDisposable)job; 54 | disposableJob.Dispose(); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ServiceStack.Funq.Quartz/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ServiceStack.Funq.Quartz")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ServiceStack.Funq.Quartz")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("53f81721-dc8a-461c-9816-548f954f07e9")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ServiceStack.Funq.Quartz/QuartzRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Specialized; 3 | using System.Linq; 4 | using Funq; 5 | using Quartz; 6 | using Quartz.Impl; 7 | using Quartz.Spi; 8 | 9 | namespace ServiceStack.Funq.Quartz 10 | { 11 | /// 12 | /// Registers Quartz Scheduler and Jobs with the ServiceStack Funq container 13 | /// 14 | public static class QuartzRegistry 15 | { 16 | /// 17 | /// Registers Quartz Scheduler and Jobs from specified assembly, with specified config 18 | /// 19 | /// 20 | /// 21 | /// 22 | public static void RegisterQuartzScheduler(this Container container, Type jobsAssembly, NameValueCollection quartzConfig = null) 23 | { 24 | if (jobsAssembly == null) throw new ArgumentNullException(nameof(jobsAssembly)); 25 | 26 | container.RegisterAs(); 27 | jobsAssembly.Assembly.GetTypes() 28 | .Where(type => !type.IsAbstract && typeof(IJob).IsAssignableFrom(type)) 29 | .Each(x => container.RegisterAutoWiredType(x)); 30 | 31 | ISchedulerFactory schedFact = quartzConfig != null 32 | ? new StdSchedulerFactory(quartzConfig) 33 | : new StdSchedulerFactory(); 34 | 35 | IScheduler scheduler = schedFact.GetScheduler(); 36 | scheduler.JobFactory = container.Resolve(); 37 | container.Register(scheduler); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /ServiceStack.Funq.Quartz/ServiceStack.Funq.Quartz.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {53F81721-DC8A-461C-9816-548F954F07E9} 8 | Library 9 | Properties 10 | ServiceStack.Funq.Quartz 11 | ServiceStack.Funq.Quartz 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\Common.Logging.3.3.1\lib\net40\Common.Logging.dll 35 | True 36 | 37 | 38 | ..\packages\Common.Logging.Core.3.3.1\lib\net40\Common.Logging.Core.dll 39 | True 40 | 41 | 42 | ..\packages\Quartz.2.5.0\lib\net40\Quartz.dll 43 | True 44 | 45 | 46 | ..\packages\ServiceStack.4.5.8\lib\net45\ServiceStack.dll 47 | True 48 | 49 | 50 | ..\packages\ServiceStack.Client.4.5.8\lib\net45\ServiceStack.Client.dll 51 | True 52 | 53 | 54 | ..\packages\ServiceStack.Common.4.5.8\lib\net45\ServiceStack.Common.dll 55 | True 56 | 57 | 58 | ..\packages\ServiceStack.Interfaces.4.5.8\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll 59 | True 60 | 61 | 62 | ..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll 63 | True 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | Designer 82 | 83 | 84 | 85 | 86 | 93 | -------------------------------------------------------------------------------- /ServiceStack.Funq.Quartz/job_scheduling_data_2_0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | Root level node 12 | 13 | 14 | 15 | 16 | 17 | Commands to be executed before scheduling the jobs and triggers in this file. 18 | 19 | 20 | 21 | 22 | Directives to be followed while scheduling the jobs and triggers in this file. 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Version of the XML Schema instance 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | Delete all jobs, if any, in the identified group. "*" can be used to identify all groups. Will also result in deleting all triggers related to the jobs. 47 | 48 | 49 | 50 | 51 | Delete all triggers, if any, in the identified group. "*" can be used to identify all groups. Will also result in deletion of related jobs that are non-durable. 52 | 53 | 54 | 55 | 56 | Delete the identified job if it exists (will also result in deleting all triggers related to it). 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | Delete the identified trigger if it exists (will also result in deletion of related jobs that are non-durable). 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | Whether the existing scheduling data (with same identifiers) will be overwritten. If false, and ignore-duplicates is not false, and jobs or triggers with the same names already exist as those in the file, an error will occur. 84 | 85 | 86 | 87 | 88 | If true (and overwrite-existing-data is false) then any job/triggers encountered in this file that have names that already exist in the scheduler will be ignored, and no error will be produced. 89 | 90 | 91 | 92 | 93 | If true trigger's start time is calculated based on earlier run time instead of fixed value. Trigger's start time must be undefined for this to work. 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | Define a JobDetail 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | Define a JobDataMap 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | Define a JobDataMap entry 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | Define a Trigger 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | Common Trigger definitions 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | Define a SimpleTrigger 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | Define a CronTrigger 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | Define a DateIntervalTrigger 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | Cron expression (see JavaDoc for examples) 220 | 221 | Special thanks to Chris Thatcher (thatcher@butterfly.net) for the regular expression! 222 | 223 | Regular expressions are not my strong point but I believe this is complete, 224 | with the caveat that order for expressions like 3-0 is not legal but will pass, 225 | and month and day names must be capitalized. 226 | If you want to examine the correctness look for the [\s] to denote the 227 | seperation of individual regular expressions. This is how I break them up visually 228 | to examine them: 229 | 230 | SECONDS: 231 | ( 232 | ((([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?,)*([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?) 233 | | (([\*]|[0-9]|[0-5][0-9])/([0-9]|[0-5][0-9])) 234 | | ([\?]) 235 | | ([\*]) 236 | ) [\s] 237 | MINUTES: 238 | ( 239 | ((([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?,)*([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?) 240 | | (([\*]|[0-9]|[0-5][0-9])/([0-9]|[0-5][0-9])) 241 | | ([\?]) 242 | | ([\*]) 243 | ) [\s] 244 | HOURS: 245 | ( 246 | ((([0-9]|[0-1][0-9]|[2][0-3])(-([0-9]|[0-1][0-9]|[2][0-3]))?,)*([0-9]|[0-1][0-9]|[2][0-3])(-([0-9]|[0-1][0-9]|[2][0-3]))?) 247 | | (([\*]|[0-9]|[0-1][0-9]|[2][0-3])/([0-9]|[0-1][0-9]|[2][0-3])) 248 | | ([\?]) 249 | | ([\*]) 250 | ) [\s] 251 | DAY OF MONTH: 252 | ( 253 | ((([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(-([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1]))?,)*([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(-([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1]))?(C)?) 254 | | (([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])/([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(C)?) 255 | | (L(-[0-9])?) 256 | | (L(-[1-2][0-9])?) 257 | | (L(-[3][0-1])?) 258 | | (LW) 259 | | ([1-9]W) 260 | | ([1-3][0-9]W) 261 | | ([\?]) 262 | | ([\*]) 263 | )[\s] 264 | MONTH: 265 | ( 266 | ((([1-9]|0[1-9]|1[0-2])(-([1-9]|0[1-9]|1[0-2]))?,)*([1-9]|0[1-9]|1[0-2])(-([1-9]|0[1-9]|1[0-2]))?) 267 | | (([1-9]|0[1-9]|1[0-2])/([1-9]|0[1-9]|1[0-2])) 268 | | (((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?,)*(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?) 269 | | ((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)/(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)) 270 | | ([\?]) 271 | | ([\*]) 272 | )[\s] 273 | DAY OF WEEK: 274 | ( 275 | (([1-7](-([1-7]))?,)*([1-7])(-([1-7]))?) 276 | | ([1-7]/([1-7])) 277 | | (((MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?,)*(MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?(C)?) 278 | | ((MON|TUE|WED|THU|FRI|SAT|SUN)/(MON|TUE|WED|THU|FRI|SAT|SUN)(C)?) 279 | | (([1-7]|(MON|TUE|WED|THU|FRI|SAT|SUN))(L|LW)?) 280 | | (([1-7]|MON|TUE|WED|THU|FRI|SAT|SUN)#([1-7])?) 281 | | ([\?]) 282 | | ([\*]) 283 | ) 284 | YEAR (OPTIONAL): 285 | ( 286 | [\s]? 287 | ([\*])? 288 | | ((19[7-9][0-9])|(20[0-9][0-9]))? 289 | | (((19[7-9][0-9])|(20[0-9][0-9]))/((19[7-9][0-9])|(20[0-9][0-9])))? 290 | | ((((19[7-9][0-9])|(20[0-9][0-9]))(-((19[7-9][0-9])|(20[0-9][0-9])))?,)*((19[7-9][0-9])|(20[0-9][0-9]))(-((19[7-9][0-9])|(20[0-9][0-9])))?)? 291 | ) 292 | 293 | 294 | 295 | 297 | 298 | 299 | 300 | 301 | 302 | Number of times to repeat the Trigger (-1 for indefinite) 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | Simple Trigger Misfire Instructions 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | Cron Trigger Misfire Instructions 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | Date Interval Trigger Misfire Instructions 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | Interval Units 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | -------------------------------------------------------------------------------- /ServiceStack.Funq.Quartz/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStackWithQuartz", "ServiceStackWithQuartz\ServiceStackWithQuartz\ServiceStackWithQuartz.csproj", "{CF36BF58-D08F-425A-9A6A-D0A86C506110}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStackWithQuartz.ServiceInterface", "ServiceStackWithQuartz\ServiceStackWithQuartz.ServiceInterface\ServiceStackWithQuartz.ServiceInterface.csproj", "{130DED02-5984-487C-93DD-0D264EED140E}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStackWithQuartz.ServiceModel", "ServiceStackWithQuartz\ServiceStackWithQuartz.ServiceModel\ServiceStackWithQuartz.ServiceModel.csproj", "{8D6DE92C-637E-4433-9810-98D7FBCEA6BA}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStackWithQuartz.Tests", "ServiceStackWithQuartz\ServiceStackWithQuartz.Tests\ServiceStackWithQuartz.Tests.csproj", "{12B06E45-12F5-4E56-ADB4-5879D98D3105}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceStack.Funq.Quartz", "ServiceStack.Funq.Quartz\ServiceStack.Funq.Quartz.csproj", "{53F81721-DC8A-461C-9816-548F954F07E9}" 15 | EndProject 16 | Project("{FF286327-C783-4F7A-AB73-9BCBAD0D4460}") = "ServiceStack.Funq.Quartz.Nuget", "ServiceStack.Funq.Quartz.Nuget\ServiceStack.Funq.Quartz.Nuget.nuproj", "{7DA34C06-3C3B-460B-A0C7-B20FC3B84E85}" 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Debug|Any CPU = Debug|Any CPU 21 | Release|Any CPU = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {CF36BF58-D08F-425A-9A6A-D0A86C506110}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {CF36BF58-D08F-425A-9A6A-D0A86C506110}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {CF36BF58-D08F-425A-9A6A-D0A86C506110}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {CF36BF58-D08F-425A-9A6A-D0A86C506110}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {130DED02-5984-487C-93DD-0D264EED140E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {130DED02-5984-487C-93DD-0D264EED140E}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {130DED02-5984-487C-93DD-0D264EED140E}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {130DED02-5984-487C-93DD-0D264EED140E}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {8D6DE92C-637E-4433-9810-98D7FBCEA6BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {8D6DE92C-637E-4433-9810-98D7FBCEA6BA}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {8D6DE92C-637E-4433-9810-98D7FBCEA6BA}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {8D6DE92C-637E-4433-9810-98D7FBCEA6BA}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {12B06E45-12F5-4E56-ADB4-5879D98D3105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {12B06E45-12F5-4E56-ADB4-5879D98D3105}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {12B06E45-12F5-4E56-ADB4-5879D98D3105}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {12B06E45-12F5-4E56-ADB4-5879D98D3105}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {53F81721-DC8A-461C-9816-548F954F07E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {53F81721-DC8A-461C-9816-548F954F07E9}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {53F81721-DC8A-461C-9816-548F954F07E9}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {53F81721-DC8A-461C-9816-548F954F07E9}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {7DA34C06-3C3B-460B-A0C7-B20FC3B84E85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {7DA34C06-3C3B-460B-A0C7-B20FC3B84E85}.Debug|Any CPU.Build.0 = Debug|Any CPU 46 | {7DA34C06-3C3B-460B-A0C7-B20FC3B84E85}.Release|Any CPU.ActiveCfg = Release|Any CPU 47 | {7DA34C06-3C3B-460B-A0C7-B20FC3B84E85}.Release|Any CPU.Build.0 = Release|Any CPU 48 | EndGlobalSection 49 | GlobalSection(SolutionProperties) = preSolution 50 | HideSolutionNode = FALSE 51 | EndGlobalSection 52 | EndGlobal 53 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.ServiceInterface/MyServices.cs: -------------------------------------------------------------------------------- 1 | using ServiceStack; 2 | using ServiceStackWithQuartz.ServiceModel; 3 | 4 | namespace ServiceStackWithQuartz.ServiceInterface 5 | { 6 | public class MyServices : Service 7 | { 8 | public HelloResponse Any(Hello request) 9 | { 10 | return new HelloResponse { Result = "Hello, {0}!".Fmt(request.Name) }; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.ServiceInterface/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ServiceStackWithQuartz.ServiceInterface")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ServiceStackWithQuartz.ServiceInterface")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("91c2a5f9-eb7e-482f-964e-d339a102357d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.ServiceInterface/ServiceStackWithQuartz.ServiceInterface.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {130DED02-5984-487C-93DD-0D264EED140E} 8 | Library 9 | Properties 10 | ServiceStackWithQuartz.ServiceInterface 11 | ServiceStackWithQuartz.ServiceInterface 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\..\packages\ServiceStack.4.5.8\lib\net45\ServiceStack.dll 35 | True 36 | 37 | 38 | ..\..\packages\ServiceStack.Client.4.5.8\lib\net45\ServiceStack.Client.dll 39 | True 40 | 41 | 42 | ..\..\packages\ServiceStack.Common.4.5.8\lib\net45\ServiceStack.Common.dll 43 | True 44 | 45 | 46 | ..\..\packages\ServiceStack.Interfaces.4.5.8\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll 47 | True 48 | 49 | 50 | ..\..\packages\ServiceStack.OrmLite.4.5.8\lib\net45\ServiceStack.OrmLite.dll 51 | True 52 | 53 | 54 | ..\..\packages\ServiceStack.Redis.4.5.8\lib\net45\ServiceStack.Redis.dll 55 | True 56 | 57 | 58 | ..\..\packages\ServiceStack.Server.4.5.8\lib\net45\ServiceStack.Server.dll 59 | True 60 | 61 | 62 | ..\..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll 63 | True 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | {8d6de92c-637e-4433-9810-98d7fbcea6ba} 81 | ServiceStackWithQuartz.ServiceModel 82 | 83 | 84 | 85 | 86 | 87 | 88 | 95 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.ServiceInterface/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.ServiceModel/Hello.cs: -------------------------------------------------------------------------------- 1 | using ServiceStack; 2 | 3 | namespace ServiceStackWithQuartz.ServiceModel 4 | { 5 | [Route("/hello/{Name}")] 6 | public class Hello : IReturn 7 | { 8 | public string Name { get; set; } 9 | } 10 | 11 | public class HelloResponse 12 | { 13 | public string Result { get; set; } 14 | } 15 | } -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.ServiceModel/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ServiceStackWithQuartz.ServiceModel")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ServiceStackWithQuartz.ServiceModel")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f7e92551-0005-4094-9aa2-158e7abc6cbc")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.ServiceModel/ServiceStackWithQuartz.ServiceModel.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8D6DE92C-637E-4433-9810-98D7FBCEA6BA} 8 | Library 9 | Properties 10 | ServiceStackWithQuartz.ServiceModel 11 | ServiceStackWithQuartz.ServiceModel 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\..\packages\ServiceStack.Interfaces.4.5.8\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll 35 | True 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 64 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.ServiceModel/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ServiceStackWithQuartz.Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ServiceStackWithQuartz.Tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("09da0ea1-ae8e-4b94-81f2-e2a3651445a4")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.Tests/ServiceStackWithQuartz.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {12B06E45-12F5-4E56-ADB4-5879D98D3105} 7 | Library 8 | Properties 9 | ServiceStackWithQuartz.Tests 10 | ServiceStackWithQuartz.Tests 11 | v4.5 12 | 512 13 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 10.0 15 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 16 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 17 | False 18 | UnitTest 19 | 20 | 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | ..\..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll 40 | True 41 | 42 | 43 | ..\..\packages\ServiceStack.4.5.8\lib\net45\ServiceStack.dll 44 | True 45 | 46 | 47 | ..\..\packages\ServiceStack.Client.4.5.8\lib\net45\ServiceStack.Client.dll 48 | True 49 | 50 | 51 | ..\..\packages\ServiceStack.Common.4.5.8\lib\net45\ServiceStack.Common.dll 52 | True 53 | 54 | 55 | ..\..\packages\ServiceStack.Interfaces.4.5.8\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll 56 | True 57 | 58 | 59 | ..\..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll 60 | True 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | {130ded02-5984-487c-93dd-0d264eed140e} 71 | ServiceStackWithQuartz.ServiceInterface 72 | 73 | 74 | {8d6de92c-637e-4433-9810-98d7fbcea6ba} 75 | ServiceStackWithQuartz.ServiceModel 76 | 77 | 78 | 79 | 80 | 81 | 82 | 89 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.Tests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using NUnit.Framework; 3 | using ServiceStackWithQuartz.ServiceInterface; 4 | using ServiceStackWithQuartz.ServiceModel; 5 | using ServiceStack.Testing; 6 | using ServiceStack; 7 | 8 | namespace ServiceStackWithQuartz.Tests 9 | { 10 | [TestFixture] 11 | public class UnitTests 12 | { 13 | private readonly ServiceStackHost appHost; 14 | 15 | public UnitTests() 16 | { 17 | appHost = new BasicAppHost(typeof(MyServices).Assembly) 18 | { 19 | ConfigureContainer = container => 20 | { 21 | //Add your IoC dependencies here 22 | } 23 | } 24 | .Init(); 25 | } 26 | 27 | [TestFixtureTearDown] 28 | public void TestFixtureTearDown() 29 | { 30 | appHost.Dispose(); 31 | } 32 | 33 | [Test] 34 | public void TestMethod1() 35 | { 36 | var service = appHost.Container.Resolve(); 37 | 38 | var response = (HelloResponse)service.Any(new Hello { Name = "World" }); 39 | 40 | Assert.That(response.Result, Is.EqualTo("Hello, World!")); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz.Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/AppHost.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Specialized; 2 | using Funq; 3 | using Quartz; 4 | using ServiceStack; 5 | using ServiceStack.Funq.Quartz; 6 | using ServiceStackWithQuartz.ServiceInterface; 7 | 8 | namespace ServiceStackWithQuartz 9 | { 10 | public class AppHost : AppSelfHostBase 11 | { 12 | /// 13 | /// Default constructor. 14 | /// Base constructor requires a name and assembly to locate web service classes. 15 | /// 16 | public AppHost() 17 | : base("ServiceStackWithQuartz", typeof(MyServices).Assembly) 18 | { 19 | 20 | } 21 | 22 | /// 23 | /// Application specific configuration 24 | /// This method should initialize any IoC resources utilized by your web service classes. 25 | /// 26 | /// 27 | public override void Configure(Container container) 28 | { 29 | var quartzConfig = ConfigureQuartz(); 30 | container.RegisterQuartzScheduler(typeof(HelloJob), quartzConfig); 31 | var scheduler = container.Resolve(); 32 | scheduler.Start(); 33 | 34 | /* Schedule HelloJob */ 35 | IJobDetail job = JobBuilder.Create() 36 | .WithIdentity("myJob", "group1") 37 | .Build(); 38 | 39 | ITrigger trigger = TriggerBuilder.Create() 40 | .WithIdentity("myTrigger", "group1") 41 | .StartNow() 42 | .WithSimpleSchedule(x => x 43 | .WithIntervalInSeconds(10) 44 | .RepeatForever()) 45 | .Build(); 46 | 47 | scheduler.ScheduleJob(job, trigger); 48 | 49 | //Config examples 50 | //this.Plugins.Add(new PostmanFeature()); 51 | //this.Plugins.Add(new CorsFeature()); 52 | } 53 | 54 | /// 55 | /// Provides Quartz Configuration Settings 56 | /// 57 | /// 58 | private NameValueCollection ConfigureQuartz() 59 | { 60 | /* set thread pool info */ 61 | var properties = new NameValueCollection(); 62 | properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz"; 63 | properties["quartz.threadPool.threadCount"] = "5"; 64 | properties["quartz.threadPool.threadPriority"] = "Normal"; 65 | return properties; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ServiceProcess; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.Linq; 6 | using System.Threading; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using ServiceStack.Text; 10 | 11 | namespace ServiceStackWithQuartz 12 | { 13 | class Program 14 | { 15 | private const string ListeningOn = "http://localhost:8088/"; 16 | 17 | static void Main(string[] args) 18 | { 19 | var appHost = new AppHost(); 20 | //Allow you to debug your Windows Service while you're deleloping it. 21 | #if DEBUG 22 | Console.WriteLine("Running WinServiceAppHost in Console mode"); 23 | try 24 | { 25 | appHost.Init(); 26 | appHost.Start(ListeningOn); 27 | Process.Start(ListeningOn); 28 | Console.WriteLine("Press +C to stop."); 29 | Thread.Sleep(Timeout.Infinite); 30 | } 31 | catch (Exception ex) 32 | { 33 | Console.WriteLine("ERROR: {0}: {1}", ex.GetType().Name, ex.Message); 34 | throw; 35 | } 36 | finally 37 | { 38 | appHost.Stop(); 39 | } 40 | 41 | Console.WriteLine("WinServiceAppHost has finished"); 42 | 43 | #else 44 | //When in RELEASE mode it will run as a Windows Service with the code below 45 | 46 | ServiceBase[] ServicesToRun; 47 | ServicesToRun = new ServiceBase[] 48 | { 49 | new WinService(appHost, ListeningOn) 50 | }; 51 | ServiceBase.Run(ServicesToRun); 52 | #endif 53 | 54 | Console.ReadLine(); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ServiceStackWithQuartz")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ServiceStackWithQuartz")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("e62fbd8c-e125-4e5b-83b1-4047d668c415")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/Quartz/Jobs/HelloJob.cs: -------------------------------------------------------------------------------- 1 | using Quartz; 2 | using ServiceStack.Text; 3 | using ServiceStackWithQuartz.ServiceInterface; 4 | 5 | namespace ServiceStackWithQuartz 6 | { 7 | public class HelloJob : IJob 8 | { 9 | private MyServices MyServices { get; set; } 10 | public HelloJob(MyServices myServices) 11 | { 12 | MyServices = myServices; 13 | } 14 | 15 | public virtual void Execute(IJobExecutionContext context) 16 | { 17 | using (var service = MyServices) 18 | { 19 | var response = MyServices.Any(new ServiceModel.Hello 20 | { 21 | Name = "CodeRevver" 22 | }); 23 | 24 | response.PrintDump(); 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/ServiceStackWithQuartz.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {CF36BF58-D08F-425A-9A6A-D0A86C506110} 8 | Exe 9 | Properties 10 | ServiceStackWithQuartz 11 | ServiceStackWithQuartz 12 | v4.5 13 | 512 14 | ..\..\ 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\..\packages\Common.Logging.3.3.1\lib\net40\Common.Logging.dll 39 | True 40 | 41 | 42 | ..\..\packages\Common.Logging.Core.3.3.1\lib\net40\Common.Logging.Core.dll 43 | True 44 | 45 | 46 | ..\..\packages\Quartz.2.5.0\lib\net40\Quartz.dll 47 | True 48 | 49 | 50 | ..\..\packages\ServiceStack.4.5.8\lib\net45\ServiceStack.dll 51 | True 52 | 53 | 54 | ..\..\packages\ServiceStack.Client.4.5.8\lib\net45\ServiceStack.Client.dll 55 | True 56 | 57 | 58 | ..\..\packages\ServiceStack.Common.4.5.8\lib\net45\ServiceStack.Common.dll 59 | True 60 | 61 | 62 | ..\..\packages\ServiceStack.Interfaces.4.5.8\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll 63 | True 64 | 65 | 66 | ..\..\packages\ServiceStack.OrmLite.4.5.8\lib\net45\ServiceStack.OrmLite.dll 67 | True 68 | 69 | 70 | ..\..\packages\ServiceStack.Redis.4.5.8\lib\net45\ServiceStack.Redis.dll 71 | True 72 | 73 | 74 | ..\..\packages\ServiceStack.Server.4.5.8\lib\net45\ServiceStack.Server.dll 75 | True 76 | 77 | 78 | ..\..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll 79 | True 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | Component 97 | 98 | 99 | WinServiceInstaller.cs 100 | 101 | 102 | Component 103 | 104 | 105 | WinService.cs 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | Designer 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | WinServiceInstaller.cs 124 | 125 | 126 | 127 | 128 | {53f81721-dc8a-461c-9816-548f954f07e9} 129 | ServiceStack.Funq.Quartz 130 | 131 | 132 | {130ded02-5984-487c-93dd-0d264eed140e} 133 | ServiceStackWithQuartz.ServiceInterface 134 | 135 | 136 | {8d6de92c-637e-4433-9810-98d7fbcea6ba} 137 | ServiceStackWithQuartz.ServiceModel 138 | 139 | 140 | 141 | 142 | 149 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/WinService.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using ServiceStack.Text; 8 | 9 | namespace ServiceStackWithQuartz 10 | { 11 | partial class WinService 12 | { 13 | /// 14 | /// Required designer variable. 15 | /// 16 | private System.ComponentModel.IContainer components = null; 17 | 18 | /// 19 | /// Clean up any resources being used. 20 | /// 21 | /// true if managed resources should be disposed; otherwise, false. 22 | protected override void Dispose(bool disposing) 23 | { 24 | if (disposing && (components != null)) 25 | { 26 | components.Dispose(); 27 | } 28 | base.Dispose(disposing); 29 | } 30 | 31 | #region Component Designer generated code 32 | 33 | /// 34 | /// Required method for Designer support - do not modify 35 | /// the contents of this method with the code editor. 36 | /// 37 | private void InitializeComponent() 38 | { 39 | components = new System.ComponentModel.Container(); 40 | this.ServiceName = "ServiceStackWithQuartzService"; 41 | } 42 | 43 | #endregion 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/WinService.cs: -------------------------------------------------------------------------------- 1 | using System.ServiceProcess; 2 | using ServiceStack; 3 | 4 | namespace ServiceStackWithQuartz 5 | { 6 | public partial class WinService : ServiceBase 7 | { 8 | private readonly AppHostHttpListenerBase appHost; 9 | private readonly string listeningOn; 10 | 11 | public WinService(AppHostHttpListenerBase appHost, string listeningOn) 12 | { 13 | this.appHost = appHost; 14 | this.listeningOn = listeningOn; 15 | 16 | this.appHost.Init(); 17 | 18 | InitializeComponent(); 19 | } 20 | 21 | protected override void OnStart(string[] args) 22 | { 23 | this.appHost.Start(listeningOn); 24 | } 25 | 26 | protected override void OnStop() 27 | { 28 | this.appHost.Stop(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/WinServiceInstaller.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Configuration.Install; 3 | 4 | namespace ServiceStackWithQuartz 5 | { 6 | [RunInstaller(true)] 7 | public partial class WinServiceInstaller : Installer 8 | { 9 | public WinServiceInstaller() 10 | { 11 | InitializeComponent(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/WinServiceInstaller.designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using ServiceStack.Text; 8 | 9 | namespace ServiceStackWithQuartz 10 | { 11 | partial class WinServiceInstaller 12 | { 13 | /// 14 | /// Required designer variable. 15 | /// 16 | private System.ComponentModel.IContainer components = null; 17 | 18 | /// 19 | /// Clean up any resources being used. 20 | /// 21 | /// true if managed resources should be disposed; otherwise, false. 22 | protected override void Dispose(bool disposing) 23 | { 24 | if (disposing && (components != null)) 25 | { 26 | components.Dispose(); 27 | } 28 | base.Dispose(disposing); 29 | } 30 | 31 | #region Component Designer generated code 32 | 33 | /// 34 | /// Required method for Designer support - do not modify 35 | /// the contents of this method with the code editor. 36 | /// 37 | private void InitializeComponent() 38 | { 39 | this.serviceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller(); 40 | this.serviceInstaller = new System.ServiceProcess.ServiceInstaller(); 41 | // 42 | // serviceProcessInstaller 43 | // 44 | this.serviceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem; 45 | this.serviceProcessInstaller.Password = null; 46 | this.serviceProcessInstaller.Username = null; 47 | // 48 | // serviceInstaller 49 | // 50 | this.serviceInstaller.Description = "ServiceStackWithQuartz - ServiceStack Windows Service."; 51 | this.serviceInstaller.DisplayName = "ServiceStackWithQuartz"; 52 | this.serviceInstaller.ServiceName = "ServiceStackWithQuartz"; 53 | this.serviceInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic; 54 | // 55 | // WinServiceInstaller 56 | // 57 | this.Installers.AddRange(new System.Configuration.Install.Installer[] { 58 | this.serviceProcessInstaller, 59 | this.serviceInstaller}); 60 | 61 | } 62 | 63 | #endregion 64 | 65 | private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller; 66 | private System.ServiceProcess.ServiceInstaller serviceInstaller; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/WinServiceInstaller.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 56 122 | 123 | 124 | 196, 17 125 | 126 | 127 | False 128 | 129 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/install.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM Script thanks to Ben Gripka and his StackOverflow answer http://stackoverflow.com/a/10052222/670151 4 | 5 | :: BatchGotAdmin 6 | :------------------------------------- 7 | REM --> Check for permissions 8 | >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" 9 | 10 | REM --> If error flag set, we do not have admin. 11 | if '%errorlevel%' NEQ '0' ( 12 | REM Reset error level 13 | set errorlevel=0 14 | echo Requesting administrative privileges... 15 | goto UACPrompt 16 | ) else ( goto gotAdmin ) 17 | 18 | :UACPrompt 19 | echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" 20 | set params = %*:"="" 21 | echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" 22 | if '%errorlevel%' NEQ '0' ( 23 | echo Failed to request admin rights 24 | PAUSE 25 | del "%temp%\getadmin.vbs" 26 | exit /B 27 | ) 28 | "%temp%\getadmin.vbs" 29 | del "%temp%\getadmin.vbs" 30 | exit /B 31 | 32 | :gotAdmin 33 | pushd "%CD%" 34 | CD /D "%~dp0" 35 | :-------------------------------------- 36 | 37 | REM INSTALL THIS WINDOWS SERVICE: 38 | REM 1. Build in Release mode 39 | 40 | SET INSTALL_UTL="%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" 41 | 42 | %INSTALL_UTL% bin\Release\ServiceStackWithQuartz.exe 43 | 44 | PAUSE -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/job_scheduling_data_2_0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | Root level node 12 | 13 | 14 | 15 | 16 | 17 | Commands to be executed before scheduling the jobs and triggers in this file. 18 | 19 | 20 | 21 | 22 | Directives to be followed while scheduling the jobs and triggers in this file. 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Version of the XML Schema instance 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | Delete all jobs, if any, in the identified group. "*" can be used to identify all groups. Will also result in deleting all triggers related to the jobs. 47 | 48 | 49 | 50 | 51 | Delete all triggers, if any, in the identified group. "*" can be used to identify all groups. Will also result in deletion of related jobs that are non-durable. 52 | 53 | 54 | 55 | 56 | Delete the identified job if it exists (will also result in deleting all triggers related to it). 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | Delete the identified trigger if it exists (will also result in deletion of related jobs that are non-durable). 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | Whether the existing scheduling data (with same identifiers) will be overwritten. If false, and ignore-duplicates is not false, and jobs or triggers with the same names already exist as those in the file, an error will occur. 84 | 85 | 86 | 87 | 88 | If true (and overwrite-existing-data is false) then any job/triggers encountered in this file that have names that already exist in the scheduler will be ignored, and no error will be produced. 89 | 90 | 91 | 92 | 93 | If true trigger's start time is calculated based on earlier run time instead of fixed value. Trigger's start time must be undefined for this to work. 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | Define a JobDetail 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | Define a JobDataMap 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | Define a JobDataMap entry 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | Define a Trigger 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | Common Trigger definitions 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | Define a SimpleTrigger 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | Define a CronTrigger 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | Define a DateIntervalTrigger 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | Cron expression (see JavaDoc for examples) 220 | 221 | Special thanks to Chris Thatcher (thatcher@butterfly.net) for the regular expression! 222 | 223 | Regular expressions are not my strong point but I believe this is complete, 224 | with the caveat that order for expressions like 3-0 is not legal but will pass, 225 | and month and day names must be capitalized. 226 | If you want to examine the correctness look for the [\s] to denote the 227 | seperation of individual regular expressions. This is how I break them up visually 228 | to examine them: 229 | 230 | SECONDS: 231 | ( 232 | ((([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?,)*([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?) 233 | | (([\*]|[0-9]|[0-5][0-9])/([0-9]|[0-5][0-9])) 234 | | ([\?]) 235 | | ([\*]) 236 | ) [\s] 237 | MINUTES: 238 | ( 239 | ((([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?,)*([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?) 240 | | (([\*]|[0-9]|[0-5][0-9])/([0-9]|[0-5][0-9])) 241 | | ([\?]) 242 | | ([\*]) 243 | ) [\s] 244 | HOURS: 245 | ( 246 | ((([0-9]|[0-1][0-9]|[2][0-3])(-([0-9]|[0-1][0-9]|[2][0-3]))?,)*([0-9]|[0-1][0-9]|[2][0-3])(-([0-9]|[0-1][0-9]|[2][0-3]))?) 247 | | (([\*]|[0-9]|[0-1][0-9]|[2][0-3])/([0-9]|[0-1][0-9]|[2][0-3])) 248 | | ([\?]) 249 | | ([\*]) 250 | ) [\s] 251 | DAY OF MONTH: 252 | ( 253 | ((([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(-([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1]))?,)*([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(-([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1]))?(C)?) 254 | | (([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])/([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(C)?) 255 | | (L(-[0-9])?) 256 | | (L(-[1-2][0-9])?) 257 | | (L(-[3][0-1])?) 258 | | (LW) 259 | | ([1-9]W) 260 | | ([1-3][0-9]W) 261 | | ([\?]) 262 | | ([\*]) 263 | )[\s] 264 | MONTH: 265 | ( 266 | ((([1-9]|0[1-9]|1[0-2])(-([1-9]|0[1-9]|1[0-2]))?,)*([1-9]|0[1-9]|1[0-2])(-([1-9]|0[1-9]|1[0-2]))?) 267 | | (([1-9]|0[1-9]|1[0-2])/([1-9]|0[1-9]|1[0-2])) 268 | | (((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?,)*(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?) 269 | | ((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)/(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)) 270 | | ([\?]) 271 | | ([\*]) 272 | )[\s] 273 | DAY OF WEEK: 274 | ( 275 | (([1-7](-([1-7]))?,)*([1-7])(-([1-7]))?) 276 | | ([1-7]/([1-7])) 277 | | (((MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?,)*(MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?(C)?) 278 | | ((MON|TUE|WED|THU|FRI|SAT|SUN)/(MON|TUE|WED|THU|FRI|SAT|SUN)(C)?) 279 | | (([1-7]|(MON|TUE|WED|THU|FRI|SAT|SUN))(L|LW)?) 280 | | (([1-7]|MON|TUE|WED|THU|FRI|SAT|SUN)#([1-7])?) 281 | | ([\?]) 282 | | ([\*]) 283 | ) 284 | YEAR (OPTIONAL): 285 | ( 286 | [\s]? 287 | ([\*])? 288 | | ((19[7-9][0-9])|(20[0-9][0-9]))? 289 | | (((19[7-9][0-9])|(20[0-9][0-9]))/((19[7-9][0-9])|(20[0-9][0-9])))? 290 | | ((((19[7-9][0-9])|(20[0-9][0-9]))(-((19[7-9][0-9])|(20[0-9][0-9])))?,)*((19[7-9][0-9])|(20[0-9][0-9]))(-((19[7-9][0-9])|(20[0-9][0-9])))?)? 291 | ) 292 | 293 | 294 | 295 | 297 | 298 | 299 | 300 | 301 | 302 | Number of times to repeat the Trigger (-1 for indefinite) 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | Simple Trigger Misfire Instructions 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | Cron Trigger Misfire Instructions 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | Date Interval Trigger Misfire Instructions 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | Interval Units 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/start.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM Script thanks to Ben Gripka and his StackOverflow answer http://stackoverflow.com/a/10052222/670151 4 | 5 | :: BatchGotAdmin 6 | :------------------------------------- 7 | REM --> Check for permissions 8 | >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" 9 | 10 | REM --> If error flag set, we do not have admin. 11 | if '%errorlevel%' NEQ '0' ( 12 | REM Reset error level 13 | set errorlevel=0 14 | echo Requesting administrative privileges... 15 | goto UACPrompt 16 | ) else ( goto gotAdmin ) 17 | 18 | :UACPrompt 19 | echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" 20 | set params = %*:"="" 21 | echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" 22 | if '%errorlevel%' NEQ '0' ( 23 | echo Failed to request admin rights 24 | PAUSE 25 | del "%temp%\getadmin.vbs" 26 | exit /B 27 | ) 28 | "%temp%\getadmin.vbs" 29 | del "%temp%\getadmin.vbs" 30 | exit /B 31 | 32 | :gotAdmin 33 | pushd "%CD%" 34 | CD /D "%~dp0" 35 | :-------------------------------------- 36 | 37 | SC start ServiceStackWithQuartz 38 | start http://localhost:8088/ 39 | PAUSE -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/stop.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM Script thanks to Ben Gripka and his StackOverflow answer http://stackoverflow.com/a/10052222/670151 4 | 5 | :: BatchGotAdmin 6 | :------------------------------------- 7 | REM --> Check for permissions 8 | >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" 9 | 10 | REM --> If error flag set, we do not have admin. 11 | if '%errorlevel%' NEQ '0' ( 12 | REM Reset error level 13 | set errorlevel=0 14 | echo Requesting administrative privileges... 15 | goto UACPrompt 16 | ) else ( goto gotAdmin ) 17 | 18 | :UACPrompt 19 | echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" 20 | set params = %*:"="" 21 | echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" 22 | if '%errorlevel%' NEQ '0' ( 23 | echo Failed to request admin rights 24 | PAUSE 25 | del "%temp%\getadmin.vbs" 26 | exit /B 27 | ) 28 | "%temp%\getadmin.vbs" 29 | del "%temp%\getadmin.vbs" 30 | exit /B 31 | 32 | :gotAdmin 33 | pushd "%CD%" 34 | CD /D "%~dp0" 35 | :-------------------------------------- 36 | 37 | SC stop ServiceStackWithQuartz 38 | 39 | PAUSE -------------------------------------------------------------------------------- /ServiceStackWithQuartz/ServiceStackWithQuartz/uninstall.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM Script thanks to Ben Gripka and his StackOverflow answer http://stackoverflow.com/a/10052222/670151 4 | 5 | :: BatchGotAdmin 6 | :------------------------------------- 7 | REM --> Check for permissions 8 | >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" 9 | 10 | REM --> If error flag set, we do not have admin. 11 | if '%errorlevel%' NEQ '0' ( 12 | REM Reset error level 13 | set errorlevel=0 14 | echo Requesting administrative privileges... 15 | goto UACPrompt 16 | ) else ( goto gotAdmin ) 17 | 18 | :UACPrompt 19 | echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" 20 | set params = %*:"="" 21 | echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" 22 | if '%errorlevel%' NEQ '0' ( 23 | echo Failed to request admin rights 24 | PAUSE 25 | del "%temp%\getadmin.vbs" 26 | exit /B 27 | ) 28 | "%temp%\getadmin.vbs" 29 | del "%temp%\getadmin.vbs" 30 | exit /B 31 | 32 | :gotAdmin 33 | pushd "%CD%" 34 | CD /D "%~dp0" 35 | :-------------------------------------- 36 | 37 | SET INSTALL_UTL="%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" 38 | 39 | %INSTALL_UTL% /u bin\Release\ServiceStackWithQuartz.exe 40 | 41 | PAUSE --------------------------------------------------------------------------------