简体   繁体   English

如何在Glassfish上为自定义协议编写jca

[英]How to write jca for custom protocol on Glassfish

I have a requirement to make glassfish server being able to receive and forward messages in NTCIP protocol (basically to understand NTCIP protocol). 我有一个要求,使glassfish服务器能够以NTCIP协议接收和转发消息(基本了解NTCIP协议)。 Provided, that glassfish is an http server, I have no idea where to start. 假设glassfish是http服务器,我不知道从哪里开始。 I did a lot of research on internet and could not find anything in particular. 我在互联网上进行了大量研究,但找不到任何特别的东西。 However I could find some generic answers roughly related to my problem, so by now I figured, that probably I need to write custom JCA connector for this (NTCIP) protocol. 但是,我可以找到一些与问题大致相关的通用答案,因此到现在为止,我已经意识到,可能需要为此(NTCIP)协议编写自定义JCA连接器。 I don't even know if this is the right thing to do, is it ? 我什至不知道这是正确的做法,对吗? Is it even possible to make glassfish talk in NTCIP protocol (no http) ? 甚至可以用NTCIP协议(不使用http)使玻璃鱼说话吗? If so, how should I go about writing my own JCA for that protocol, OR ANY custom protocol for that matter, which does not use HTTP? 如果是这样,我应该如何为该协议或不使用HTTP的任何自定义协议编写自己的JCA? Can I do it, using Java EE ? 我可以使用Java EE吗?

In advance, thank you for help. 预先,谢谢您的帮助。

Yes, you are completely on the right track. 是的,您完全正确。 I'm working on a project myself at the moment and we are building several JCA adaptors to connect out to other protocols and legacy systems. 目前,我自己正在一个项目上,我们正在构建几个JCA适配器以连接到其他协议和旧系统。 (disclaimer - There are a few cases where this is not the right choice, i don't know all your architecture details of course) (免责声明-在某些情况下,这不是正确的选择,我当然不知道您的所有架构细节)

JCA (spec'ed in JSR-315?) is for inbound or outbound connections and part of the Java EE standard APIs. JCA(在JSR-315中指定?)用于入站或出站连接,并且是Java EE标准API的一部分。 (deployment steps are specific to your application server) (部署步骤特定于您的应用程序服务器)

I'm not that familiar with NCITP what you need to do depends on if you need inbound our outbound communications. 我对NCITP不太熟悉,您需要做什么取决于您是否需要入站我们的出站通信。 Start with these example 从这些例子开始

From the JBoss Iron Jacamar sub project there are Hello World examples From the Java EE 'oficial' code samples Inbound Mail Server adaptor 在JBoss Iron Jacamar子项目中,有Hello World示例。在Java EE“官方”代码示例中,有入站邮件服务器适配器。

you may find that IDE support for JCA is limited. 您可能会发现IDE对JCA的支持是有限的。 I usually just use a generic Jar file project template. 我通常只使用通用的Jar文件项目模板。

There is some complexity to consider around connection pooling, XA transactions, security, etc. But that can be added later. 在连接池,XA事务,安全性等方面要考虑一些复杂性,但是稍后可以添加。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM