Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /jms4spread/src/java/org/tigris/jms4spread/

jms4spread
Discussion topic

Back to topic list

CVS update: /jms4spread/src/java/org/tigris/jms4spread/

Reply

Author dlr
Full name Daniel Rall
Date 2002-07-21 17:58:02 PDT
Message User: dlr
Date: 02/07/21 17:58:02

Added
 /jms4spread/src/java​/org/tigris/jms4spre​ad/
  JMSConnectionMetaData.java

Log
 Initial implementation. Needs work.

File Changes:

Directory: /jms4spread/src/java​/org/tigris/jms4spre​ad/
====================​====================​==============

File [added]: JMSConnectionMetaData.java
Url: http://jms4spread.ti​gris.org/source/brow​se/jms4spread/src/ja​va/org/tigris/jms4sp​read/JMSConnectionMe​taData.java?rev=1.1​&content-type=tex​t/x-cvsweb-markup
Added lines: 121
----------------
package org.tigris.jms4spread;

import java.util.Enumeration;

import javax.jms.ConnectionMetaData;
import javax.jms.JMSException;

/**
 * @author <a href="mailto:dlr@fin​emaltcoding.com">​Daniel Rall</a>
 * @since 0.1
 */
public class JMSConnectionMetaData
    implements ConnectionMetaData
{
    /**
     * Replaced by build process.
     */
    private static final String PROVIDER_VERSION = "@JMS4SPREAD_VERSION@";

    private static ConnectionMetaData singleton = new JMSConnectionMetaData();

    private JMSConnectionMetaData() {}

    /**
     * Returns the single instance of this class.
     */
    public static ConnectionMetaData getInstance()
    {
        return singleton;
    }

    public int getJMSMajorVersion()
    {
        // FIXME: Determine this using the JMS API.
        return 1;
    }

    public int getJMSMinorVersion()
    {
        // FIXME: Determine this using the JMS API.
        return 0;
    }

    public String getJMSProviderName()
    {
        return "JMS4Spread";
    }

    public String getJMSVersion()
    {
        // FIXME: Determine this using the JMS API.
        return "1.0.2b";
    }

    public Enumeration getJMSXPropertyNames()
    {
        return new JMSXEnumeration();
    }

    public int getProviderMajorVersion()
        throws JMSException
    {
        String version = getProviderVersion();
        int i = version.indexOf('.');
        if (i == 0)
        {
            return 0;
        }
        else
        {
            try
            {
                return Integer.parseInt(ver​sion.substring(0, i));
            }
            catch (Exception e)
            {
                throw new JMSException(getJMSP​roviderName() +
                                       " major version unknown");
            }
        }
    }

    public int getProviderMinorVersion()
        throws JMSException
    {
        // TODO
        throw new JMSException("getPro​viderMinorVersion() not yet implemented");
    }

    public String getProviderVersion()
        throws JMSException
    {
        if (PROVIDER_VERSION == null ||
            PROVIDER_VERSION.ind​exOf("JMS4SPREAD_VER​SION") != -1)
        {
            throw new JMSException(getJMSP​roviderName() + " version unknown");
        }
        return PROVIDER_VERSION;
    }

    /**
     * The list of JMSX properties.
     */
    private class JMSXEnumeration
        implements Enumeration
    {
        public JMSXEnumeration()
        {
        }

        public boolean hasMoreElements()
        {
            return false;
        }

        public Object nextElement()
        {
            return null;
        }
    }
}




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@jms4​spread.tigris.org
For additional commands, e-mail: cvs-help at jms4spread dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /jms4spread/src/java/org/tigris/jms4spread/ dlr Daniel Rall 2002-07-21 17:58:02 PDT
Messages per page: