title: Spring as a JNDI provider?
body: <p>I would like to use Spring as a JNDI provider.  This means that I would like to configure a bean in my Spring context, which can be accessed via JNDI.  This would look something like this:</p>
  
  <pre><code>&lt;bean class="org.some.thing.here"&gt;
      &lt;property name="beans"&gt;
          &lt;map&gt;
              &lt;entry key="w/t/f"&gt;
                  &lt;bean class="some.thing.Else"&gt;
                       // rest ommitted
                  &lt;/bean&gt;
              &lt;/entry&gt;
          &lt;/map&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Then, in my application (lets say a Controller), I want to be able to grab this bean via:</p>
  
  <pre><code>Context ctx = new InitialContext();
  some.thing.Else bar = (some.thing.Else) ctx.lookup("w/t/f");
  </code></pre>
  
  <p>How could I go about doing this?  I've looked at XBean, however the project looks out of date (doesn't work with Spring 3.0.X I don't think), and there is very little documentation.</p>
  
  <p>Any other options?  I would also considering rolling my own jndi provider class if it isn't too hard to do.</p>
  
  <p><strong>EDIT:</strong> I should add that I don't have an option using JNDI, I have a library we have to use which requires certain components to be loaded via JNDI.  I would like to use Spring as the provider.</p>