@Override public void sampleOccurred(SampleEvent e) { try { listener.sampleOccurred(e); } catch (RemoteException err) { log.error("RemoteException while handling sample occurred event.", err); // $NON-NLS-1$ } }
@Override public void testEnded(String host) { log.info("Test Ended on {}", host); try { for (SampleEvent se : sampleStore) { listener.sampleOccurred(se); } listener.testEnded(host); sampleStore.clear(); } catch (Error | RuntimeException ex) { // NOSONAR We want to have errors logged in log file log.error("testEnded(host)", ex); throw ex; } catch (Exception ex) { log.error("testEnded(host)", ex); } }
@Override public void sampleOccurred(SampleEvent e) { try { listener.sampleOccurred(e); } catch (RemoteException err) { if (err.getCause() instanceof java.net.ConnectException){ throw new JMeterError("Could not return sample",err); } log.error("sampleOccurred", err); } }
if (obj instanceof SampleEvent) { try { listener.sampleOccurred((SampleEvent) obj); } catch (RemoteException err) { if (err.getCause() instanceof java.net.ConnectException){
@Override public void sampleOccurred(SampleEvent event) { //Strip the response data before writing, but only for a successful request. SampleResult result = event.getResult(); if(stripAlsoOnError || result.isSuccessful()) { // Compute bytes before stripping stripResponse(result); // see Bug 57449 for (SampleResult subResult : result.getSubResults()) { stripResponse(subResult); } } if(decoratedSender == null) { try { listener.sampleOccurred(event); } catch (RemoteException e) { log.error("Error sending sample result over network", e); } } else { decoratedSender.sampleOccurred(event); } }