if you have over jobs' source files why not just create a parent abstract class that invokes the execute method on all your jobs and catches the exceptions
Why not write something like:
Code:
public abstract class ManagedJob implements Job
{
public void execute( JobExecutionContext jobExecContext ) throws JobExecutionException
{
try
{
executeRealWork(jobExecContext );
}
catch( Exception e )
{
ManagementBusinesiness.emailAdmin(jobExecContext );
}
}
public abstract Boolean executeRealWork(JobExecutionContext jobExecContext );
}
And then you just have to change all your jobs to extend this one and change the execute() to executeRealWork() in your individual job classes.
Another alternative to use and AOP crosscut against all Jobs, This might be a more declarative way of handling it abd would likely result in less code changes. but I have never done so I can't really comment on ease or difficulty.