(ArrayList<ProcInfo> processes)
| 207 | } |
| 208 | |
| 209 | public synchronized void retrieveProcessInfo(ArrayList<ProcInfo> processes) throws Exception { |
| 210 | assert !Platform.isFxApplicationThread() : "cannot run this method from the FX thread"; |
| 211 | |
| 212 | OtpErlangObject receiveRPC = null; |
| 213 | |
| 214 | try { |
| 215 | sendRPC("erlyberly", "process_info", new OtpErlangList()); |
| 216 | receiveRPC = receiveRPC(); |
| 217 | OtpErlangList received = (OtpErlangList) receiveRPC; |
| 218 | |
| 219 | for (OtpErlangObject recv : received) { |
| 220 | if(recv instanceof OtpErlangList) { |
| 221 | OtpErlangList pinfo = (OtpErlangList) recv; |
| 222 | HashMap<Object, Object> propsToMap = OtpUtil.propsToMap(pinfo); |
| 223 | processes.add(ProcInfo.toProcessInfo(propsToMap)); |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | Platform.runLater(() -> { appProcs.set(new AppProcs(processes.size(), LocalDateTime.now())); }); |
| 228 | } catch (ClassCastException e) { |
| 229 | throw new RuntimeException("unexpected result: " + receiveRPC, e); |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | private boolean ensureAlive() { |
| 234 | if(connection.isAlive()) |
no test coverage detected