• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB Gateway

 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use a vendor framework that has a single "gateway" EJB. All requests come into a single execute() method that gets a service id from the parameters, looks up a POJO service instance and calls the service execute(). The service has code (generated from a Rose model) that gets the method name from the parameter and invokes the method. There is a (generated) Business Delegate that sets up the parameters so this is transparent to the client.

* Is this kind of gateway common? It seems like a neat way to free the POJO services from EJB dependencies. We never code or deploy a new EJB.

* Are there frameworks that do the same kind of thing?
 
author
Posts: 304
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have certainly seen this pattern on a number of occasions. I don't know how many frameworks have adopted it but it can work for certain kinds of applications, particularly those that are closed. The client API is not very elegant, but if you have a client-side layer that can do all the marshalling then it is a little less unsightly, I guess.

Note that one of the benefits of EJB 3.0 is that the components can be developed as POJOs, so you could use session beans for your POJO services and get the benefits of resource injection, interceptors and so on.

-Mike
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJB 3 seems to have a lot of great stuff like that. I don't know if we'll ever get there in our shop, but I need to study up on it for sure.

I worked with another single SSB gateway that was all XML in and out. It was very easy to specify new request/response pairs against existing POJO services without a code release, and also simple to add new POJOs in releases.

BTW: The vendor framework I'm using is pretty sophisticated. The Business Delegate is code-generated and is very easy for clients to use. It supports EJB, raw sockets, XML/HTTP and another weird protocol out of the box. The server has a gateway for each protocol. We made our own gateways for JMS and WebServices. The vendor sometimes over-engineers to a frightening degree, but this bit is neat.
 
reply
    Bookmark Topic Watch Topic
  • New Topic