Announcement Announcement Module
No announcement yet.
Protocol Switching, Remote call to an EJB from presentation to Business using Spring Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Protocol Switching, Remote call to an EJB from presentation to Business using Spring


    I have been using Spring DI and IOC extensively in my earlier projects. As per a new project requirement, we have to setup our projects as follows :

    1. Business project (Java project)
    2. Common project ( Java project)
    3. Presentation project (Web project)

    Business and presentation communicates/uses the common layer. However, the business and presentation are to be deployed in different app servers, and the communication between business and presentation is not http based. Presentation invokes the business through iiop protocol. That means, the protocol switching happens, while calling business (Java project) from presentation (web project). Currently we are planning to use an internal organization framework, that performs this part. But as it uses EJB, I wanted to avoid using the same.

    That's why , I was thinking to look at spring framework capabilities. Using spring, can I perform this protocol switching from http to iiop ? and if I do so, is this the performant and optimal way of doing the same ?


    (In continuation to above) In order to setup different application layers, I did something as follows :

    In Business project, I encapsulated all business logic methods, and DAO methods in a facade object, and from any other layer I can go to the business logic or, data layer , using SPRING dependency Injection feature. Now I tried to expose facade object using RMI, and from the presentation layer, I accessed the rmi link, and got the facade object. From the same, I can drill down further to get the handle of business methods and data methods, from presentation.

    I am just wondering, can I create a simple EJB (using Spring) and expose the facade object ? From the Presentation layer, I want to call the EJB and get the handle of the facade object.

    I want to do it, because of the fact that,

    1. EJB protocol is more secure compared to RMI.
    2. As per organization std, I can't use Http and SOAP protocol, for communication between presentation and business layer.

    And also, I don't want to dig into the complexities of EJB, just want to create a simple stateless session bean, and may be using spring, I can hide the EJB complexities as much as possible. Then, from the presentation, I can call the EJB in iiop protocol, and get the hold of the facade object.

    Please help me configuring a simple EJB, (EJB 2.1 is ok for me) using Spring. From other references, I don't find any similar examples. Even the spring references seem to be incomplete (was checking capter-17/chapter-18 in Spring 2.5 reference). It will be appreciated if you can provide a small example showing all minimum configurations.

    Thanks and Regards,

    Jitendriya Dash
    Java/J2EE developer, Mumbai, India.

  • #2
    Good for you that you have some across an effective tool for your business presentation . Just keep on working out to learn more things.
    Last edited by kristine1985; Nov 24th, 2011, 10:45 PM.