

package gov.va.med.cds.tools.cleanup.errorq;


import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;

import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;


public class QueueSender
{
    private JmsTemplate jmsTemplate;


    public void sendMessage( String strMessage )
    {
        final String s = strMessage;

        this.jmsTemplate.send( new MessageCreator()
        {
            public Message createMessage( Session session )
                throws JMSException
            {
                return session.createTextMessage( s );
            }
        } );
    }


    public void setJmsTemplate( JmsTemplate jmsTemplate )
    {
        this.jmsTemplate = jmsTemplate;
    }
}
