2 Replies Latest reply on Jan 29, 2003 10:29 PM by mcgee

    Easy (I think) JNDI question

    mcgee

      Hi all,

      I have a pretty simple JNDI requirement -- I have a few factory objects that I would like to be able to register with JBoss, so that I can lookup them up and use them in some Web apps. I'm sort of copying how javax.sql.DataSource works.

      The trouble is I can't see how in JBoss I register a plain ol' object with JNDI. I'm sure it's easy but I can't find what to do.

      Thanks,
      McGee

        • 1. Re: Easy (I think) JNDI question
          mikefinn

          If I am understanding the question, you'll have to bind the factory objects into the JNDI tree yourself, using Context.bind(). An MBean is a good place to do this. Check out the MailService MBean (in varia) for a good example.

          mike

          • 2. Re: Easy (I think) JNDI question
            mcgee

            I saw something in the manual that seemed to be doing the same thing. It was a simple MBean example that bound a name to a hashtable. If I have to do this I suppose that's okay. So there's not an existing MBean that can take a name & classname pair, with some initial args, and create an object & bind it for you. I'm surprised it's not there, which makes me think they have a good reason for it that I'm not currently seeing.

            Thanks,
            McGee