On Jun 10, 2008, at 8:50 PM, xianzheng wrote:


Hi all,
I'm new to J2EE and OpenEJB.
Just wondering, is there a way to embed an application server which is
written in JAVA in openejb? I guess, I'll have to write a container to wrap it around? If so, is there a guide to write such thing? As my understanding, JCA can only allows ejbs to connect to other servers rather than listening
connections?

I have a very old server application i wrote, which complies a non- standard
communication protocol. So i'm thinking whether i could embed it into
openejb to listening to "old" request and benefit openejb's other cool
features.

Hi Joe,

Depending on what you want to do exactly there are likely many ways to do it.

It is possible to plug in new protocols into a standard OpenEJB install and support custom clients. It's very easy to drop something in that listens on a socket and does "stuff". OpenEJB will find it on startup and hook it up as it does the other protocols. The "stuff" is where all the detail lies. Reflectively invoking proxies on the server side by looking them up from the local global JNDI (LocalInitialContextFactory) is easy, whereas sending invocations directly into the EJB Containers like the EJBd protocol does is harder. Can show you how to do that if it sounds like a route you might want to take. (you basically implement a specific interface then include a special properties file in your jar and drop it into openejb, pretty easy)

If you have your own "component container" it is possible to add new custom containers to a standard OpenEJB install. This is a bit more involved but not completely impossible. The advantage here is that any container can be invoked by any of the protocols plugged into OpenEJB.

Sounds like you want more the first option where you can add a new protocol. There are definitely options. Couple rounds of "mutual data exchange" (aka discussion) and I'm sure we can find a good game plan :)

-David



Reply via email to