use of org.fagu.fmv.soft.utils.Proxifier in project fmv by f-agu.
the class SoftSearch method createAndfireEventFound.
/**
* @param founds
* @param softLocator
* @return
*/
private Soft createAndfireEventFound(Founds founds, SoftLocator softLocator) {
Soft soft = getProvider().createSoft(founds);
Proxifier<SoftFindListener> proxifier = new Proxifier<>(SoftFindListener.class);
proxifier.addAll(softFindListeners);
ServiceLoader.load(SoftFindListener.class).forEach(proxifier::add);
SoftFindListener softFindListener = proxifier.proxify();
softFindListener.eventFound(softLocator, soft);
return soft;
}
use of org.fagu.fmv.soft.utils.Proxifier in project fmv by f-agu.
the class SoftExecutor method execute.
// -------------------------------------------------------------
/**
* @param executorService
* @return
* @throws IOException
*/
private <R> R execute(SoftExecutor.ForExec<R> forExec) throws IOException {
ExecListener execListener = new Proxifier<>(ExecListener.class).addAll(execListeners).proxify();
CommandLine commandLine = getCommandLine();
String cmdLineStr = CommandLineUtils.toLine(commandLine);
execListener.eventPrepare(cmdLineStr);
List<String> readLineList = new ArrayList<>();
ReadLine bufferedReadLine = new BufferedReadLine(readLineList);
FMVExecutor fmvExecutor = createFMVExecutor(execFile.getParentFile(), bufferedReadLine);
applyCustomizeExecutor(fmvExecutor);
return forExec.exec(fmvExecutor, commandLine, execListener, readLineList);
}
Aggregations