消息驱动的Bean和无状态的会话Bean有什么区别?
In several ways, the dynamic creation and allocation ofmessage-driven bean instances mimics the behavior of stateless sessionEJB instances, which exist only for the duration of a particular methodcall.
在一些情况下,动态的创建,分配消息驱动的Bean的实例与无状态的会话Bean很类似,它只存在于特定的方法调用期间。
However, message-driven beans are different from stateless session EJBs (and other types of EJBs) in several significant ways:
但是,消息驱动的Bean与无状态的会话Bean(包括其它类型的EJB)有一些显著的不同:
Message-driven beans process multiple JMS messages asynchronously,rather than processing a serialized sequence of method calls.
消息驱动的Bean处理多个JMS消息是异步的,而不是方法调用的顺序的。
Message-driven beans have no home or remote interface, andtherefore cannot be directly accessed by internal or external clients.
消息驱动的Bean没有home和远程接口,所以不能在内部或者外部的客户端直接使用。
Clients interact with message-driven beans only indirectly, by sending a message to a JMS Queue or Topic.
客户端与消息驱动的Bean交互,只能非直接的,通过发送一个消息给JMS队列或者主题。
Only the container directly interacts with a message-driven bean bycreating bean instances and passing JMS messages to those instances asnecessary.
只有容器可以直接与消息驱动的Bean交互,创建bean的实力,传递JMS消息给那些需要的实例。
The Container maintains the entire lifecycle of a message-drivenbean; instances cannot be created or removed as a result of clientrequests or other API calls.
容器管理者消息驱动的Bean的整个生命周期,实例不能被客户的请求或者其它API的调用而创建或者移除。