final ProvisioningSession session = new ProvisioningSession(agent);
Job o = new Job("Check for Updates") {
@Override
protected IStatus run(IProgressMonitor monitor) {
UpdateOperation o = new UpdateOperation(session);
IStatus s = o.resolveModal(monitor);
State state = fromStatus(s);
callback.call(new P2UpdateCheckRV(o, state, s.getMessage(), state == State.OK,s.getException()));
return Status.OK_STATUS;
}
};
o.schedule();
} catch (ProvisionException e) {
getLogger().error(e.getMessage(), e);
callback.call(new P2UpdateCheckRV(null, State.ERROR,"Failure while try to collect updateable units", null, e));
}
}