Announcement Announcement Module
No announcement yet.
POJOs running in Application Server Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • POJOs running in Application Server

    I have a Web Layer implemented using Apache Tomcat. It uses beans defined using spring framework.

    The web layer beans uses stateless session beans defined in my Application Server. The ejb beans delegate their calls to the corresponding POJOs service objects.

    The POJO service objects need access to beans defined in applin context file.

    What is the best / common practice used by POJO service layer to access beans defined in spring context file?

    For web layer there are helper classes that load the beans, contextloaderlistener , etc

    For service layer, implemented as EJB plus POJO, how does POJO get handle to other beans?

    And second part of this question is , if any POJO object needs to get handle to jndi initialcontext , can they use JNDIObjectFactoryBean?, since they r running inside j2ee container.

    Can someone show me an e.g



  • #2
    Spring has support for stateless session beans which includes access to the application context. You may want to check the spring reference on the spring support for EJB


    • #3
      SLSB has access to context through Spring Abstract Classes. But in my case SLSB delegates calls to POJO and POJO needs to access beans.

      One way to do that would be to pass handle to context to all POJOs.
      Is there any other way?


      • #4
        You could wire the POJO and all its dependencies in Spring context file. The SLSB can get the POJO instance from the spring context it has access to. That way your POJOs need not have access to Spring context.