如何从Java EE应用程序提供套接字? [英] How to serve a socket from a Java EE application?

查看:184
本文介绍了如何从Java EE应用程序提供套接字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们希望在Java EE应用服务器(JBoss 4.2.3)中提供一些客户端请求。我读到 Java EE规范不允许打开套接字企业bean 。但规范没有其他选择。

We would like to serve some client requests within our Java EE application server (JBoss 4.2.3). I read that the Java EE spec doesn't allow opening a socket from an enterprise bean. But the spec suggests no alternatives.


具体来说,企业bean不应该:

Specifically, enterprise beans should not:


  • 监听,接受连接或从网络套接字多播

所以问题是:我可以做些什么来从应用服务器中提供一些基于二进制 tcp的协议(而不是http)?

So the question is: What can I do to serve some binary tcp based protocols (not http) from within an application server?

此处有人建议实施资源适配器。这是你必须去的方式还是其他(更容易)的解决方案?

Here someone suggests to implement a resource adapter. Is this the way you have to go or are there other (easier) solutions?

推荐答案

现在我实施一个解决方法:

Right now I implement a workaround:

alt text http://yuml.me/7f82bd5c

我使用独立的java应用程序接受来自客户端的tcp调用,并将它们作为JNDI调用转发给应用程序服务器。

I use a standalone java application that accepts tcp calls from the client and forwards them as JNDI calls to the application server.

这篇关于如何从Java EE应用程序提供套接字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆