Jul 17th, 2009, 11:21 AM
I am wondering if it is advisable to extend Job. I'd like to use spring batch for a number of jobs. However, I need a way to determine which job gets executed at runtime based on the value of a given domain object's attributes.
I was hoping to add a "supports" method to each Job instance to determine if the domain object meets a job's criteria by rolling over each job in the job registry. If the job does meet criteria, launch the job, else visit the next configured job and perform the same check.
I am struggling with the notion of having criteria checking wired into the job itself. In some respect, it seems like the proper place. However, it feels like something that should live at a higher level.
I'd be open to any suggestions.