[Management Development] - Re: How can I programaticlly add
by emuckenhuber
You can look at https://svn.jboss.org/repos/jbossas/branches/Branch_5_x/testsuite/src/mai...
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
16 years, 4 months
[Management Development] - How can I programaticlly add "config-property" to a Connecti
by rareddy
I am trying to create a connection factory using a program. I could add all the defined properties that are defined on "DeploymentTemplateInfo" object for that ConnectionFactory. I also wanted to add few "config-property" properties, but the resulting template does not seem to write these properties. Here is the sample code I am using
| public void addConnectionFactory(String deploymentName, Properties properties) throws AdminException{
| try {
|
| DeploymentTemplateInfo info = getView().getTemplate("NoTxConnectionFactoryTemplate");
|
| Map<String, ManagedProperty> propertyMap = info.getProperties();
| for (String key:propertyMap.keySet()) {
| String v = properties.getProperty(key);
| if (v != null) {
| ManagedProperty p = propertyMap.get(key);
| p.setValue(SimpleValueSupport.wrap(v));
| }
| }
|
| DefaultFieldsImpl fields = new DefaultFieldsImpl("my-property");
| fields.setDescription("My Custom Property");
| fields.setMetaType(SimpleMetaType.STRING);
| fields.setValue(SimpleValueSupport.wrap(properties.getProperty("my-property")));
| fields.setField(Fields.READ_ONLY, Boolean.FALSE);
| ManagedPropertyImpl mp = new ManagedPropertyImpl(fields);
|
| info.getProperties().put("config-property", mp);
| getView().applyTemplate(deploymentName, info);
|
| } catch(Exception e) {
| // handle exception
| }
| }
|
surely the above code does not work. Can somebody please tell me how I can insert a "config-property" such that when the "-ds.xml" file is written it is written in there.
Thank you.
Ramesh..
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265644#4265644
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265644
16 years, 4 months
[Management Development] - Re: Simple Example using ManagedObjects and ProfileService
by emuckenhuber
"rareddy" wrote : Thanks. I will take a look into this.
|
| "emuckenhuber" wrote : Hmm this might need some changes on our side, when creating the managed objects based on the meta data. I assume the difference between a normal ConnectionFactory deployment and a Teiid one are some specific properties in the deployment descriptor ?
| |
| Yes, exactly right. There will be some properties that are specific to Teiid. We should be able to filter those out based on it. This is very similar how the XA and non XA Connection Factories are being put into two separate piles but share the same template.
|
Ok, just give it a try. Feel free to ask if something is not clear or just post a link to a svn repo where i can take a look.
In case of overriding we might be able to use a ManagedObjectDefintion to override certain aspects of the created managed object. I would need to take a look again at that, but it would be easier once i know the differences between those definitions. Most probably we need to override the annotation attached to the ManagedObject, since the ManagementView is doing some processing later on.
https://svn.jboss.org/repos/jbossas/branches/Branch_5_x/messaging/src/mai...
We are actually working on a meta data descriptor for ManagedObjects, where you would be able to define the view in an xml file. Where i will try to take you requirements into account as well. Although this will most likely go in one of the future releases and not in AS5.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265602#4265602
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265602
16 years, 4 months