Search code examples
javaglassfishprotocolsjca

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). Provided, that glassfish is an http server, I have no idea where to start. 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. 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) ? 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? Can I do it, using Java EE ?

In advance, thank you for help.


Solution

  • 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. (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. (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. 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

    you may find that IDE support for JCA is limited. I usually just use a generic Jar file project template.

    There is some complexity to consider around connection pooling, XA transactions, security, etc. But that can be added later.