gresrun/jesque — pull request #29 by michaelcameron (2013-02-26 22:19:32+00:00)
Title: Allow a WorkerImpl subclass to validate the jobType

The Grails Jesque plugin cannot use Jesque 1.3.0 out of the box because of issue 24 (https://github.com/michaelcameron/grails-jesque/issues/24). In short, I had to override the addJobType early on just to loosen the requirement that the jobType class is `Runnable` or `Callable` so the job types can just be POGOs and we can follow convention over configuration.

With changes in Jesque 1.3.0 the constructor changed from adding jobTypes directly to the JobType map to calling `addJobType`. This started a cascade of code that leads to the GrailsWorkerImpl trying to add directly to the jobType map. I think it turns out my implementation of `addJobType` would never have worked, because it would have received the unmodifiable version returned by `WorkerImpl.getJobTypes`, but in all cases the jobTypes were set in the constructor (and thus worked in jesque < 1.3.0).