This content has been marked as final.
Show 3 replies
-
1. Re: How can I programatically add
rareddy Nov 13, 2009 8:08 PM (in response to rareddy)oops, sorry for the typos in the subject.
How can I programatically add "config-property" to a Connection. -
2. Re: How can I programaticlly add
emuckenhuber Nov 14, 2009 7:01 AM (in response to rareddy)You can look at https://svn.jboss.org/repos/jbossas/branches/Branch_5_x/testsuite/src/main/org/jboss/test/profileservice/test/ConnectionFactoryUnitTestCase.java
It's basically this part:Map<String, String> xaProps = new HashMap<String, String>(); xaProps.put("SessionDefaultType", "javax.jms.Topic"); xaProps.put("SessionDefaultType.type", "java.lang.String"); xaProps.put("JmsProviderAdapterJNDI", "java:/DefaultJMSProvider"); xaProps.put("JmsProviderAdapterJNDI.type", "java.lang.String"); MetaValue metaValue = this.compositeValueMap(xaProps); propValues.put("config-property", metaValue);
Whereas the "${name}.type", represents the type field - as mentioned this mapping is a bit weird, but should work. The actual metaValue is created in the compositeValueMap method:public MapCompositeValueSupport compositeValueMap(Map<String,String> map) { MapCompositeValueSupport metaValue = new MapCompositeValueSupport(SimpleMetaType.STRING); for(String key : map.keySet()) { MetaValue value = SimpleValueSupport.wrap(map.get(key)); metaValue.put(key, value); } return metaValue; }
-
3. Re: How can I programaticlly add
rareddy Nov 14, 2009 4:36 PM (in response to rareddy)That worked. Thank you.