/*
 * JBoss, the OpenSource EJB server
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.ejb3.test.jms;

import javax.annotation.Resource;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import org.jboss.annotation.ejb.RemoteBinding;
import org.jboss.logging.Logger;

/**
 * @author <a href="mailto:bdecoste@jboss.com">William DeCoste</a>
 * @version $Revision: 1.1.2.2 $
 */
@Stateless
@Remote(QueueStateless.class)
@RemoteBinding(jndiBinding = "QueueStateless")
public class QueueStatelessBean implements QueueStateless
{
   private static final Logger log = Logger.getLogger(QueueStatelessBean.class);
   
   @Resource javax.jms.QueueConnectionFactory queueFactory;
   @Resource javax.jms.Queue ejb3testQueue;
   
   public void send(String text) throws Exception
   {
      javax.jms.QueueConnection queueConnection;
      javax.jms.QueueSession queueSession;
      javax.jms.QueueSender queueSender;
      javax.jms.TextMessage message;

      queueConnection = queueFactory.createQueueConnection();
      queueSession = queueConnection.createQueueSession(true,0);
      queueSender = queueSession.createSender(ejb3testQueue);
      message = queueSession.createTextMessage(text);
   }
}

