2 Replies Latest reply on Jul 15, 2004 7:17 PM by drmack

    How to make an object available in the jndi context?

    drmack

      Hi there,
      Forgive my ignorance, but i have read articles on how to make jdbc datasource, ejb, jms queues available in the jndi context, but how do i make a generic object available in jndi in jboss? obviously. there isnt a static void main() for me to bind my object in jndi so how do i do it? basically. i want to make a quartz scheduler factory available on jndi so that more than one ejb can access the same factory, but i cant seem to find out how to do that, and please dont tell me that i have to create an mbean for that to happen, i think that would be an overkill, could someone pleassssssssseeeee enlighten me???



      Best Regards

        • 1. Re: How to make an object available in the jndi context?
          darranl

          You could write a servlet and bind the objetc to JNDI in the initialisation of the servlet.

          Or in each of your beans you could check if the item has been bound, if it hasn't been bound you could then create and bind it, you will just need to be careful if there is any chance that two could perform the initialisation at the same time.

          The MBean approach is possibly the best choice, don't forget that you should unbind the item from JNDI on undeployment of your application, the MBean also makes this easier if you receive the stop notification.

          • 2. Re: How to make an object available in the jndi context?
            drmack

            Cheers, mate. Thanks for your input. I think you have just confirmed certain conclusions that I had. Thanks again :D