michaelmarconi/oncue — pull request #6 by petedmarsh (2013-01-16 21:25:16+00:00)
Title: Add generics to schedule jobs

This commit changes `AbstractScheduler` to include a type parameter which specifies the type of work request a schedule will accept.

Previously, concrete schedulers would perform a (possibly) unsafe cast in their `shceduleJobs` method, e.g. (line 144 of JVMCapacityScheduler):

`workRequests.add((JVMCapacityWorkRequest) workRequest)`

This cast now happens generically in `AbstractScheduler`, line 282:

`scheduleJobs((R) message)`

As this line did not previously try to recover from a `ClassCastException`, I did not add a try/catch. However, if this exception could bring down the scheduler then this should be added (I'm too unfamiliar with akka to tell if this is an issue).