2 Replies Latest reply on Dec 27, 2003 5:30 PM by Archimedes Trajano

    How to put InteractionSpec in JNDI

    Neil Bartlett Newbie

      The JCA spec indicates that you can optionally store the RA's implementation of InteractionSpec in the JNDI. Is there any way to do this in JBoss?

      Alternatively, what is the normal way for a bean to instantiate an InteractionSpec when using CCI?


        • 1. Re: How to put InteractionSpec in JNDI
          David Jencks Master

          The spec doesn't indicate a standard way for the InteractionSpecs to get bound... so you get to write one yourself. I would use an mbean.

          Eventually in jboss 3.1 I think this will be possible by writing an xmbean descriptor for the i.s. and including an additional mbean interceptor that binds it in jndi on "start". However for more immediate use you should probably just write an mbean that has the i.s. class and attribute values as attributes and creates, configures, and binds it into jndi in the startService lifecycle method (and unbinds it in stopService).

          • 2. Is there a new standard way of doing this?
            Archimedes Trajano Newbie

            I was wondering if there is a proper way of doing this now? I was hoping for something like a jboss-ra.xml file that would contain the mapping, which can also be overridden by the *-ds.xml file.

            The concept of doing

            public static void main(String[] args) throws NamingException {
             Properties properties = new Properties();
             InitialContext context = new InitialContext(properties);
             HelloWorldInteractionSpecImpl ispec =
             new HelloWorldInteractionSpecImpl();
             context.bind("jca/HelloWorldISpec", ispec);

            does not look really appealing.