try {
return (JobStatus) Subject.doAsPrivileged(user, new PrivilegedExceptionAction<JobStatus>() {
public JobStatus run() throws Exception {
AccessController.checkPermission(new JdcpPermission("waitForJobStatusChange"));
return service.waitForJobStatusChange(jobId, lastEventId, timeoutMillis);
}
}, null);
} catch (PrivilegedActionException e) {