qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r447994 [23/46] - in /incubator/qpid/trunk/qpid: ./ cpp/ cpp/bin/ cpp/broker/ cpp/broker/inc/ cpp/broker/src/ cpp/broker/test/ cpp/client/ cpp/client/inc/ cpp/client/src/ cpp/client/test/ cpp/common/ cpp/common/concurrent/ cpp/common/concur...
Date Tue, 19 Sep 2006 22:07:25 GMT
Added: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/FailoverPolicy.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/FailoverPolicy.java?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/FailoverPolicy.java (added)
+++ incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/FailoverPolicy.java Tue Sep 19 15:06:50 2006
@@ -0,0 +1,306 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.qpid.jms;
+
+import org.apache.qpid.jms.failover.FailoverMethod;
+import org.apache.qpid.jms.failover.FailoverRoundRobinServers;
+import org.apache.qpid.jms.failover.FailoverSingleServer;
+import org.apache.log4j.Logger;
+
+
+public class FailoverPolicy
+{
+    private static final Logger _logger = Logger.getLogger(FailoverPolicy.class);
+
+    private static final long MINUTE = 60000L;
+
+    private static final long DEFAULT_METHOD_TIMEOUT = 1 * MINUTE;
+    private static final long DEFAULT_FAILOVER_TIMEOUT = 4 * MINUTE;
+
+    private FailoverMethod _methods[] = new FailoverMethod[1];
+
+    private int _currentMethod;
+
+    private int _methodsRetries;
+
+    private int _currentRetry;
+
+    private boolean _timing;
+
+    private long _lastMethodTime;
+    private long _lastFailTime;
+
+    public FailoverPolicy(ConnectionURL connectionDetails)
+    {
+        FailoverMethod method;
+
+        //todo This should be integrated in to the connection url when it supports
+        // multiple strategies.
+
+        _methodsRetries = 0;
+
+        if (connectionDetails.getFailoverMethod() == null)
+        {
+            if (connectionDetails.getBrokerCount() > 1)
+            {
+                method = new FailoverRoundRobinServers(connectionDetails);
+            }
+            else
+            {
+                method = new FailoverSingleServer(connectionDetails);
+            }
+        }
+        else
+        {
+            String failoverMethod = connectionDetails.getFailoverMethod();
+
+/*
+            if (failoverMethod.equals(FailoverMethod.RANDOM))
+            {
+                //todo write a random connection Failover
+            }
+*/
+            if (failoverMethod.equals(FailoverMethod.ROUND_ROBIN))
+            {
+                method = new FailoverRoundRobinServers(connectionDetails);
+            }
+            else
+            {
+                try
+                {
+                    Class[] constructorSpec = {ConnectionURL.class};
+                    Object [] params = {connectionDetails};
+
+                    method = (FailoverMethod) ClassLoader.getSystemClassLoader().
+                            loadClass(failoverMethod).
+                            getConstructor(constructorSpec).newInstance(params);
+                }
+                catch (Exception cnfe)
+                {
+                    throw new IllegalArgumentException("Unknown failover method:" + failoverMethod);
+                }
+            }
+        }
+
+        if (method == null)
+        {
+            throw new IllegalArgumentException("Unknown failover method specified.");
+        }
+
+        reset();
+
+        _methods[_currentMethod] = method;
+    }
+
+    public FailoverPolicy(FailoverMethod method)
+    {
+        this(method, 0);
+    }
+
+    public FailoverPolicy(FailoverMethod method, int retries)
+    {
+        _methodsRetries = retries;
+
+        reset();
+
+        _methods[_currentMethod] = method;
+    }
+
+    private void reset()
+    {
+        _currentMethod = 0;
+        _currentRetry = 0;
+        _timing = false;
+
+    }
+
+    public boolean failoverAllowed()
+    {
+        boolean failoverAllowed;
+
+        if (_timing)
+        {
+            long now = System.currentTimeMillis();
+
+            if ((now - _lastMethodTime) >= DEFAULT_METHOD_TIMEOUT)
+            {
+                _logger.info("Failover method timeout");
+                _lastMethodTime = now;
+
+                if (!nextMethod())
+                {
+                    return false;
+                }
+
+
+            }
+            else if ((now - _lastFailTime) >= DEFAULT_FAILOVER_TIMEOUT)
+            {
+                _logger.info("Failover timeout");
+                return false;
+            }
+            else
+            {
+                _lastMethodTime = now;
+            }
+        }
+        else
+        {
+            _timing = true;
+            _lastMethodTime = System.currentTimeMillis();
+            _lastFailTime = _lastMethodTime;
+        }
+
+
+        if (_methods[_currentMethod].failoverAllowed())
+        {
+            failoverAllowed = true;
+        }
+        else
+        {
+            if (_currentMethod < (_methods.length - 1))
+            {
+                nextMethod();
+                _logger.info("Changing method to " + _methods[_currentMethod].methodName());
+                return failoverAllowed();
+            }
+            else
+            {
+                return cycleMethods();
+            }
+        }
+
+        return failoverAllowed;
+    }
+
+    private boolean nextMethod()
+    {
+        if (_currentMethod < (_methods.length - 1))
+        {
+            _currentMethod++;
+            _methods[_currentMethod].reset();
+            return true;
+        }
+        else
+        {
+            return cycleMethods();
+        }
+    }
+
+    private boolean cycleMethods()
+    {
+        if (_currentRetry < _methodsRetries)
+        {
+            _currentRetry++;
+
+            _currentMethod = 0;
+
+            _logger.info("Retrying methods starting with " + _methods[_currentMethod].methodName());
+            _methods[_currentMethod].reset();
+            return failoverAllowed();
+        }
+        else
+        {
+            _logger.debug("All failover methods exhausted");
+            return false;
+        }
+    }
+
+    /**
+     * Notification that connection was successful.
+     */
+    public void attainedConnection()
+    {
+        _currentRetry = 0;
+
+        _methods[_currentMethod].attainedConnection();
+
+        _timing = false;
+    }
+
+    public BrokerDetails getCurrentBrokerDetails()
+    {
+        return _methods[_currentMethod].getCurrentBrokerDetails();
+    }
+
+    public BrokerDetails getNextBrokerDetails()
+    {
+        return _methods[_currentMethod].getNextBrokerDetails();
+    }
+
+    public void setBroker(BrokerDetails broker)
+    {
+        _methods[_currentMethod].setBroker(broker);
+    }
+
+    public void addMethod(FailoverMethod method)
+    {
+        int len = _methods.length + 1;
+        FailoverMethod[] newMethods = new FailoverMethod[len];
+        System.arraycopy(_methods, 0, newMethods, 0, _methods.length);
+        int index = len - 1;
+        newMethods[index] = method;
+        _methods = newMethods;
+    }
+
+    public void setMethodRetries(int retries)
+    {
+        _methodsRetries = retries;
+    }
+
+    public FailoverMethod getCurrentMethod()
+    {
+        if (_currentMethod >= 0 && _currentMethod < (_methods.length - 1))
+        {
+            return _methods[_currentMethod];
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append("Failover Policy:\n");
+
+        if (failoverAllowed())
+        {
+            sb.append("Failover allowed\n");
+        }
+        else
+        {
+            sb.append("Failover not allowed\n");
+        }
+
+        sb.append("Failover policy methods\n");
+        for (int i = 0; i < _methods.length; i++)
+        {
+
+            if (i == _currentMethod)
+            {
+                sb.append(">");
+            }
+            sb.append(_methods[i].toString());
+        }
+
+        return sb.toString();
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/FailoverPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/MessageConsumer.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/MessageConsumer.java?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/MessageConsumer.java (added)
+++ incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/MessageConsumer.java Tue Sep 19 15:06:50 2006
@@ -0,0 +1,24 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.qpid.jms;
+
+/** 
+ */
+public interface MessageConsumer extends javax.jms.MessageConsumer
+{
+}

Propchange: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/MessageConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/MessageProducer.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/MessageProducer.java?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/MessageProducer.java (added)
+++ incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/MessageProducer.java Tue Sep 19 15:06:50 2006
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.qpid.jms;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import java.io.UnsupportedEncodingException;
+
+/**
+ */
+public interface MessageProducer extends javax.jms.MessageProducer
+{
+    /**
+     * Set the default MIME type for messages produced by this producer. This reduces the overhead of each message.
+     * @param mimeType
+     */
+    void setMimeType(String mimeType);
+
+    /**
+     * Set the default encoding for messages produced by this producer. This reduces the overhead of each message.
+     * @param encoding the encoding as understood by XXXX how do I specify this?? RG
+     * @throws UnsupportedEncodingException if the encoding is not understood
+     */
+    void setEncoding(String encoding) throws UnsupportedEncodingException;
+    
+    void send(Destination destination, Message message, int deliveryMode,
+                     int priority, long timeToLive, boolean immediate)
+            throws JMSException;
+
+    void send(Destination destination, Message message, int deliveryMode,
+                     int priority, long timeToLive, boolean mandatory, boolean immediate)
+            throws JMSException;
+}

Propchange: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/MessageProducer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/Session.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/Session.java?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/Session.java (added)
+++ incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/Session.java Tue Sep 19 15:06:50 2006
@@ -0,0 +1,70 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.qpid.jms;
+
+import javax.jms.*;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+
+
+public interface Session extends javax.jms.Session
+{
+    /**
+     * Indicates that no client acknowledgements are required. Broker assumes that once it has delivered
+     * a message packet successfully it is acknowledged.
+     */
+    static final int NO_ACKNOWLEDGE = 257;
+
+    /**
+     * Pre acknowledge means that an ack is sent per message but sent before user code has processed
+     * the message (i.e. before the onMessage() call or the receive() method has returned).
+     */
+    static final int PRE_ACKNOWLEDGE = 258;
+
+    MessageConsumer createConsumer(Destination destination,
+                                   int prefetch,
+                                   boolean noLocal,
+                                   boolean exclusive,
+                                   String selector) throws JMSException;
+
+    /**
+     * @return the prefetch value used by default for consumers created on this session.
+     */
+    int getDefaultPrefetch();
+
+    /**
+     * Create a producer
+     * @param destination
+     * @param mandatory the value of the mandatory flag used by default on the producer
+     * @param immediate the value of the immediate flag used by default on the producer
+     * @return
+     * @throws JMSException
+     */
+    MessageProducer createProducer(Destination destination, boolean mandatory, boolean immediate)
+            throws JMSException;
+
+    /**
+     * Create a producer
+     * @param destination     
+     * @param immediate the value of the immediate flag used by default on the producer
+     * @return
+     * @throws JMSException
+     */
+    MessageProducer createProducer(Destination destination, boolean immediate)
+            throws JMSException;
+}

Propchange: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/Session.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverMethod.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverMethod.java?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverMethod.java (added)
+++ incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverMethod.java Tue Sep 19 15:06:50 2006
@@ -0,0 +1,72 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.qpid.jms.failover;
+
+import org.apache.qpid.jms.BrokerDetails;
+
+public interface FailoverMethod
+{
+    public static final String ROUND_ROBIN = "roundrobin";
+    public static final String RANDOM = "random";
+    /**
+     * Reset the Failover to initial conditions
+     */
+    void reset();
+
+    /**
+     *  Check if failover is possible for this method
+     *
+     * @return true if failover is allowed
+     */
+    boolean failoverAllowed();
+
+    /**
+     * Notification to the Failover method that a connection has been attained.
+     */
+    void attainedConnection();
+
+    /**
+     * If there is no current BrokerDetails the null will be returned.
+     * @return The current BrokerDetail value to use
+     */
+    BrokerDetails getCurrentBrokerDetails();
+
+    /**
+     *  Move to the next BrokerDetails if one is available.
+     * @return the next BrokerDetail or null if there is none.
+     */
+    BrokerDetails getNextBrokerDetails();
+
+    /**
+     * Set the currently active broker to be the new value.
+     * @param broker The new BrokerDetail value
+     */
+    void setBroker(BrokerDetails broker);
+
+    /**
+     * Set the retries for this method
+     * @param maxRetries the maximum number of time to retry this Method
+     */
+    void setRetries(int maxRetries);
+
+    /**
+     * @return The name of this method for display purposes.
+     */
+    String methodName();
+}

Propchange: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverMethod.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java (added)
+++ incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java Tue Sep 19 15:06:50 2006
@@ -0,0 +1,256 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.qpid.jms.failover;
+
+import org.apache.qpid.jms.BrokerDetails;
+import org.apache.qpid.jms.ConnectionURL;
+import org.apache.log4j.Logger;
+
+public class FailoverRoundRobinServers implements FailoverMethod
+{
+    private static final Logger _logger = Logger.getLogger(FailoverRoundRobinServers.class);
+
+    /** The default number of times to cycle through all servers */
+    public static final int DEFAULT_CYCLE_RETRIES = 0;
+    /** The default number of times to retry each server */
+    public static final int DEFAULT_SERVER_RETRIES = 0;
+
+    /**
+      * The index into the hostDetails array of the broker to which we are connected
+      */
+    private int _currentBrokerIndex = -1;
+
+    /**
+     * The number of times to retry connecting for each server
+     */
+    private int _serverRetries;
+
+    /**
+     * The current number of retry attempts made
+     */
+    private int _currentServerRetry;
+
+    /**
+     *  The number of times to cycle through the servers
+     */
+    private int _cycleRetries;
+
+    /**
+     * The current number of cycles performed.
+     */
+    private int _currentCycleRetries;
+
+    /**
+     * Array of BrokerDetail used to make connections.
+     */
+    private ConnectionURL _connectionDetails;
+
+    public FailoverRoundRobinServers(ConnectionURL connectionDetails)
+    {
+        if (!(connectionDetails.getBrokerCount() > 0))
+        {
+            throw new IllegalArgumentException("At least one broker details must be specified.");
+        }
+
+        _connectionDetails = connectionDetails;
+
+        //There is no current broker at startup so set it to -1.
+        _currentBrokerIndex = -1;
+
+        String cycleRetries = _connectionDetails.getFailoverOption(ConnectionURL.OPTIONS_FAILOVER_CYCLE);
+
+        if (cycleRetries != null)
+        {
+            try
+            {
+                _cycleRetries = Integer.parseInt(cycleRetries);
+            }
+            catch (NumberFormatException nfe)
+            {
+                _cycleRetries = DEFAULT_CYCLE_RETRIES;
+            }
+        }
+
+        _currentCycleRetries = 0;
+
+        _serverRetries = 0;
+        _currentServerRetry = -1;
+    }
+
+    public void reset()
+    {
+        _currentBrokerIndex = 0;
+        _currentCycleRetries = 0;
+        _currentServerRetry = -1;
+    }
+
+    public boolean failoverAllowed()
+    {
+       return  ((_currentCycleRetries < _cycleRetries)
+                    || (_currentServerRetry < _serverRetries)
+                    || (_currentBrokerIndex < (_connectionDetails.getBrokerCount() - 1)));
+    }
+
+    public void attainedConnection()
+    {
+        _currentCycleRetries = 0;
+        _currentServerRetry = -1;
+    }
+
+    public BrokerDetails getCurrentBrokerDetails()
+    {
+        if (_currentBrokerIndex == -1)
+        {
+            return null;
+        }
+
+        return _connectionDetails.getBrokerDetails(_currentBrokerIndex);
+    }
+
+
+
+    public BrokerDetails getNextBrokerDetails()
+    {
+        if (_currentBrokerIndex == (_connectionDetails.getBrokerCount() - 1))
+        {
+            if (_currentServerRetry < _serverRetries)
+            {
+                if (_currentBrokerIndex == -1)
+                {
+                    _currentBrokerIndex = 0;
+
+                    setBroker(_connectionDetails.getBrokerDetails(_currentBrokerIndex ));
+
+                    _logger.info("First run using " + _connectionDetails.getBrokerDetails(_currentBrokerIndex));
+                }
+                else
+                {
+                    _logger.info("Retrying " + _connectionDetails.getBrokerDetails(_currentBrokerIndex));
+                }
+
+                _currentServerRetry++;
+            }
+            else
+            {
+                _currentCycleRetries++;
+                //failed to connect to first broker
+                _currentBrokerIndex = 0;
+
+                setBroker(_connectionDetails.getBrokerDetails(_currentBrokerIndex ));
+
+                // This is zero rather than -1 as we are already retrieving the details.
+                _currentServerRetry = 0;
+            }
+            //else - should force client to stop as max retries has been reached.
+        }
+        else
+        {
+            if (_currentServerRetry < _serverRetries)
+            {
+                if (_currentBrokerIndex == -1)
+                {
+                    _currentBrokerIndex = 0;
+
+                    setBroker(_connectionDetails.getBrokerDetails(_currentBrokerIndex ));
+
+                    _logger.info("First run using " + _connectionDetails.getBrokerDetails(_currentBrokerIndex));
+                }
+                else
+                {
+                    _logger.info("Retrying " + _connectionDetails.getBrokerDetails(_currentBrokerIndex));
+                }
+                _currentServerRetry++;
+            }
+            else
+            {
+                _currentBrokerIndex++;
+
+                 setBroker(_connectionDetails.getBrokerDetails(_currentBrokerIndex ));
+                // This is zero rather than -1 as we are already retrieving the details.
+                _currentServerRetry = 0;
+            }
+        }
+
+        return _connectionDetails.getBrokerDetails(_currentBrokerIndex);
+    }
+
+
+    public void setBroker(BrokerDetails broker)
+    {
+
+        _connectionDetails.addBrokerDetails(broker);
+
+        int index = _connectionDetails.getAllBrokerDetails().indexOf(broker);
+
+        String serverRetries = broker.getOption(BrokerDetails.OPTIONS_RETRY);
+
+        if (serverRetries != null)
+        {
+            try
+            {
+                _serverRetries = Integer.parseInt(serverRetries);
+            }
+            catch (NumberFormatException nfe)
+            {
+                _serverRetries = DEFAULT_SERVER_RETRIES;
+            }
+        }
+
+        _currentServerRetry = -1;
+        _currentBrokerIndex = index;
+    }
+
+    public void setRetries(int maxRetries)
+    {
+        _cycleRetries = maxRetries;
+    }
+
+    public String methodName()
+    {
+        return "Cycle Servers";
+    }
+
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append("Cycle Servers:\n");
+
+        sb.append("Cycle Retries:");
+        sb.append(_cycleRetries);
+        sb.append("\nCurrent Cycle:");
+        sb.append(_currentCycleRetries);
+        sb.append("\nServer Retries:");
+        sb.append(_serverRetries);
+        sb.append("\nCurrent Retry:");
+        sb.append(_currentServerRetry);
+        sb.append("\n");
+
+        for(int i=0; i < _connectionDetails.getBrokerCount() ; i++)
+        {
+            if (i == _currentBrokerIndex)
+            {
+                sb.append(">");
+            }
+            sb.append(_connectionDetails.getBrokerDetails(i));
+            sb.append("\n");
+        }
+
+        return sb.toString();
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverSingleServer.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverSingleServer.java?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverSingleServer.java (added)
+++ incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverSingleServer.java Tue Sep 19 15:06:50 2006
@@ -0,0 +1,144 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.qpid.jms.failover;
+
+import org.apache.qpid.jms.BrokerDetails;
+import org.apache.qpid.jms.ConnectionURL;
+
+public class FailoverSingleServer implements FailoverMethod
+{
+    /** The default number of times to rety a conection to this server */
+    public static final int DEFAULT_SERVER_RETRIES = 1;
+
+    /**
+     * The details of the Single Server
+     */
+    private BrokerDetails _brokerDetail;
+
+    /**
+     * The number of times to retry connecting to the sever
+     */
+    private int _retries;
+
+    /**
+     * The current number of attempts made to the server
+     */
+    private int _currentRetries;
+
+
+    public FailoverSingleServer(ConnectionURL connectionDetails)
+    {
+        if (connectionDetails.getBrokerCount() > 0)
+        {
+            setBroker(connectionDetails.getBrokerDetails(0));
+        }
+        else
+        {
+            throw new IllegalArgumentException("BrokerDetails details required for connection.");
+        }
+    }
+
+    public FailoverSingleServer(BrokerDetails brokerDetail)
+    {
+        setBroker(brokerDetail);
+    }
+
+    public void reset()
+    {
+        _currentRetries = -1;
+    }
+
+    public boolean failoverAllowed()
+    {
+        return _currentRetries < _retries;
+    }
+
+    public void attainedConnection()
+    {
+        reset();
+    }
+
+    public BrokerDetails getCurrentBrokerDetails()
+    {
+       return _brokerDetail;
+    }
+
+    public BrokerDetails getNextBrokerDetails()
+    {
+        if (_currentRetries == _retries)
+        {
+            return null;
+        }
+        else
+        {
+            if (_currentRetries < _retries)
+            {
+                _currentRetries ++;
+            }
+
+            return _brokerDetail;
+        }
+    }
+
+    public void setBroker(BrokerDetails broker)
+    {
+        if (broker == null)
+        {
+            throw new IllegalArgumentException("BrokerDetails details cannot be null");
+        }
+        _brokerDetail = broker;
+
+        String retries = broker.getOption(BrokerDetails.OPTIONS_RETRY);
+        if (retries != null)
+        {
+            try
+            {
+                _retries = Integer.parseInt(retries);
+            }
+            catch (NumberFormatException nfe)
+            {
+                _retries = DEFAULT_SERVER_RETRIES;
+            }
+        }
+        else
+        {
+            _retries = DEFAULT_SERVER_RETRIES;
+        }
+
+        reset();
+    }
+
+    public void setRetries(int retries)
+    {
+        _retries = retries;
+    }
+
+    public String methodName()
+    {
+        return "Single Server";
+    }
+
+    public String toString()
+    {
+        return "SingleServer:\n"+
+                "Max Retries:"+_retries+
+                "\nCurrent Retry:"+_currentRetries+
+                "\n"+_brokerDetail+"\n";
+    }
+
+}

Propchange: incubator/qpid/trunk/qpid/java/client/src/org/apache/qpid/jms/failover/FailoverSingleServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.bat
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.bat?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.bat (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.bat Tue Sep 19 15:06:50 2006
@@ -0,0 +1,59 @@
+@REM
+@REM Copyright (c) 2006 The Apache Software Foundation
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM    http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+
+@echo off
+REM Script to run the Qpid Java Broker
+
+set CMD="IBM-JNDI-Setup.bat"
+set JAVACLASS=org.apache.qpid.IBMPerfTest.JNDIBindConnectionFactory
+
+rem Guess QPID_HOME if not defined
+set CURRENT_DIR=%cd%
+if not "%QPID_HOME%" == "" goto gotHome
+set QPID_HOME=%CURRENT_DIR%
+echo %QPID_HOME%
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+cd ..
+set QPID_HOME=%cd%
+cd %CURRENT_DIR%
+:gotHome
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+echo The QPID_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+goto end
+:okHome
+
+if not "%JAVA_HOME%" == "" goto gotJavaHome
+echo The JAVA_HOME environment variable is not defined
+echo This environment variable is needed to run this program
+goto exit
+:gotJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+goto okJavaHome
+:noJavaHome
+echo The JAVA_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program.
+goto exit
+:okJavaHome
+
+set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
+
+echo on
+"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
+
+:end
+
+pause
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+qpid-run org.apache.qpid.IBMPerfTest.JNDIBindConnectionFactory
+qpid-run org.apache.qpid.IBMPerfTest.JNDIBindQueue amq/Queue   direct://amq.direct//IBMPerfQueue1
+qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq/Topic1  topic://amq.topic/IBMPerfTopic1/
+qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq/Topic2  topic://amq.topic/IBMPerfTopic2/
+qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq/Topic3  topic://amq.topic/IBMPerfTopic3/
+qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq/Topic4  topic://amq.topic/IBMPerfTopic4/
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-JNDI-Setup.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.bat
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.bat?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.bat (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.bat Tue Sep 19 15:06:50 2006
@@ -0,0 +1,59 @@
+@REM
+@REM Copyright (c) 2006 The Apache Software Foundation
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM    http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+
+@echo off
+REM Script to run the Qpid Java Broker
+
+set CMD="IBM-Publisher.bat"
+set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq/ConnectionFactory -d amq/Topic  -db 1 -dx 4 -tc jms.r11.Publisher -nt 4 %*
+
+rem Guess QPID_HOME if not defined
+set CURRENT_DIR=%cd%
+if not "%QPID_HOME%" == "" goto gotHome
+set QPID_HOME=%CURRENT_DIR%
+echo %QPID_HOME%
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+cd ..
+set QPID_HOME=%cd%
+cd %CURRENT_DIR%
+:gotHome
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+echo The QPID_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+goto end
+:okHome
+
+if not "%JAVA_HOME%" == "" goto gotJavaHome
+echo The JAVA_HOME environment variable is not defined
+echo This environment variable is needed to run this program
+goto exit
+:gotJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+goto okJavaHome
+:noJavaHome
+echo The JAVA_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program.
+goto exit
+:okJavaHome
+
+set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
+
+echo on
+"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
+
+:end
+
+pause
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+export MSGSIZE=100
+qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq/ConnectionFactory -d amq/Topic  -db 1 -dx 4 -tc jms.r11.Publisher -nt 4 $*
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Publisher.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.bat
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.bat?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.bat (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.bat Tue Sep 19 15:06:50 2006
@@ -0,0 +1,59 @@
+@REM
+@REM Copyright (c) 2006 The Apache Software Foundation
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM    http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+
+@echo off
+REM Script to run the Qpid Java Broker
+
+set CMD="IBM-PutGet.bat"
+set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq/ConnectionFactory  -d amq/Queue -tc jms.r11.PutGet -nt 6 %*
+
+rem Guess QPID_HOME if not defined
+set CURRENT_DIR=%cd%
+if not "%QPID_HOME%" == "" goto gotHome
+set QPID_HOME=%CURRENT_DIR%
+echo %QPID_HOME%
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+cd ..
+set QPID_HOME=%cd%
+cd %CURRENT_DIR%
+:gotHome
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+echo The QPID_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+goto end
+:okHome
+
+if not "%JAVA_HOME%" == "" goto gotJavaHome
+echo The JAVA_HOME environment variable is not defined
+echo This environment variable is needed to run this program
+goto exit
+:gotJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+goto okJavaHome
+:noJavaHome
+echo The JAVA_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program.
+goto exit
+:okJavaHome
+
+set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
+
+echo on
+"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
+
+:end
+
+pause
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq/ConnectionFactory  -d amq/Queue -tc jms.r11.PutGet -nt 6 $*
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-PutGet.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-README.txt
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-README.txt?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-README.txt (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-README.txt Tue Sep 19 15:06:50 2006
@@ -0,0 +1,16 @@
+The IBM JMS Performance Harness scripts have take the following additional parameters
+
+-tx : Enable transactions
+-pp : Enable persistent messaging
+
+The IBM JMS Performance Harness will need to be downloaded and the library added to client/test/lib.
+
+The Library can be found here:
+
+http://www.alphaworks.ibm.com/tech/perfharness
+
+Before running the required test the IBM JNDI Setup script should be run.
+
+This will create a filesystem based JNDI Context located at:
+
+/temp/IBMPerfTestsJNDI/
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.bat
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.bat?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.bat (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.bat Tue Sep 19 15:06:50 2006
@@ -0,0 +1,59 @@
+@REM
+@REM Copyright (c) 2006 The Apache Software Foundation
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM    http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+
+@echo off
+REM Script to run the Qpid Java Broker
+
+set CMD="IBM-Receiver.bat"
+set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq/ConnectionFactory  -d amq/Queue -tc jms.r11.Receiver %*
+
+rem Guess QPID_HOME if not defined
+set CURRENT_DIR=%cd%
+if not "%QPID_HOME%" == "" goto gotHome
+set QPID_HOME=%CURRENT_DIR%
+echo %QPID_HOME%
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+cd ..
+set QPID_HOME=%cd%
+cd %CURRENT_DIR%
+:gotHome
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+echo The QPID_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+goto end
+:okHome
+
+if not "%JAVA_HOME%" == "" goto gotJavaHome
+echo The JAVA_HOME environment variable is not defined
+echo This environment variable is needed to run this program
+goto exit
+:gotJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+goto okJavaHome
+:noJavaHome
+echo The JAVA_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program.
+goto exit
+:okJavaHome
+
+set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
+
+echo on
+"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
+
+:end
+
+pause
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+export MSGSIZE=100
+qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq/ConnectionFactory  -d amq/Queue -tc jms.r11.Receiver $*
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Receiver.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.bat
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.bat?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.bat (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.bat Tue Sep 19 15:06:50 2006
@@ -0,0 +1,59 @@
+@REM
+@REM Copyright (c) 2006 The Apache Software Foundation
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM    http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+
+@echo off
+REM Script to run the Qpid Java Broker
+
+set CMD="IBM-Sender.bat"
+set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq/ConnectionFactory  -d amq/Queue -tc jms.r11.Sender -ms $MSGSIZE -mg 1000000 %*
+
+rem Guess QPID_HOME if not defined
+set CURRENT_DIR=%cd%
+if not "%QPID_HOME%" == "" goto gotHome
+set QPID_HOME=%CURRENT_DIR%
+echo %QPID_HOME%
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+cd ..
+set QPID_HOME=%cd%
+cd %CURRENT_DIR%
+:gotHome
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+echo The QPID_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+goto end
+:okHome
+
+if not "%JAVA_HOME%" == "" goto gotJavaHome
+echo The JAVA_HOME environment variable is not defined
+echo This environment variable is needed to run this program
+goto exit
+:gotJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+goto okJavaHome
+:noJavaHome
+echo The JAVA_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program.
+goto exit
+:okJavaHome
+
+set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
+
+echo on
+"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
+
+:end
+
+pause
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+export MSGSIZE=100
+qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq/ConnectionFactory  -d amq/Queue -tc jms.r11.Sender -ms $MSGSIZE -mg 1000000  $*
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Sender.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.bat
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.bat?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.bat (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.bat Tue Sep 19 15:06:50 2006
@@ -0,0 +1,59 @@
+@REM
+@REM Copyright (c) 2006 The Apache Software Foundation
+@REM
+@REM Licensed under the Apache License, Version 2.0 (the "License");
+@REM you may not use this file except in compliance with the License.
+@REM You may obtain a copy of the License at
+@REM
+@REM    http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing, software
+@REM distributed under the License is distributed on an "AS IS" BASIS,
+@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@REM See the License for the specific language governing permissions and
+@REM limitations under the License.
+@REM
+
+@echo off
+REM Script to run the Qpid Java Broker
+
+set CMD="IBM-Subscriber.bat"
+set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq/ConnectionFactory -d amq/Topic  -db 1 -dx 4 -tc jms.r11.Subscriber -nt 4 %*
+
+rem Guess QPID_HOME if not defined
+set CURRENT_DIR=%cd%
+if not "%QPID_HOME%" == "" goto gotHome
+set QPID_HOME=%CURRENT_DIR%
+echo %QPID_HOME%
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+cd ..
+set QPID_HOME=%cd%
+cd %CURRENT_DIR%
+:gotHome
+if exist "%QPID_HOME%\bin\%CMD%" goto okHome
+echo The QPID_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+goto end
+:okHome
+
+if not "%JAVA_HOME%" == "" goto gotJavaHome
+echo The JAVA_HOME environment variable is not defined
+echo This environment variable is needed to run this program
+goto exit
+:gotJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+goto okJavaHome
+:noJavaHome
+echo The JAVA_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program.
+goto exit
+:okJavaHome
+
+set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
+
+echo on
+"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
+
+:end
+
+pause
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.bat
------------------------------------------------------------------------------
    svn:eol-style = CRLF

Added: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+export MSGSIZE=100
+qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq/ConnectionFactory -d amq/Topic  -db 1 -dx 4 -tc jms.r11.Subscriber -nt 4 $*
\ No newline at end of file

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/IBM-Subscriber.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/headersListener.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/headersListener.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/headersListener.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/headersListener.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.headers.Listener $*

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/headersListener.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/headersListener.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/headersListenerGroup.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/headersListenerGroup.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/headersListenerGroup.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/headersListenerGroup.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+for i; do
+    ./headersListener.sh -host 10.0.0.1 -port 5672 >$i.out 2>$i.err &
+    echo $! > $i.pid
+done;

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/headersListenerGroup.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/headersListenerGroup.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/headersPublisher.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/headersPublisher.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/headersPublisher.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/headersPublisher.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.headers.Publisher $*

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/headersPublisher.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/headersPublisher.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/run_many.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/run_many.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/run_many.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/run_many.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+# args: 
+# <number of processes to start>
+# <name of run>
+# <command ro run>
+
+for i in `seq 1 $1`; do
+    $3 >$2.$i.out 2>>$2.err &
+    echo $! > $2.$i.pid
+done;

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/run_many.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/run_many.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/serviceProvidingClient.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/serviceProvidingClient.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/serviceProvidingClient.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/serviceProvidingClient.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+PROFILE=$1
+shift
+# XXX -Xms1024m -XX:NewSize=300m
+. qpid-run org.apache.qpid.requestreply1.ServiceProvidingClient $1 guest guest /test serviceQ

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/serviceProvidingClient.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/serviceProvidingClient.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/serviceRequestingClient.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/serviceRequestingClient.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/serviceRequestingClient.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/serviceRequestingClient.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+PROFILE=$1
+shift
+thehosts=$1
+shift
+echo $thehosts
+# XXX -Xms1024m -XX:NewSize=300m
+. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.requestreply1.ServiceRequestingClient $thehosts guest guest /test serviceQ "$@"

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/serviceRequestingClient.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/serviceRequestingClient.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/testService.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/testService.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/testService.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/testService.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+. qpid-run org.apache.qpid.requestreply1.TestService 192.168.55.63 5672 foo x x

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/testService.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/testService.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/topicListener.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/topicListener.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/topicListener.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/topicListener.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+# XXX -Xmx512m -Xms512m -XX:NewSize=150m
+. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.topic.Listener $*

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/topicListener.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/topicListener.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/bin/topicPublisher.sh
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/bin/topicPublisher.sh?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/bin/topicPublisher.sh (added)
+++ incubator/qpid/trunk/qpid/java/client/test/bin/topicPublisher.sh Tue Sep 19 15:06:50 2006
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 The Apache Software Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# XXX -Xmx512m -Xms512m -XX:NewSize=150m
+. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.topic.Publisher $*

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/topicPublisher.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/java/client/test/bin/topicPublisher.sh
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/qpid/trunk/qpid/java/client/test/build-module.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/build-module.xml?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/build-module.xml (added)
+++ incubator/qpid/trunk/qpid/java/client/test/build-module.xml Tue Sep 19 15:06:50 2006
@@ -0,0 +1,32 @@
+<!--
+ -
+ - Copyright (c) 2006 The Apache Software Foundation
+ -
+ - Licensed under the Apache License, Version 2.0 (the "License");
+ - you may not use this file except in compliance with the License.
+ - You may obtain a copy of the License at
+ -
+ -    http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -
+ -->
+<project name="Client Tests" default="build">
+  <property name="module.depends" value="client broker broker/test common"/>
+  <property name="module.dist" value="true"/>
+
+  <import file="../../module.xml"/>
+
+  <target name="test" depends="build">
+    <junit fork="yes" showoutput="true" haltonfailure="yes">
+      <test name="org.apache.qpid.client.AllClientUnitTests"/>
+      <formatter type="plain"/>
+      <classpath refid="module.class.path"/>
+    </junit>
+  </target>
+
+</project>

Propchange: incubator/qpid/trunk/qpid/java/client/test/build-module.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/test/etc/ApacheDS.properties
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/etc/ApacheDS.properties?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/etc/ApacheDS.properties (added)
+++ incubator/qpid/trunk/qpid/java/client/test/etc/ApacheDS.properties Tue Sep 19 15:06:50 2006
@@ -0,0 +1,6 @@
+# Standard JNDI properties
+java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
+java.naming.provider.url=ldap://localhost:389/ou=system
+java.naming.security.authentication=simple
+java.naming.security.principal=uid=admin,ou=system
+java.naming.security.credentials=secret

Propchange: incubator/qpid/trunk/qpid/java/client/test/etc/ApacheDS.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/test/example_ build.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/example_%20build.xml?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/example_ build.xml (added)
+++ incubator/qpid/trunk/qpid/java/client/test/example_ build.xml Tue Sep 19 15:06:50 2006
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<!--
+ -
+ - Copyright (c) 2006 The Apache Software Foundation
+ -
+ - Licensed under the Apache License, Version 2.0 (the "License");
+ - you may not use this file except in compliance with the License.
+ - You may obtain a copy of the License at
+ -
+ -    http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -
+ -->
+
+<!-- example Blaze Component Java build file -->
+
+<project name="example-client" default="jar" basedir=".">
+    <property name="lib" value="${basedir}/lib"/>
+    <property name="common.lib" value="${basedir}/../common/lib"/>
+    <property name="example.dir" value="${basedir}"/>
+    <property name="example.src" value="${example.dir}/src"/>
+    <property name="example.lib" value="${example.dir}/lib"/>
+    <property name="example.tests" value="${example.dir}/test"/>
+    <property name="example.classes" value="${example.dir}/classes"/>
+    <property name="dist" value="${basedir}/dist"/>
+    <property name="dam.dist" value="${basedir}/damPackage"/>
+
+    <!-- Setup details -->
+    <target name="init">
+        <tstamp>
+            <format property="release" pattern="-dMMMyy" locale="en" timezone="GMT"/>
+        </tstamp>
+        <mkdir dir="${example.classes}"/>
+    </target>
+
+    <path id="example.classpath">
+        <fileset dir="${common}/lib">
+            <include name="**/*.jar"/>
+        </fileset>
+        <pathelement path="${example.classes}"/>
+    </path>
+
+    <!-- Remove all built files -->
+    <target name="clean" depends="init">
+        <delete dir="${example.classes}"/>
+    </target>
+
+    <path id="example_amq.classpath">
+        <fileset dir="${basedir}/lib">
+            <include name="**/*.jar"/>
+        </fileset>
+        <fileset dir="${example.lib}">
+            <include name="**/*.jar"/>
+        </fileset>
+        <pathelement path="${example.classes}"/>
+
+    </path>
+
+    <!-- Compile Java -->
+    <target name="compile" depends="init">
+        <javac destdir="${example.classes}" debug="on">
+            <classpath refid="example_amq.classpath"/>
+            <src path="${example.src}"/>
+            <exclude name="**/Test*.java"/>
+        </javac>
+
+        <copy todir="${example.classes}">
+            <!-- copy any non java src files into the build tree, e.g. log4j.properties -->
+            <fileset dir="${example.src}">
+                <exclude name="**/*.java"/>
+                <exclude name="**/package.html"/>
+            </fileset>
+        </copy>
+    </target>
+
+    <!-- Compile and build jar archive -->
+    <target name="dist" depends="compile">
+        <mkdir dir="${dist}"/>
+        <jar basedir="${example.classes}" jarfile="${dist}/example_amq.jar"/>
+    </target>
+
+    <!-- Create release zip and tar -->
+    <target name="release" depends="dist" description="Create a release package">
+
+            <zip destfile="${dist}/example_client.zip">
+                <zipfileset prefix="lib" file="${dist}/example_amq.jar" />
+            </zip>
+
+            <tar destfile="${dist}/example_client.tar.gz" compression="gzip">
+                <tarfileset prefix="lib" file="${dist}/example_amq.jar" />
+            </tar>
+    </target>
+
+
+
+</project>

Propchange: incubator/qpid/trunk/qpid/java/client/test/example_ build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/qpid/trunk/qpid/java/client/test/lib/activemq/geronimo-j2ee-management_1.0_spec-1.0.jar
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/lib/activemq/geronimo-j2ee-management_1.0_spec-1.0.jar?view=auto&rev=447994
==============================================================================
Binary file - no diff available.

Propchange: incubator/qpid/trunk/qpid/java/client/test/lib/activemq/geronimo-j2ee-management_1.0_spec-1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/qpid/trunk/qpid/java/client/test/lib/jakarta-commons/commons-codec-1.3.jar
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/lib/jakarta-commons/commons-codec-1.3.jar?view=auto&rev=447994
==============================================================================
Binary file - no diff available.

Propchange: incubator/qpid/trunk/qpid/java/client/test/lib/jakarta-commons/commons-codec-1.3.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/qpid/trunk/qpid/java/client/test/lib/jboss/jboss-messaging-client.jar
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/lib/jboss/jboss-messaging-client.jar?view=auto&rev=447994
==============================================================================
Binary file - no diff available.

Propchange: incubator/qpid/trunk/qpid/java/client/test/lib/jboss/jboss-messaging-client.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/qpid/trunk/qpid/java/client/test/lib/jboss/jbossall-client.jar
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/lib/jboss/jbossall-client.jar?view=auto&rev=447994
==============================================================================
Binary file - no diff available.

Propchange: incubator/qpid/trunk/qpid/java/client/test/lib/jboss/jbossall-client.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/qpid/trunk/qpid/java/client/test/lib/jmscts/jmscts-0.5-b2.jar
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/lib/jmscts/jmscts-0.5-b2.jar?view=auto&rev=447994
==============================================================================
Binary file - no diff available.

Propchange: incubator/qpid/trunk/qpid/java/client/test/lib/jmscts/jmscts-0.5-b2.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/qpid/trunk/qpid/java/client/test/lib/spring-1.2.8/spring.jar
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/lib/spring-1.2.8/spring.jar?view=auto&rev=447994
==============================================================================
Binary file - no diff available.

Propchange: incubator/qpid/trunk/qpid/java/client/test/lib/spring-1.2.8/spring.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/qpid/trunk/qpid/java/client/test/src/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/test/src/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java?view=auto&rev=447994
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/test/src/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java (added)
+++ incubator/qpid/trunk/qpid/java/client/test/src/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java Tue Sep 19 15:06:50 2006
@@ -0,0 +1,130 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.qpid.IBMPerfTest;
+
+import org.apache.qpid.client.AMQConnectionFactory;
+import org.junit.Assert;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.jms.ConnectionFactory;
+import java.util.Hashtable;
+
+public class JNDIBindConnectionFactory
+{
+
+    public static final String CONNECTION_FACTORY_BINDING = "amq/ConnectionFactory";
+    public static final String PROVIDER_URL = "file:/temp/IBMPerfTestsJNDI";
+    public static final String FSCONTEXT_FACTORY = "com.sun.jndi.fscontext.RefFSContextFactory";
+
+    public static void main(String[] args)
+    {
+        String connectionFactoryBinding = CONNECTION_FACTORY_BINDING;
+        String provider = PROVIDER_URL;
+        String contextFactory = FSCONTEXT_FACTORY;
+
+        if (args.length > 0)
+        {
+            provider = args[0];
+
+            if (args.length > 1)
+            {
+                connectionFactoryBinding = args[1];
+
+                if (args.length > 2)
+                {
+                    contextFactory = args[2];
+                }
+            }
+            else
+            {
+                System.out.println("Using default File System Context Factory");
+                System.out.println("Using default Connection Factory Binding:" + connectionFactoryBinding);
+            }
+        }
+        else
+        {
+            System.out.println("Using default values: Usage:java JNDIBindConnectionFactory [<Provider URL> [<Connection Factory Binding>] [<JNDI Context Factory>]]");            
+        }
+        System.out.println("File System Context Factory\n" +
+                "Connection Factory Binding:" + connectionFactoryBinding + "\n" +
+                "JNDI Provider URL:" + provider);
+
+        new JNDIBindConnectionFactory(provider, connectionFactoryBinding, contextFactory);
+
+    }
+
+    public JNDIBindConnectionFactory(String provider, String binding, String contextFactory)
+    {
+        // Set up the environment for creating the initial context
+        Hashtable env = new Hashtable(11);
+        env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
+
+        env.put(Context.PROVIDER_URL, provider);
+
+        try
+        {
+            // Create the initial context
+            Context ctx = new InitialContext(env);
+
+            // Create the object to be bound
+            ConnectionFactory factory = null;
+
+            try
+            {
+                factory = new AMQConnectionFactory("amqp://guest:guest@clientid/testpath?brokerlist='tcp://localhost:5672'");
+
+
+                try
+                {
+                    Object obj = ctx.lookup(binding);
+
+                    if (obj != null)
+                    {
+                        System.out.println("Un-binding previous Connection Factory");
+                        ctx.unbind(binding);
+                    }
+                }
+                catch (NamingException e)
+                {
+
+                }
+
+                // Perform the bind
+                ctx.bind(binding, factory);
+                System.out.println("Bound Connection Factory:" + binding);
+
+                // Check that it is bound
+                Object obj = ctx.lookup(binding);
+                System.out.println("Connection URL:" + ((AMQConnectionFactory) obj).getConnectionURL());
+
+                System.out.println("JNDI FS Context:" + provider);
+            }
+            catch (Exception amqe)
+            {
+
+            }
+
+        }
+        catch (NamingException e)
+        {
+            System.out.println("Operation failed: " + e);
+        }
+    }
+}

Propchange: incubator/qpid/trunk/qpid/java/client/test/src/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message