J2EE 容器允许直接服务器套接字吗?
我有一个问题,听起来可能很奇怪。
我很想知道 J2EE 容器是否允许部署的应用程序出于自己的目的打开直接服务器套接字(本质上绕过容器)。
我知道这样做很奇怪,但我问的原因是因为,我读到 javax.xml.endoint 无法在容器中启动,并且想知道这是否是原因。
更新:这篇文章的答案对我来说似乎是矛盾的。一个答案(andri)提到了 EJB 规范,它是被禁止的,而 Codemwnci 的另一个答案(由 Hippo 的评论支持)说它是在生产中使用的东西。我不确定从这篇文章中可以得出什么结论。任何人都可以帮忙清除这个吗?
谢谢。
I have a question, that may sound strange.
I am interested to know if J2EE containers allow to the applications deployed, to open direct server sockets (by-passing essentially the container) for their own purposes.
I know that it is strange to want to do that, but the reason I am asking is because, I have read that a javax.xml.endoint can not be started in a container, and was wondering if this is the reason.
UPDATE:The answers for this POST, seem contradicting to me. The one answer (by andri) refers to EJB specification that it is forbidden, yet the other answer by Codemwnci (backed up by a comment from Hippo) says that it is something used in production. I am not sure what to conclude from this posts. Can anyone help on clearing this?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有一个在 WebSphere 应用程序服务器 (WAS 7) 上运行的 Web 应用程序。在其中一个应用程序中,作为应用程序启动时运行的 servlet 的一部分,我创建了一个 ServerSocket。
这在大规模生产环境中运行并且已经工作了很多年。
I have a web application that runs on the WebSphere application server (WAS 7). In one of the applications, as part of a servlet that runs when the application starts, I create a ServerSocket.
This is running in a large scale production environment and has worked for many years.
严格来说,EJB 规范禁止这样做,就像管理您的禁止拥有自己的线程:
不允许这样做的可能原因是分布式应用程序和在应用程序服务器实例之间移动 EJB。打开原始套接字的“官方”解决方案是编写 JCA 连接器。
Strictly speaking, it is forbidden by the EJB specification, just as managing your own threads is forbidden:
The likely reason for disallowing this are distributed applications and moving EJBs between application server instances. The "official" solution for opening a raw socket is to write a JCA connector.