protected void readInstanceSettings(IConfiguration config) { // load settings from config file without overwriting existing values String proxySection = PROXY_PREFIX + m_proxyId + "."; if (m_clusterID == 0) { m_clusterID = config.getIntProperty(proxySection + CLUSTER_ID_NAME, 0); } if (m_port == 0) { int defaultPort = config.getIntProperty(PROXY_PREFIX + LISTEN_PORT_NAME, DEFAULT_LISTEN_PORT); m_port = config.getIntProperty(proxySection + LISTEN_PORT_NAME, defaultPort); } if (m_threadCount == 0) { int defaultThreadCount = config.getIntProperty(CONFIG_SIMULT_FAST_OPERATIONS, DEFAULT_SIMULT_FAST_OPERATIONS); m_threadCount = config.getIntProperty(proxySection + SIMULTANEOUS_OPS_NAME, defaultThreadCount); } if (m_bindAddress == null) { String defaultBindAddress = config.getProperty(PROXY_PREFIX + BIND_ADDRESS); m_bindAddress = config.getProperty(proxySection + BIND_ADDRESS, defaultBindAddress); } }
public ClientSupportManager(ITransactionManager txManager, IConfiguration config) { super(txManager); m_txManager = txManager; m_configuration = config; File nfsRoot = NFSUtils.getNFSRoot(config); m_cacheBaseDir = new File(nfsRoot, "sysconf/cache"); try { m_sr = SecureRandom.getInstance("SHA1PRNG"); } catch (NoSuchAlgorithmException ex) { // should never occur. m_logCategory.fatal("Can't initialize", ex); throw new RuntimeException("Initialization failed: " + ex); } String prefix = config.getProperty("client.url.prefix"); if (prefix == null) { prefix = "http://" + config.getProperty("default.backend.hostname") + "/cache/client"; } m_urlPrefix = prefix; m_smtpSession = createSMTPSession(config); }
private boolean isLocalBackend(String backend) { IConfiguration cm = ManagementContainer.getInstance().getConfiguration(); String localBackend = cm.getProperty("default.backend.hostname"); return EqualityUtils.nullsOrEqual(localBackend, backend); }