endpoint.setJndiInitialContextFactory("org.apache.activemq.jndi.ActiveMQInitialContextFactory");
endpoint.setJndiURL("tcp://localhost:" + JMS_PORT);
endpoint.setJndiConnectionFactoryName("ConnectionFactory");
final JMSConfiguration jmsConfig = new JMSConfiguration();
JndiTemplate jt = new JndiTemplate();
jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(endpoint));
JNDIConfiguration jndiConfig = new JNDIConfiguration();
jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
jmsConfig.setJndiTemplate(jt);
jmsConfig.setJndiConfig(jndiConfig);