I would create a factory (your lookup class maybe) which connects to the UDDI registry and tries to retrieve values from there. Also make it configurable on which default values to use. Then next I would use that factory bean to inject values into the other beans.
For injecting properties from one bean into another bean you might want to check the PropertyPathFactoryBean
Configuration might look something like this, I used the Spring 2.0 schema functionality.
Code:
<bean id="uddiRegistry" class="com.yourcompany.UddiLookupServiceBean">
<!-- Configure defaults here -->
<property name="url" value="tibjmsnaming://taurems01p:7243"/>
<property name="pkgs" value="com.tibco.tibjms.naming"/>
<property name="contextFactory" value="com.tibco.tibjms.naming.TibjmsInitialContextFactory"/>
<property name="connectionFactory" value=">SSLQueueConnectionFactory</"/>
<property name="jndiName" value="sdk.ssl.poc.request.v1"/>
</bean>
<util:property-path id="url" path="uddiRegistry.url"/>
<util:property-path id="pkgs" path="uddiRegistry.pkgs"/>
<util:property-path id="contextFactory" path="uddiRegistry.contextFactory"/>
<util:property-path id="connectionFactory" path="uddiRegistry.connectionFactory"/>
<util:property-path id="jndiName" path="uddiRegistry.jndiName"/>
And in your initial configuration you would then refere to the id's mentioned in the util
roperty-path id's. Which would make your configuration something like this.
Code:
<bean id="jndiTemplateESB" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial"><ref bean="contextFactory"/></prop>
<prop key="java.naming.provider.url"><ref bean="url"/></prop>
<prop key="java.naming.factory.url.pkgs"><ref bean="pkgs"/></prop>
<prop key="java.naming.security.credentials">password</prop>
<prop key="java.naming.security.principal">user</prop>
<prop key="com.tibco.tibjms.naming.ssl_trusted_certs">se rver_root.cert.pem</prop>
<prop key="com.tibco.tibjms.naming.security_protocol">ss l</prop>
</props>
</property>
</bean>
<bean id="connectionFactoryESB" class="jms.spring.TibcoConnectionFactoryObjectFact oryBean">
<property name="jndiTemplate" ref="jndiTemplateESB"/>
<property name="jndiName" ref="connectionFactory"/>
<property name="userName" value="username">
<property name="userPassword" value="password"/>
</bean>
<bean id="destinationHoldingService" class="org.springframework.jndi.JndiObjectFactoryB ean">
<property name="jndiTemplate" ref="jndiTemplateESB"/>
<property name="jndiName" ref="jndiName"/>
<property name="cache" value="true"/>
</bean>