private NHttpConfiguration() { try { props = MiscellaneousUtil.loadProperties("nhttp.properties"); populatePreserveHttpHeaders(); } catch (Exception ignore) {} }
/** * Loads the properties * This happen only cached properties are null. * * @return Synapse Properties */ public static Properties loadSynapseProperties() { if (reload) { if (log.isDebugEnabled()) { log.debug("Loading synapse properties from a property file"); } cacheProperties.putAll(MiscellaneousUtil.loadProperties( SynapseConstants.SYNAPSE_PROPERTIES)); reload = false; } else { if (log.isDebugEnabled()) { log.debug("Retrieving synapse properties from the cache"); } } // Original properties needed to be preserved Properties tempProperties = new Properties(); tempProperties.putAll(cacheProperties); return tempProperties; }
public ThreadingView(String threadNamePrefix, boolean periodicLogs, double alertMargin) { this(threadNamePrefix); Properties props = MiscellaneousUtil.loadProperties("synapse.properties"); String jmxEnabled = MiscellaneousUtil.getProperty(props, JmxConfigurationConstants.PROP_THREAD_JMX_ENABLE,"true"); if("false".equals(jmxEnabled)){ this.threadJMXViewEnabled = false; } this.periodicLogs = periodicLogs; if (alertMargin > 0 && alertMargin < 100) { this.alertMargin = alertMargin; } else { log.warn("Invalid alert margin for the thread group: " + threadNamePrefix + " - " + "Using default value"); } }
/** * Get instance of TenantInfoInitiator loaded based on synapse property path * * @return TenantInfoInitiator instance */ public static TenantInfoInitiator getTenantInfoInitiator() { if (tenantInfoInitiatorInstance == null) { try { Properties properties = MiscellaneousUtil.loadProperties(PROPERTY_FILE_PATH); String property = properties.getProperty(CARBON_TENANT_INFO_INITIATOR); if (property != null) { Class clazz = TenantInfoInitiator.class.getClassLoader(). loadClass(property.trim()); tenantInfoInitiatorInstance = (TenantInfoInitiator) clazz.newInstance(); } } catch (Exception e) { logger.error("Error while initializing tenant info configuration provider. Error:" + e.getLocalizedMessage()); } } return tenantInfoInitiatorInstance; } }
/** * Loads the properties * This happen only cached properties are null. * * @return Synapse Properties */ public static Properties loadSynapseProperties() { if (reload) { if (log.isDebugEnabled()) { log.debug("Loading synapse properties from a property file"); } cacheProperties.putAll(MiscellaneousUtil.loadProperties( SynapseConstants.SYNAPSE_PROPERTIES)); reload = false; } else { if (log.isDebugEnabled()) { log.debug("Retrieving synapse properties from the cache"); } } // Original properties needed to be preserved Properties tempProperties = new Properties(); tempProperties.putAll(cacheProperties); return tempProperties; }
public TargetHandler(DeliveryAgent deliveryAgent, ClientConnFactory connFactory, TargetConfiguration configuration) { this.deliveryAgent = deliveryAgent; this.connFactory = connFactory; this.targetConfiguration = configuration; this.targetErrorHandler = new TargetErrorHandler(targetConfiguration); this.metrics = targetConfiguration.getMetrics(); Properties props = MiscellaneousUtil.loadProperties(PROPERTY_FILE); String validationProperty = MiscellaneousUtil.getProperty(props, MESSAGE_SIZE_VALIDATION, "false"); String validMaxMessageSizeStr = MiscellaneousUtil .getProperty(props, VALID_MAX_MESSAGE_SIZE, String.valueOf(Integer.MAX_VALUE)); isMessageSizeValidationEnabled = Boolean.valueOf(validationProperty); try { validMaxMessageSize = Integer.valueOf(validMaxMessageSizeStr); } catch (NumberFormatException e) { log.warn("Invalid max message size configured for property \"valid.max.message.size.in.bytes\", " + "setting the Integer MAX_VALUE as the valid maximum message size", e); validMaxMessageSize = Integer.MAX_VALUE; } }
/** * Create a script mediator for the given language and given script entry key and function. * * @param language the BSF language * @param includeKeysMap Include script keys * @param key the registry entry key to load the script * @param function the function to be invoked */ public ScriptMediator(String language, Map<Value, Object> includeKeysMap, Value key, String function, ClassLoader classLoader) { this.language = language; this.key = key; this.setLoader(classLoader); this.includes = includeKeysMap; if (function != null) { this.function = function; } Properties properties = MiscellaneousUtil.loadProperties("synapse.properties"); poolSize = Integer.parseInt(properties.getProperty(POOL_SIZE_PROPERTY, String.valueOf(DEFAULT_POOL_SIZE))); initScriptEngine(); if (!(scriptEngine instanceof Invocable)) { throw new SynapseException("Script engine is not an Invocable" + " engine for language: " + language); } }
Properties synapseProps = MiscellaneousUtil.loadProperties(NHTTP_PROPERTIES); String nhttpLogDir = synapseProps.getProperty(NHTTP_LOG_DIRECTORY); if (nhttpLogDir != null) {
Properties props = MiscellaneousUtil.loadProperties(PROPERTY_FILE); String validationProperty = MiscellaneousUtil.getProperty(props, MESSAGE_SIZE_VALIDATION, "false"); String validMaxMessageSizeStr = MiscellaneousUtil