J2EE 容器允许直接服务器套接字吗?

发布于 2024-09-30 04:12:19 字数 315 浏览 0 评论 0原文

我有一个问题,听起来可能很奇怪。
我很想知道 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

牵你手 2024-10-07 04:12:19

我有一个在 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.

贵在坚持 2024-10-07 04:12:19

严格来说,EJB 规范禁止这样做,就像管理您的禁止拥有自己的线程:

企业 Bean 不得尝试侦听套接字、接受套接字上的连接或使用套接字进行多播。

不允许这样做的可能原因是分布式应用程序和在应用程序服务器实例之间移动 EJB。打开原始套接字的“官方”解决方案是编写 JCA 连接器。

Strictly speaking, it is forbidden by the EJB specification, just as managing your own threads is forbidden:

An enterprise bean must not attempt to listen on a socket, accept connections on a socket, or use a socket for multicast.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文