@Override public void setConfiguration(Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); port = cfg.getInt("port", 65000); }
@Override public void init () { if (state == -1) { setModified (false); try { initService(); state = QBean.STOPPED; } catch (Throwable t) { log.warn ("init", t); } } }
@Override public void destroy () { if (state == QBean.DESTROYED) return; if (state != QBean.STOPPED) stop(); if (scheduledThreadPoolExecutor != null) { scheduledThreadPoolExecutor.shutdown(); scheduledThreadPoolExecutor = null; } try { destroyService(); } catch (Throwable t) { log.warn ("destroy", t); } state = QBean.DESTROYED; }
public void initService() throws Exception { super.initService(); Space sp = SpaceFactory.getSpace("tspace:dbconfig"); String cm = cfg.get("config-modifier", null); String dbprefix = (cm != null ? cm.split(":")[0] + ":" : ""); sp.out(dbprefix + "connection.username", cfg.get("dbuser", "UNKNOWN")); sp.out(dbprefix + "connection.password", cfg.get("dbpass", "UNKNOWN")); new org.jpos.ee.DB(cm); } }
protected void close (Closeable... closeables) { LogEvent evt = null; for (Closeable c : closeables) { try { c.close(); } catch (Exception e) { if (evt == null) evt = getLog().createWarn(); evt.addMessage(e); } } if (evt != null) Logger.log(evt); } }
@Override public void setConfiguration(Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); scripts = cfg.getAll("script"); }
@Override public void setConfiguration(Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); configResource = cfg.get("config-resource", "classpath:/logback.xml"); }
@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); queueName = cfg.get("queue", null); if (queueName == null) throw new ConfigurationException("'queue' property not configured"); sp = SpaceFactory.getSpace(cfg.get("space")); timeout = cfg.getLong("timeout", timeout); } }
@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); lazy.set(cfg.getBoolean("lazy")); pubKeyRing = cfg.get("pubkeyring", "cfg/keyring.pub"); privKeyRing = cfg.get("privkeyring", "cfg/keyring.priv"); waitTimeout = cfg.getLong("timeout", 30000L); ttl = cfg.getLong("ttl", 3600000L); duration = cfg.getLong("duration", 86400000L); maxRandomOperations = cfg.getInt("max-random-operations", 100000); String unlockPassword = cfg.get("unlock-password", null); if (unlockPassword != null) { try { unlock (new SensitiveString(unlockPassword)); } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException | NoSuchProviderException | InvalidAlgorithmParameterException e) { throw new ConfigurationException(e); } } }
@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); enableTLS = cfg.getBoolean("TLS", false); keyStore = cfg.get("keystore"); password = cfg.get("storepassword", getPassword()); keyPassword = cfg.get("keypassword", getKeyPassword()); clientAuthNeeded = cfg.getBoolean("client-auth", false); serverAuthNeeded = cfg.getBoolean("server-auth", false); enabledCipherSuites = cfg.getAll("enabled-cipher"); enabledProtocols = cfg.getAll("enable-protocol"); queue = cfg.get("queue"); }
public void setConfiguration(Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg);
public void setConfiguration(Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); psp = SpaceFactory.getSpace(cfg.get("space")); String muxName = "mux." + cfg.get("mux"); try { mux = (MUX) NameRegistrar.get(muxName); } catch (NameRegistrar.NotFoundException e) { throw new ConfigurationException( "MUX '" + muxName + "' not found in registrar." ); } flagRetransmissions = cfg.get("flag-retransmissions", ""); initialDelay = cfg.getLong("initial-delay", 30000L); interMessageDelay = cfg.getLong("inter-message-delay", 1000L); waitForResponse = cfg.getLong("wait-for-response", 60000L); maxRetransmissions = cfg.getInt("max-retransmissions", 0); expiration = cfg.getLong("expire-after", 0L) * 1000L; validResponseCodes = cfg.get("valid-response-codes", "00"); retryResponseCodes = cfg.get("retry-response-codes", null); preMessageDelay = cfg.getLong("pre-message-delay", 0L); }
throws ConfigurationException super.setConfiguration (cfg); debug = cfg.getBoolean ("debug", true); debugContext = cfg.getBoolean ("debug-context", debug);