Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » 科技英语  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 这段什么意思,前后矛盾啊
liang





发贴: 19
于 2005-08-29 23:29 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
To indicate a system-level problem, such as the inability to connect to a database, a business method should throw the javax.ejb.EJBException. When a business method throws an EJBException, the container wraps it in a RemoteException, which is caught by the client. The container will not wrap application exceptions such as BookException. Because EJBException is a subclass of RuntimeException, you do not need to include it in the throws clause of the business method.

这第一句跟最后一句矛盾不?晕了



作者 Re:这段什么意思,前后矛盾啊 [Re:liang]
ww1ww1





发贴: 202
于 2005-08-29 23:46 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我的翻译:
为了描述一个系统级的问题,例如不能连接数据库,一个业务方法应该抛出javax.ejb.EJBException。
当一个业务方法抛出一个EJBException,容器将其包装成为一个RemoteException,这个RemoteException将被客户端捕抓到。
容器不会将其包装成为应用类型的异常,例如BookException(这个是自定义的Exception)。
因为 EJBException 是RemoteException的子类,你不需要将其定义(包含)在业务方法的抛出异常中。

理解:EJBException是RemoteException的子类,在EJB中,business method 抛出这个子类EJBException的父类RemoteException。



作者 Re:这段什么意思,前后矛盾啊 [Re:liang]
liang





发贴: 19
于 2005-08-30 00:00 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
因为 EJBException 是RuntimeException的子类,你不需要将其定义(包含)在业务方法的抛出异常语句中。

liang edited on 2005-08-30 00:08


flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923