2013年9月19日 星期四

[筆記]oceejbd6隨手筆記-Chapter 3


說到這個
說想到這個
Client View of a Session Bean
  1. A client never directly accesses instances of the session bean's class.
  2. A client accesses a session object through the session bean's client view
  3. Independent of the implementation of the session bean and the container
The interface used by a remote client of a session bean
  1. implemented by the container as a remote business interface
  2. location-independent
It's possible to provide more than one client view for a session bean
  • But typically only one will be provided.
Remote Clients
  • The arguments and results of the methods of the remote business interface are passed by value
Local Clients
  1. May be another enterprise bean or a web component
  2. The arguments and results of the methods of the local business interface are passed by reference
筆記...中
說到這個
說想到這個
EJB的例外可以分成兩群:Application Exception和System Exception。
Application Exception
  1. 是由Bean Provider所定義,用以報告商業邏輯有關的問題
  2. 是java.lang.Exception及其子類別
  3. Unchecked Exception (java.lang.RuntimeException及其子類別),並有@ApplicationException的annotation
  4. 類別javax.ejb.CreateException及其子類別
  5. javax.ejb.RemoveException及其子類別
  6. javax.ejb.FinderException及其子類別
@ApplicationException是用來標示一個例外 (Exception) 為一個Application Exception,並宣告它應該在發生時,能被客戶端攔截到。

它有下列幾項選擇性的元素:
Element敘述
inherited指明子類別是否也應該做為Application Exception
預設:true
rollback指定在例外被丟出時,是否應該進行交易回滾 (transaction rollback)
預設:false

參考文件

沒有留言: