⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 printbean.java

📁 java方面经典书原代码,是我收集到最好的代码.
💻 JAVA
字号:
package com.foshanshop.ejb3.impl;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

@MessageDriven(activationConfig =
{
  @ActivationConfigProperty(propertyName="destinationType",
    propertyValue="javax.jms.Queue"),
  @ActivationConfigProperty(propertyName="destination",
    propertyValue="queue/foshanshop")
})
public class PrintBean implements MessageListener {

    public void onMessage(Message msg) {
        try {
            TextMessage tmsg = (TextMessage) msg;
            this.print(tmsg.getText());            
        } catch (Exception e){
            e.printStackTrace();
        }
    }
    
    private void print(String content){
        System.out.println(content);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -