private void installBootstrapConfigurationService(WeldDeployment deployment, DeploymentUnit parentDeploymentUnit) { final boolean nonPortableMode = parentDeploymentUnit.getAttachment(WeldConfiguration.ATTACHMENT_KEY).isNonPortableMode(); final ExternalConfiguration configuration = new ExternalConfigurationBuilder() .add(ConfigurationKey.NON_PORTABLE_MODE.get(), nonPortableMode) .add(ConfigurationKey.ALLOW_OPTIMIZED_CLEANUP.get(), true) .build(); deployment.getServices().add(ExternalConfiguration.class, configuration); }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
static Object getValue(ConfigurationKey key, WeldConfiguration configuration) { Object defaultValue = key.getDefaultValue(); Object value = null; if (defaultValue instanceof Boolean) { value = configuration.getBooleanProperty(key); } else if (defaultValue instanceof Long) { value = configuration.getLongProperty(key); } else if (defaultValue instanceof Integer) { value = configuration.getIntegerProperty(key); } else if (defaultValue instanceof String) { value = configuration.getStringProperty(key); } return value; }
public static final boolean isEnabled(WeldConfiguration configuration) { return isEnabled(configuration.getStringProperty(UNUSED_BEANS_EXCLUDE_TYPE)); }
/** * * @param key * @return the property for the given key * @throws IllegalStateException If the property type does not match the required type */ public Long getLongProperty(ConfigurationKey key) { return getProperty(key, Long.class); }
/** * Process the given string key and value. First try to convert the <code>stringKey</code> - unsupported keys are ignored. Then delegate to * {@link #processKeyValue(Map, ConfigurationKey, Object)}. * * @param properties * @param stringKey * @param value */ private void processKeyValue(Map<ConfigurationKey, Object> properties, String stringKey, Object value) { processKeyValue(properties, stringKey, value, false); }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
static Object getValue(ConfigurationKey key, WeldConfiguration configuration) { Object defaultValue = key.getDefaultValue(); Object value = null; if (defaultValue instanceof Boolean) { value = configuration.getBooleanProperty(key); } else if (defaultValue instanceof Long) { value = configuration.getLongProperty(key); } else if (defaultValue instanceof Integer) { value = configuration.getIntegerProperty(key); } else if (defaultValue instanceof String) { value = configuration.getStringProperty(key); } return value; }
public static final boolean isEnabled(WeldConfiguration configuration) { return isEnabled(configuration.getStringProperty(UNUSED_BEANS_EXCLUDE_TYPE)); }
/** * * @param key * @return the property for the given key * @throws IllegalStateException If the property type does not match the required type */ public String getStringProperty(ConfigurationKey key) { return getProperty(key, String.class); }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
static Object getValue(ConfigurationKey key, WeldConfiguration configuration) { Object defaultValue = key.getDefaultValue(); Object value = null; if (defaultValue instanceof Boolean) { value = configuration.getBooleanProperty(key); } else if (defaultValue instanceof Long) { value = configuration.getLongProperty(key); } else if (defaultValue instanceof Integer) { value = configuration.getIntegerProperty(key); } else if (defaultValue instanceof String) { value = configuration.getStringProperty(key); } return value; }
public static final boolean isEnabled(WeldConfiguration configuration) { return isEnabled(configuration.getStringProperty(UNUSED_BEANS_EXCLUDE_TYPE)); }
/** * * @param key * @return the property for the given key * @throws IllegalStateException If the property type does not match the required type */ public Boolean getBooleanProperty(ConfigurationKey key) { return getProperty(key, Boolean.class); }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
static Object getValue(ConfigurationKey key, WeldConfiguration configuration) { Object defaultValue = key.getDefaultValue(); Object value = null; if (defaultValue instanceof Boolean) { value = configuration.getBooleanProperty(key); } else if (defaultValue instanceof Long) { value = configuration.getLongProperty(key); } else if (defaultValue instanceof Integer) { value = configuration.getIntegerProperty(key); } else if (defaultValue instanceof String) { value = configuration.getStringProperty(key); } return value; }
/** * * @param key * @return the property for the given key * @throws IllegalStateException If the property type does not match the required type */ public Boolean getBooleanProperty(ConfigurationKey key) { return getProperty(key, Boolean.class); }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }
static Object getValue(ConfigurationKey key, WeldConfiguration configuration) { Object defaultValue = key.getDefaultValue(); Object value = null; if (defaultValue instanceof Boolean) { value = configuration.getBooleanProperty(key); } else if (defaultValue instanceof Long) { value = configuration.getLongProperty(key); } else if (defaultValue instanceof Integer) { value = configuration.getIntegerProperty(key); } else if (defaultValue instanceof String) { value = configuration.getStringProperty(key); } return value; }
@SuppressWarnings("unchecked") private <T> T initSystemProperty(ConfigurationKey key, Class<T> requiredType) { checkRequiredType(key, requiredType); String property = getSystemProperty(key.get()); return (T) (property != null ? key.convertValue(property) : key.getDefaultValue()); }