Similar class in the ejb-tier to the ServletContext ?


EJB programming & troubleshooting: Similar class in the ejb-tier to the ServletContext ?

  1. Hi,
    I´m searching for an class in the ejb-tier that is similar to the ServletContext-class in the web-tier.
    I need an object which is accessible from all ejb´s in the container.

  2. Hi,
    You can use the setSessionContext() method for session beans and SetEntityContext() method for entity bean for querying the container. Basically you define the sessioncontext variable as class variable and set that variable in the setXXXContext() method. From there on you can start use the object to query the container.

    Pls let me know whether you have got clear idea, else i'll let you know mor precisely.

  3. You can probably just use JNDI or a JCache implementation.


    Cameron Purdy
    Tangosol, Inc.
    Coherence: Easily share live data across a cluster!