[jboss-user] [Microcontainer] - Hashtable Bean in microcontainer XML configuration

jmesnil do-not-reply at jboss.com
Fri Apr 24 07:09:42 EDT 2009


Hi, 

I've several POJOs deployed from the microcontainer which requires a Hashtable in their constructor (JNDI properties fwiw).
I looked in the doc but I've not found a way to declare a Bean which is a Hashtable with all the required properties.
So I use a map in all the POJO's constructor:


  |        <bean name="SourceDestinationFactory" class="org.jboss.messaging.jms.bridge.impl.JNDIDestinationFactory">
  |            <constructor>
  |                <parameter>
  |                     <map class="java.util.Hashtable" keyClass="java.lang.String" valueClass="java.lang.String">
  |                           <entry>
  |                               <key>java.naming.factory.initial</key>
  |                               <value>org.jnp.interfaces.NamingContextFactory</value>
  |                           </entry>
  |                           <entry>
  |                               <key>java.naming.provider.url</key>
  |                               <value>jnp://localhost:1099</value>
  |                           </entry>
  |                           <entry>
  |                               <key>java.naming.factory.url.pkgs</key>
  |                               <value>org.jboss.naming:org.jnp.interfaces"</value>
  |                           </entry>
  |                       </map>
  |                </parameter>
  |                <parameter>/queue/source</parameter>
  |            </constructor>  
  |        </bean>
  | 

What I'd like is to define a "JNDI" bean and inject it directly in my POJOs instead:

  |        <bean name="SourceDestinationFactory" class="org.jboss.messaging.jms.bridge.impl.JNDIDestinationFactory">
  |            <constructor>
  |                <parameter>
  |                     <inject bean="JNDI" />
  |                </parameter>
  |                <parameter>/queue/source</parameter>
  |            </constructor>  
  |        </bean>
  | 

where JNDI bean is a Hashtable where I filled in the JNDI properties

Is it possible to do that? Where can I find an example/doc about that?

thanks!


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4226592#4226592

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226592



More information about the jboss-user mailing list