package org.csstudio.platform.libs.jms;

import javax.jms.Connection;
import javax.jms.JMSException;

import org.apache.activemq.ActiveMQConnection;
import org.apache.activemq.ActiveMQConnectionFactory;

/** Helper for connecting to a JMS server.
 *  Shields from the underling ActiveMQ API,
 *  only providing a <code>javax.jms.Connection</code>.
 *  
 *  @author Kay Kasemir
 */
public class JMSConnectionFactory
{
    /** Connect to JMS
     *  @param url URL of server. Details can differ for ActiveMQ
     *             or other implementations.
     *  @return Connection
     *  @throws JMSException on error
     */
    public static Connection connect(final String url) throws JMSException
    {
        // Instead of using JNDI lookup like this...
        //   Context ctx = new InitialContext();
        //   QueueConnectionFactory queueConnectionFactory = 
        //     (QueueConnectionFactory) ctx.lookup("SomeConnectionFactory");
        // ... which requires an appropriate jndi.properties file,
        // we directly use the ActiveMQConnectionFactory.
        final ActiveMQConnectionFactory factory =
            new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_USER,
                ActiveMQConnection.DEFAULT_PASSWORD, url);
        return factory.createConnection();
    }
}

@@ -698,16 +698,551 @@
 n%0A    %7B%0A
+        return connect(url, ActiveMQConnection.DEFAULT_USER,%0A                ActiveMQConnection.DEFAULT_PASSWORD);%0A    %7D%0A%0A    /** Connect to JMS%0A     *  @param url URL of server. Details can differ for ActiveMQ%0A     *             or other implementations.%0A     *  @param user JMS user name%0A     *  @param password JMS password%0A     *  @return Connection%0A     *  @throws JMSException on error%0A     */%0A    public static Connection connect(final String url,%0A            final String user, final String password) throws JMSException%0A    %7B%0A
         
@@ -1286,16 +1286,16 @@
 this...%0A
-
         
@@ -1695,92 +1695,22 @@
 ory(
-ActiveMQConnection.DEFAULT_USER,%0A                ActiveMQConnection.DEFAULT_PASSWORD
+user, password
 , ur

Add support for user/password