use of org.compiere.util.ASyncProcess in project adempiere by adempiere.
the class ProcessBuilder method processCtl.
/**
* Create instancel for process control
* @param className
* @param parent
* @param windowNo
* @param processInfo
* @param trx
* @return
* @throws RuntimeException
*/
private Runnable processCtl(String className, ASyncProcess parent, int windowNo, ProcessInfo processInfo, Trx trx) throws RuntimeException {
Class<?> clazz;
Runnable result = null;
try {
clazz = Class.forName(className);
Constructor<?> constructor = null;
if (windowNo == 0) {
constructor = clazz.getDeclaredConstructor(ASyncProcess.class, ProcessInfo.class, Trx.class);
result = (Runnable) constructor.newInstance(parent, processInfo, trx);
} else {
constructor = clazz.getDeclaredConstructor(ASyncProcess.class, Integer.class, ProcessInfo.class, Trx.class);
result = (Runnable) constructor.newInstance(parent, windowNo, processInfo, trx);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return result;
}
Aggregations