Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main;
- import java.util.logging.Logger;
- import javax.ejb.ActivationConfigProperty;
- import javax.ejb.MessageDriven;
- import javax.jms.JMSException;
- import javax.jms.Message;
- import javax.jms.MessageListener;
- import javax.jms.TextMessage;
- /**
- * Message-Driven Bean implementation class for: Bolid
- */
- @MessageDriven(
- activationConfig = { @ActivationConfigProperty(
- propertyName = "destination", propertyValue = "java:/jms/queue/SRIQueue"), @ActivationConfigProperty(
- propertyName = "destinationType", propertyValue = "javax.jms.Queue")
- },
- mappedName = "java:/jms/queue/SRIQueue")
- public class Bolid implements MessageListener {
- private static Logger LOGGER = Logger.getLogger(Bolid.class.getName());
- /**
- * Default constructor.
- */
- public Bolid() {
- // TODO Auto-generated constructor stub
- LOGGER.info("Created");
- }
- /**
- * @see MessageListener#onMessage(Message)
- */
- public void onMessage(Message message) {
- // TODO Auto-generated method stub
- if(message instanceof TextMessage) {
- TextMessage textMessage = (TextMessage) message;
- try {
- LOGGER.info(textMessage.getText());
- } catch (JMSException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement