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)
11 comments:
Hi
This 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.
FFR here is the link to that convo:
http://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.
Thanks
@Anonymous: resolve Quartz.IScheduler from Windsor.
I'm using this facility in my project and I'd like to have the jobs 'Transient'. By default, it seems they are singletons.
Is 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:
container.Register(Component.For().Named("sampleJob").LifeStyle.Transient);
Thanks!
Ciprian
Do you have any plan for implementing the facility for Quartz 2.0?
Do you need help? I can fork the project on github?
Thanks
@Davide: sure, go ahead and fork it.
hey mauricio, do you have any plans of providing castle integration the latest build of quartz together?
We 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/
Please use the issue tracker or the Castle mailing list for any other questions about this.
Post a Comment