class SystemPropertyInitializer implements InitializingBean {

	/**
	 * Name of system property used by default.
	 */
	public static final String ENVIRONMENT = "org.springframework.batch.support.SystemPropertyInitializer.ENVIRONMENT";

	private String keyName = ENVIRONMENT;

	private String defaultValue;

	/**
	 * Set the key name for the System property that is created. Defaults to
	 * {@link #ENVIRONMENT}.
	 * @param keyName the key name to set
	 */
	public void setKeyName(String keyName) {
		this.keyName = keyName;
	}

	/**
	 * Mandatory property specifying the default value of the System property.
	 * @param defaultValue the default value to set
	 */
	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}

	/**
	 * Sets the System property with the provided name and default value.
	 *
	 * @see InitializingBean#afterPropertiesSet()
	 */
	@Override
	public void afterPropertiesSet() throws Exception {<FILL_FUNCTION_BODY>}

}

		Assert.state(defaultValue != null || System.getProperty(keyName) != null,
				"Either a default value must be specified or the value should already be set for System property: "
						+ keyName);
		System.setProperty(keyName, System.getProperty(keyName, defaultValue));
	
<no_super_class>