ejb3 in action 学习笔记之二_MDB

 
Messaging and developing MDBs
1 Message-oriented middleware is software that enables asynchronous messages between system components. 消息中间件是能在各系统组件间传递异步消息的软件。
2.
 ■ The MDB class must directly (by using the implements keyword in the class declaration) or indirectly (through annotations or descriptors) implement a message listener interface.
■ The MDB class must be concrete. It cannot be either a final or an abstract class.
■ The MDB must be a POJO class and not a subclass of another MDB.
■ The MDB class must be declared public.
■ The bean class must have a no-argument constructor. If you don’t have any constructors in your Java class, the compiler will create a default constructor.The container uses this constructor to create a bean instance.
■ You cannot define a finalize method in the bean class. If any cleanup code is necessary, it should be defined in a method designated as PreDestroy.
■ You must implement the methods defined in the message listener interface.These methods must be public and cannot be static or final.
■ You must not throw the javax.rmi.RemoteException or any runtime exceptions.If a RuntimeException is thrown, the MDB instance is terminated.
3 Two popular messaging models are standardized in Java EE: point-to-point (PTP) messaging and publish-subscribe messaging.
Point-to-point
You can probably guess from the names of the messaging models how they function. In the PTP scheme, a single message travels from a single producer (point A) to a single consumer (point B). PTP message destinations are called queues.
Publish-subscribe (pub-sub)
Publish-subscribe messaging is much like posting to an Internet newsgroup. A single producer produces a message that is received by any number of consumers who happen to be connected to the destination at the time. the message destination in this model is called a topic
and a consumer is called a subscriber.
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值