All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mockrunner.jms.ConfigurationManager Maven / Gradle / Ivy

There is a newer version: 2.0.7
Show newest version
package com.mockrunner.jms;

import java.io.Serializable;

/**
 * The ConfigurationManager is used
 * for global settings of the JMS test framework.
 */
public class ConfigurationManager implements Serializable
{
    private boolean doCloneOnSend;
    private boolean useMessageSelectors;
    
    public ConfigurationManager()
    {
        doCloneOnSend = false;
        useMessageSelectors = true;
    }
    
    /**
     * Get the clone on send flag, see {@link #setDoCloneOnSend}
     * for a description of this option.
     * @return the clone on send flag
     */
    public boolean getDoCloneOnSend()
    {
        return doCloneOnSend;
    }
    
    /**
     * Set if a message should be cloned before sending it.
     * Default is false, i.e. the message is not
     * cloned. This has the advantage that the sent message can
     * be examined afterwards (e.g. if it is acknowledged).
     * If you set this to true, the message will
     * be cloned, i.e. the sent message will not be altered
     * and you have to obtain the received message in order
     * to examine it. However, the true option
     * is closer to a real JMS server, where you can send
     * the same message multiple times and the messages do
     * not influence each other.
     * @param doCloneOnSend the clone on send flag,
     *        default is false
     */
    public void setDoCloneOnSend(boolean doCloneOnSend)
    {
        this.doCloneOnSend = doCloneOnSend;
    }
    
    /**
     * Get if message selectors should be used.
     * @return true use message selectors,
     *         false ignore message selectors
     */
    public boolean getUseMessageSelectors()
    {
        return useMessageSelectors;
    }

    /**
     * Set if message selectors should be used or simply
     * ignored while testing. Default is true,
     * i.e. message selectors are used. Message selector support
     * of Mockrunner is based on a modified version of the
     * selector parser of the open source JMS implementation
     * ActiveMQ. It is a bit experimental at the moment. If there
     * are problems with the parsing or if you don't need message
     * selectors at all, turn them off. Disabling selector parsing also
     * results in a better test performance.
     * @param useMessageSelectors true use message selectors,
     *                            false ignore message selectors
     */
    public void setUseMessageSelectors(boolean useMessageSelectors)
    {
        this.useMessageSelectors = useMessageSelectors;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy