@Test public void testThreadStarted() { System.out.println("threadStarted"); instance.threadStarted(); }
@Override public void threadStarted() { try { Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(getEncoderClass()); Object o = c.newInstance(); if (!(o instanceof UDPTrafficDecoder)) { throw new ClassNotFoundException("Class does not implement " + UDPTrafficDecoder.class.getCanonicalName()); } encoder = (UDPTrafficDecoder) o; log.debug("Using decoder: " + encoder); } catch (Exception ex) { if (!getEncoderClass().isEmpty()) { log.warn("Problem loading encoder " + getEncoderClass() + ", raw data will be used", ex); } encoder = this; } }
UDPSampler extends AbstractIPSampler implements UDPTrafficDecoder, ThreadListener { @Override public void threadStarted() { try { Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(getEncoderClass()); Object o = c.newInstance(); if (!(o instanceof UDPTrafficDecoder)) { throw new ClassNotFoundException("Class does not implement " + UDPTrafficDecoder.class.getCanonicalName()); } encoder = (UDPTrafficDecoder) o; log.debug("Using decoder: " + encoder); } catch (Exception ex) { if (!getEncoderClass().isEmpty()) { log.warn("Problem loading encoder " + getEncoderClass() + ", raw data will be used", ex); } encoder = this; } } }
UDPSampler extends AbstractIPSampler implements UDPTrafficDecoder, ThreadListener { @Override public void threadStarted() { try { Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(getEncoderClass()); Object o = c.newInstance(); if (!(o instanceof UDPTrafficDecoder)) { throw new ClassNotFoundException("Class does not implement " + UDPTrafficDecoder.class.getCanonicalName()); } encoder = (UDPTrafficDecoder) o; log.debug("Using decoder: " + encoder); } catch (Exception ex) { if (!getEncoderClass().isEmpty()) { log.warn("Problem loading encoder " + getEncoderClass() + ", raw data will be used", ex); } encoder = this; } }  }
UDPSampler extends AbstractIPSampler implements UDPTrafficDecoder, ThreadListener { @Override public void threadStarted() { try { Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(getEncoderClass()); Object o = c.newInstance(); if (!(o instanceof UDPTrafficDecoder)) { throw new ClassNotFoundException("Class does not implement " + UDPTrafficDecoder.class.getCanonicalName()); } encoder = (UDPTrafficDecoder) o; log.debug("Using decoder: " + encoder); } catch (Exception ex) { if (!getEncoderClass().isEmpty()) { log.warn("Problem loading encoder " + getEncoderClass() + ", raw data will be used", ex); } encoder = this; } }  boolean isWaitResponse(); boolean isCloseChannel(); String getEncoderClass(); void setWaitResponse(boolean selected); void setCloseChannel(boolean selected); void setEncoderClass(String text); String getBindAddress(); void setBindAddress(String text); String getBindPort(); int getBindPortAsInt(); void setBindPort(String text); @Override ByteBuffer encode(String data); @Override byte[] decode(byte[] buf); @Override void threadStarted(); @Override void threadFinished(); @Override boolean interrupt(); }
UDPSampler extends AbstractIPSampler implements UDPTrafficDecoder, ThreadListener { @Override public void threadStarted() { try { Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(getEncoderClass()); Object o = c.newInstance(); if (!(o instanceof UDPTrafficDecoder)) { throw new ClassNotFoundException("Class does not implement " + UDPTrafficDecoder.class.getCanonicalName()); } encoder = (UDPTrafficDecoder) o; log.debug("Using decoder: " + encoder); } catch (Exception ex) { if (!getEncoderClass().isEmpty()) { log.warn("Problem loading encoder " + getEncoderClass() + ", raw data will be used", ex); } encoder = this; } }  boolean isWaitResponse(); boolean isCloseChannel(); String getEncoderClass(); void setWaitResponse(boolean selected); void setCloseChannel(boolean selected); void setEncoderClass(String text); String getBindAddress(); void setBindAddress(String text); String getBindPort(); int getBindPortAsInt(); void setBindPort(String text); @Override ByteBuffer encode(String data); @Override byte[] decode(byte[] buf); @Override void threadStarted(); @Override void threadFinished(); @Override boolean interrupt(); static final String ENCODECLASS; static final String WAITRESPONSE; static final String CLOSECHANNEL; static final String BIND_ADDRESS; static final String BIND_PORT; }