use of org.apache.cloudstack.context.CallContext in project cloudstack by apache.
the class SystemVmLoadScanner method getCapacityScanTask.
private Runnable getCapacityScanTask() {
return new ManagedContextRunnable() {
@Override
protected void runInContext() {
try {
CallContext callContext = CallContext.current();
assert (callContext != null);
AsyncJobExecutionContext.registerPseudoExecutionContext(callContext.getCallingAccountId(), callContext.getCallingUserId());
reallyRun();
AsyncJobExecutionContext.unregister();
} catch (Throwable e) {
s_logger.warn("Unexpected exception " + e.getMessage(), e);
}
}
private void reallyRun() {
loadScan();
}
};
}
Aggregations