[jboss-dev-forums] [Management Development] - Re: Simple Example using ManagedObjects and ProfileService

rareddy do-not-reply at jboss.com
Sun Nov 15 19:12:53 EST 2009


"emuckenhuber" wrote : 
  | 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.
  | 

So, my aim here is to some how extended the "DsDataSourceTemplate" template to add some custom properties specific to my "ConnectionFactory" and when I write the template write those properties as "config-properties" using "DsDataSourceTemplate" so that it generates "-ds.xml" file.

After few tries with configuration, I ended up like this configuration below


  |    <bean name="ConnectorTypeTemplate" class="org.teiid.templates.connector.ConnectorTypeTemplate">
  |       <property name="info"><inject bean="ConnectorTypeTemplateInfo"/></property>
  |       <property name="targetTemplate"><inject bean="NoTxConnectionFactoryTemplate"/></property>
  |    </bean>
  |    <bean name="ConnectorTypeTemplateInfo" class="org.teiid.templates.connector.ConnectorTypeTemplateInfo">
  |       <constructor factoryMethod="createTemplateInfo">
  |          <factory bean="DSDeploymentTemplateInfoFactory"/>
  |          <parameter class="java.lang.Class">org.teiid.templates.connector.ConnectorTypeTemplateInfo</parameter>
  |          <parameter class="java.lang.Class">org.jboss.resource.metadata.mcf.NoTxConnectionFactoryDeploymentMetaData</parameter>
  |          <parameter class="java.lang.String">ConnectorTypeTemplate</parameter>
  |          <parameter class="java.lang.String">A template for no-tx-connection-factory *-ds.xml deployments</parameter>
  |       </constructor>
  |       <property name="connectorXML">foo.xml</property>
  |    </bean> 
  | 

Where in "ConnectorTypeTemplateInfo" template, I passed "NoTxConnectionFactoryDeploymentMetaData" as the attachment class, which supplied basic ConnectionFactory properties, then in the "ConnectorTypeTemplateInfo" it self I added my own property definitions. Then on the "ConnectorTypeTemplate", I passed the original "DSDataSourceTemplate" to my template, then in "applyTemplate" call I added all the custom properties defined on my template into "DSDataSourceTemplate" as "config-properties" and called DSDataSourceTemplate's applyTemplate call, and that created my "-ds.xml" file the way I wanted. This is cool.


"emuckenhuber" wrote : 
  | 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.
  | 
This is exactly what I need, and what functionality we have in Teiid. Also, one another requirement we have is to dynamically add these templates based on the given XML file though admin functionality, which is important to support custom connectors.

Since these features are not currently available in AS 5, I will be looking into extending the above configuration to read the custom properties from a XML file. So, in this respect I have couple questions 

1) Ideally I would like this XML file be the "ra.xml" in my RAR file, is there way I can access that file, management object or otherwise?

2) In case, if (1) is not possible, if I supply copy of "ra.xml" file in "deploy" directory, how can I get access to it? like how can I get file handle to it?

I could embed XML in a property in the above configuration with in a CDATA section, but I would like to avoid that. 

Thank you again for your valuable help.

Ramesh..

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4265763#4265763

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4265763



More information about the jboss-dev-forums mailing list