[jboss-dev-forums] [Management Development] - Re: How can I programaticlly add
emuckenhuber
do-not-reply at jboss.com
Sat Nov 14 07:01:54 EST 2009
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;
| }
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265669#4265669
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265669
More information about the jboss-dev-forums
mailing list