A few months ago I wrote a couple of adapters to integrate Quartz.Net into Windsor. These were loose components that you had to register yourself and the configuration wasn't very friendly. So I decided to wrap them in a facility to make things cleaner and easier.
This is what the facility provides:
- Some Windsor-managed Quartz entities:
- IJob / IStatefulJob
- ISchedulerListener
- IJobListener (both global and per-job)
- ITriggerListener (both global and per-trigger)
- IScheduler
- IJobFactory (although you probably won't use this...)
- Automatic FileScanJob registering
- IJobScheduler: a simpler IScheduler
- Automatic scheduler starting if the Startable facility is present (otherwise you'll have to call IScheduler.Start() manually)
Here's what it doesn't support:
- These entities are NOT Windsor-managed (they are instantiated normally by Quartz instead)
- IThreadPool
- IJobStore
- ISchedulerPlugin
- All other interfaces and/or quartz entities
- Listeners declared in quartz_jobs.xml
- Trigger and job group names
Note that it's up to you to register jobs with the appropriate lifestyle. Listeners can only have singleton lifestyle since they're injected in IScheduler which is itself a singleton.
Here are the bits:
- Binaries
- Sample app (source code)
Hi
ReplyDeleteThis is very interesting as we've just gone from castle.scheduler to quartz and would ideally like to use your integration!
I would love to help out if i can but my inderstanding of the nuts and bolts of castle are v.limited.
give me a shout if i can help :)
@wayne-o: great! We should move this discussion to the castle dev list. Create a new thread there and I'll get you up to speed.
ReplyDeleteFFR here is the link to that convo:
ReplyDeletehttp://groups.google.com/group/castle-project-users/browse_thread/thread/1b5971028d05a2ab/9d2b197b9c20eb68?lnk=gst&q=QUARTZ#9d2b197b9c20eb68
Thanks this is really awesome! One question: how would I get a reference to the QuartzNetScheduler after it has been created through the windsor facility? I ask because I am using quartz from a windows service and I want to properly shut down the scheduler when the service is stopped.
ReplyDeleteThanks
@Anonymous: resolve Quartz.IScheduler from Windsor.
ReplyDeleteI'm using this facility in my project and I'd like to have the jobs 'Transient'. By default, it seems they are singletons.
ReplyDeleteIs there a way to define the job LifeStyle like this:
container.Register(Component.For().ImplementedBy().LifeStyle.Transient);
or similar?
Thank you!
Ciprian
Ok, I've just succeed:
ReplyDeletecontainer.Register(Component.For().Named("sampleJob").LifeStyle.Transient);
Thanks!
Ciprian
Do you have any plan for implementing the facility for Quartz 2.0?
ReplyDeleteDo you need help? I can fork the project on github?
Thanks
@Davide: sure, go ahead and fork it.
ReplyDeletehey mauricio, do you have any plans of providing castle integration the latest build of quartz together?
ReplyDeleteWe would like to use quartz 2.1.2 and castle 3.0.0.
@Mihir : I upgraded the package to Castle 3.2 and Quartz 2.x about a month ago: http://nuget.org/packages/Quartz.Windsor/
ReplyDeletePlease use the issue tracker or the Castle mailing list for any other questions about this.
@wayne-o: Thanks this looks awesome but unfortunately it's not working for me. I keep getting an error saying it could not load assembly Quartz, Version=2.2.400.0. However, when I look in my packages folder I see the version of Quartz nuGet actually downloaded is 2.2.2.4. I tried to download your source project so I could re-compile it with Quartz 2.2.2.4 version but all the references are duplicated/messed up. I tried resolving them but then I get a whole bunch of other errors. *sigh* Anyhow, I figured this might be something you could fix really fast before I went to crazy trying to fix it myself. Please let me know if I am doing anything wrong. Thanks again!
ReplyDelete@nub340 What specifically are you talking about? If there are issues with this Windsor facility please post them to https://github.com/castleprojectcontrib/QuartzNetIntegration/issues
ReplyDelete@wayne-o: Thanks for the quick response! Okay I created an issue on GitHub for this: https://github.com/castleprojectcontrib/QuartzNetIntegration/issues/13
ReplyDelete@nub240 Just to clear things up: I'm not wayne-o, my name is Mauricio Scheffer, I'm the author of the project and this post.
ReplyDeleteI see sorry for the mix-up.
ReplyDeleteMauricio, I downloaded your code from github and see how you implemented the various listeners in the SampleApp. You mentioned that the IJob interface was also Windsor managed as was IJobFactory. From what i saw in the sample app, the job you use was purely a Quartz implementation, not Windsor. Do you have a sample that injects the jobs via Windsor? Also, I assume i could set the jobs up in SQL using an ADOJobStore?
ReplyDeleteTo give you some idea of what we are doing, we are creating a service that will execute many different jobs at different times, but we do not want to have to recompile every time we add a job.
I guess i am unclear on what would have to change to inject a job using Windsor both in the config and the quartz_jobs.xml?
@SpaceCowboy1974 : all jobs are managed by Windsor. In the SampleApp, the SampleJob is resolved from Windsor whenever Quartz needs it, and therefore it can get injected as usual (either via constructor or setters).
ReplyDeleteAnd yes you should be able to use this with any job store.
Please post any questions about this facility to https://groups.google.com/forum/#!forum/castle-users and any issues to https://github.com/castleprojectcontrib/QuartzNetIntegration/issues
ReplyDeleteHi Mauricio!
ReplyDeleteI've been using the castle quartz.net integration facility version 0.1.0.0 for a few years, and it's been working great!
I just upgraded to 0.3.2.0 b/c I upgraded Quartz, but I'm finding that the new implementation of IScheduler, QuartzNetScheduler, no longer includes the SetSchedulerListeners method, so my custom implementation of ISchedulerListener is not getting added to the SchedulerListeners. Is this just an oversight or is it intentional for some reason? Is there a plan to add it back?
Thanks!
~b
Hi Brooke, can you post that to https://github.com/castleprojectcontrib/QuartzNetIntegration/issues ? Thanks
ReplyDeleteHello, its fastidious paragraph concerning media print, we all understand media is a enormous source of information.
ReplyDelete