protected void loadProperties() { PropertyUtil.loadFromPropertiesFile(properties); PropertyUtil.loadFromEnvironment(properties); PropertyUtil.loadFromSystemProperty(properties); PropertyUtil.loadMappedEnvironmentalProperties(properties); }
protected void loadDefaults() { PropertyUtil.loadDefaults(properties); }
public void startServices() { ServiceUtil.startServices(); }
private static void loadDefaultOnInterface( final Properties properties, final Class<? extends GuiceProperty> guiceProperty, final Field field) throws IllegalAccessException { for (final Class<? extends GuiceProperty> guicePropertyClass : ((Class<? extends GuiceProperty>[]) guiceProperty.getInterfaces())) { if (!GuiceProperty.class.equals(guicePropertyClass)) properties.setProperty(getName(guicePropertyClass), getValue(field).toString()); } }
public static String getValue( final Properties properties, final Class<? extends GuiceProperty> guiceProperty) { return (properties.getProperty(getName(guiceProperty))); }
public static void loadDefaults(final Properties properties) { getProperties().forEach(p -> loadDefault(properties, p)); }
public static void loadFromEnvironment(final Properties properties) { getProperties().forEach(p -> loadPropertyFromEnvironment(properties, p)); }
public static void loadFromSystemProperty(final Properties properties){ getProperties().forEach(p -> loadPropertyFromSystemProperty(properties, p)); }
public static void setJavaProperty( final Properties properties, final Class<? extends JavaEnvironmentProperty> environmentProperty) { for (final JavaEnvironmentProperty environmentProperty1 : environmentProperty.getEnumConstants()) { System.setProperty( environmentProperty1.getKey(), getValue(properties, environmentProperty1.getPropertyKey())); } } }
public static void startServices() { installConcreteServices(); INSTALLED_SERVICES.forEach(service -> doStartService(service)); }
public static void loadMappedEnvironmentalProperties(final Properties properties) { getEnvironmentProperties().forEach(p -> loadEnvironmentProperty(properties, p)); }
public static void setJavaProperties(final Properties properties) { getJavaEnvironmentProperties().forEach(p -> setJavaProperty(properties, p)); }
protected void bindToProperties() { PropertyUtil.getProperties().forEach(p -> bindToProperty(p)); }
public void stopServices() { try { ServiceUtil.stopServices(); } catch (Exception e) { LOGGER.warn("Error stopping services", e); } } }
public static void stopServices() { INSTALLED_SERVICES.forEach(service -> doStopService(service)); }
@Override protected void configure() { bind(Properties.class).toInstance(properties); bindToProperties(); PropertyUtil.setJavaProperties(properties); }
public static String getEnvironmentVariableName(final Class<? extends GuiceProperty> guiceProperty) { return (getName(guiceProperty).replaceAll("\\.", "_")); }
protected Class<? extends AbstractCommandLineHandler> getCommandLineHandlerClass() { return (getOperatingMode(PropertyUtil.getValue(getProperties(), getOperatingModeClass())) .getInitiatorClass()); }
private static void loadPropertyFromProperties( final Properties tempProperties, final Properties properties, final Class<? extends GuiceProperty> guiceProperty) { System.out.println("loading from properties file:" + guiceProperty); final Object value = tempProperties.get(getName(guiceProperty)); if (value != null) properties.put(getName(guiceProperty), value); }
private static void loadPropertyFromSystemProperty( final Properties properties, final Class<? extends GuiceProperty> guiceProperty) { System.out.println("loading from SystemProperty:" + guiceProperty); final String value = System.getProperty(getName(guiceProperty)); if (value != null) properties.setProperty(getName(guiceProperty), value); }