@Override public void configure(PropertiesManager pm) { super.configure(pm); maxConnect = pm.numCollectors; timeout = pm.timeout; }
/** * Called in the host list configuration, used to finished the configuration * of the starters * * @param pm the configuration */ public void configureStarters(PropertiesManager pm) { if(allStarters == null) return; // needed because started can failed (and be removed) or add other // starters List<Map.Entry<Object, Starter>> buffer = new ArrayList<>(allStarters.entrySet()); for(Map.Entry<Object, Starter> me: buffer) { try { me.getValue().configure(pm); } catch (Exception e) { allStarters.remove(me.getKey()); log(Level.ERROR, e, "Starter %s failed to configure: %s", me.getValue(), e); } } }
@Override public void configure(PropertiesManager pm) { super.configure(pm); protocol = pm.getProperty("ssl.protocol", null); // Default is false, because it was the default setting in previous release strict = pm.parseBoolean(pm.getProperty("ssl.strict", "false")); truststore = pm.getProperty("ssl.truststore", null); trustpassword = pm.getProperty("ssl.trustpassword", ""); format = pm.getProperty("ssl.trusttype", KeyStore.getDefaultType()); securerandom = pm.getProperty("ssl.securerandom", null); }
topStarters.add(top); registerStarter(top); top.configure(pm); } catch (Throwable e) { log(Level.ERROR, e, "Top level starter %s failed to register: %s", starterClass, e.getMessage());
private HostStarter addConnection(Starter cnx) throws IOException { String truststore = getClass().getClassLoader().getResource("localhost.jks").getFile(); PropertiesManager pm = Tools.makePm(testFolder, "timeout=1", "collectorThreads=1", "ssl.protocol=TLS", "ssl.strict=true", "ssl.truststore=" + truststore, "ssl.trustpassword=123456"); HostStarter localhost = new HostStarter(new HostInfo("localhost")); Timer t = Tools.getDefaultTimer(); localhost.setParent(t); localhost.getHost().setHostDir(testFolder.getRoot()); t.registerStarter(new SSLStarter()); t.registerStarter(new SocketFactory()); t.configureStarters(pm); localhost.registerStarter(cnx); cnx.configure(pm); return localhost; }