What is the difference between Message Driven Beans and Stateless Session beans? -
訊息驅動的Bean和無狀態的會話Bean有什麼區別?
In several ways, the dynamic creation and allocation of
message-driven bean instances mimics the behavior of stateless session
EJB instances, which exist only for the duration of a particular method
call.
在一些情況下,動態建立,分配訊息驅動的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, and
therefore 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 by
creating bean instances and passing JMS messages to those instances as
necessary.
只有容器可以直接與訊息驅動的Bean互動,建立bean的實力,傳遞JMS訊息給那些需要的執行個體。
The Container maintains the entire lifecycle of a message-driven
bean; instances cannot be created or removed as a result of client
requests or other API calls.
容器管理者訊息驅動的Bean的整個生命週期,執行個體不能被客戶的請求或者其它API的調用而建立或者移除。