[Design of JCA on JBoss] - Re: JBAS-1437 RARMetaDataRepository
by adrian@jboss.org
"adrian(a)jboss.org" wrote :
| It is then simply a case of parsing (using JAXB - or JBossXB with JAXB annotations)
| and extracting the metadata into deployment attachments.
|
The big problem is the embedded MBeans in the -ds.xml file.
Like Scott said about namespaces, both JAXB and especially JBossXB
(which has even better support) can parse different objects based on the namespace.
But in the current -ds.xml the mbean stuff is not in a different namespace
and the mbean stuff doesn't have a JAXB or JBossXB based parser.
It should be:
| <connection-factorties xmlns="urn:jboss-jca:5.0">
|
| <!-- Our metadata -->
| <connection-factory>...</connection-factory>
|
| <!-- Somebody else's metadata -->
| <mbean xmlns="urn:jboss-jmx:5.0">...</mbean>
|
| </connection-factories>
|
This has two solutions:
1) Junk the -ds.xml and move to a -cf.xml which either doesn't support
embedded mbeans or does it via a namespace
2) Include a "copy" of the mbean model in the jca namespace.
When I say "copy", this could just be some form of bridge/wrapper
that updates the real ServiceMetadata objects, it is only there is
to fool the xml parser machinery into thinking there is an
urn:jboss-jca:5.0:mbean element.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023702#4023702
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023702
17 years, 1 month
[Design of JCA on JBoss] - Re: JBAS-1437 RARMetaDataRepository
by adrian@jboss.org
"weston.price(a)jboss.com" wrote :
| 1) The element name mappings have to be hardcoded somewhere. Example:
|
| <min-pool-size/>
| <max-pool-size/>
| <connection-url/>
| <xa-datasource-property/>
|
| All of this stuff has to resolve to something in the MetaData, and then applied correctly to ServiceMetaData instances to construct and deploy the MBeans for a MCF.
Why don't you just write a holder that knows how to create a more structured
metadata object from the flat scheme.
e.g. in JAXB annotations (I'll use fields instead of accessors for brevity)
|
| public BaseConnectionFactoryDefinition implements PoolMetaData, etc...
| {
| @XmlElement("min-pool-size") public int minPoolSize;
| @XmlElement("max-pool-size") public int maxPoolSize;
|
| public PoolMetaData getPoolMetaData()
| {
| return this;
| }
| }
|
| @XmlRoot("local-tx-datasource")
| public LocalTxDataSource extendsBaseConnectionFactoryDefinition implements MCFMetaData
| {
| @XmlElement("connection-url") public String connectionURL;
|
| public LocalDataSourceMetaData getConnectionFactoryMetaData()
| {
| return this;
| }
|
| public List<ConnectionPropertyMetaData> getConnectionProperties()
| {
| // create connection property metadata
| }
| }
|
The idea being that PoolMetaData and MCFMetaData (or whatever you call them)
are what the real ds deployer uses when constructing the MBeans/POJOs.
It is then simply a case of parsing (using JAXB - or JBossXB with JAXB annotations)
and extracting the metadata into deployment attachments.
The other big advantage is that somebody can write their own deployer
that creates this metadata some other way and still reuse the JCA real deployer.
NOTE: This is OOP (inheritance) not AOP.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023695#4023695
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023695
17 years, 1 month