package hornetq.autoconfigure;

import java.io.File;

import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
import org.hornetq.core.server.JournalType;

/**
 * @author Stephane Nicoll
 */
class HornetQEmbeddedConfigurationFactory {

	private HornetQProperties.Embedded properties;

	public HornetQEmbeddedConfigurationFactory(HornetQProperties properties) {
		this.properties = properties.getEmbedded();
	}

	public Configuration createConfiguration() {
		ConfigurationImpl configuration = new ConfigurationImpl();
		configuration.setSecurityEnabled(false);
		configuration.setPersistenceEnabled(this.properties.isPersistent());

		if (this.properties.isPersistent()) {
			String dataDir = getDataDir();
			configuration.setJournalDirectory(dataDir + "/journal");
			configuration.setJournalType(JournalType.NIO);
			configuration.setLargeMessagesDirectory(dataDir + "/largemessages");
			configuration.setBindingsDirectory(dataDir + "/bindings");
			configuration.setPagingDirectory(dataDir + "/paging");
		}

		TransportConfiguration transportConfiguration = new TransportConfiguration(
				InVMAcceptorFactory.class.getName());
		configuration.getAcceptorConfigurations().add(transportConfiguration);
		return configuration;
	}

	private String getDataDir() {
		if (this.properties.getDataDirectory() != null) {
			return this.properties.getDataDirectory();
		}
		String tempDirectory = System.getProperty("java.io.tmpdir");
		return new File(tempDirectory, "hornetq-data").getAbsolutePath();
	}

}
@@ -790,49 +790,8 @@
 );%0A%0A
-%09%09if (this.properties.isPersistent()) %7B%0A%09
 %09%09St
@@ -817,25 +817,24 @@
 ataDir();%0A%09%09
-%09
 configuratio
@@ -874,24 +874,64 @@
 /journal%22);%0A
+%09%09if (this.properties.isPersistent()) %7B%0A
 %09%09%09configura
@@ -1358,16 +1358,73 @@
 ation);%0A
+%0A%09%09configuration.setClusterPassword(%22SpringBootRulez%22);%0A%0A
 %09%09return

Add workarounds for known issues