• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring injection problem

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
currently trying to set up a listener with the different types of server jndi configurations.
Not sure how to setup oracleAppServer and weblogicAppServer so that I can use them within appServers.

<bean id="jndiInitialiseListener" class="org.my.apps.utils.JndiInitialiseListener">

<property name="appServers">
<map>
<entry key="oracleAppServer">
<ref local="oracleAppServer"/>
</entry>
<entry key="weblogicAppServer" >
<ref local="weblogicAppServer"/>
</entry>
</map>
</property>

</bean>

<bean id="oracleAppServer" class="java.lang.Object">
<map>
<entry key="java.naming.factory.initial" value="com.evermind.server.ApplicationClientInitialContextFactory" />
<entry key="java.naming.provider.url" value="ormi://localhost/" />
<entry key="java.naming.security.principal" value="xx11" />
<entry key="java.naming.security.credentials" value="xx22" />
</map>
</bean>
<bean id="weblogicAppServer" class="java.lang.Object">
<map>
<entry key="java.naming.factory.initial" value="weblogic.jndi.WLInitialContextFactory" />
<entry key="java.naming.provider.url" value="t3://localhost/" />
<entry key="java.naming.security.principal" value="xx33" />
<entry key="java.naming.security.credentials" value="xx44" />
</map>
</bean>

Mat
 
Mat Anthony
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
is it possible to create a map of server names (i.e. oracleAppServer,weblogicAppServer etc).
Each of the names will ref a map containing the jndi configurations for that server.
Hence it would alow me to just pass a map of the server names to my JndiInitialiseListener class (i.e. via injection)

The example below means that I have to inject server names oracleAppServer and weblogicAppServer into my JndiInitialiseListener class;
hence it's not flexible.

<bean id="jndiInitialiseListener" class="org.my.apps.utils.JndiInitialiseListener">
<property name="oracleAppServer">
<map>
<entry key="java.naming.factory.initial" value="com.evermind.server.ApplicationClientInitialContextFactory" />
<entry key="java.naming.provider.url" value="ormi://localhost/" />
<entry key="java.naming.security.principal" value="user1" />
<entry key="java.naming.security.credentials" value="pswd2" />
</map>
</property>
<property name="weblogicAppServer">
<map>
<entry key="java.naming.factory.initial" value="weblogic.jndi.WLInitialContextFactory" />
<entry key="java.naming.provider.url" value="t3://localhost/" />
<entry key="java.naming.security.principal" value="user2" />
<entry key="java.naming.security.credentials" value="pswd2" />
</map>
</property>
</bean>

Mat
reply
    Bookmark Topic Watch Topic
  • New Topic