[jboss-dev-forums] [Design of POJO Server] - To merge or not to merge?

adrian@jboss.org do-not-reply at jboss.com
Tue Oct 10 13:11:53 EDT 2006


I've been thinking about this merging of metadata
between ejb-jar.xml and jboss.xml and I'm not sure we
actually want to do this?

The main reason is that doing so, loses the information
on where the metadata came from.

1) You cannot take the metadata and turn it back into the xml files.
2) You don't know where to direct the user about where to fix something

A simple example is jndi-name in jboss.xml which now has a
corresponding mapped-name in ejb-jar.xml for EJB3

Making these the same property would lose which file it came from.

Given that I want to extend jboss.xml so you can override
"everything" this doesn't look like a good solution.

A better solution would be to make it delegate,
like the following pseudo code.


  | class DelegateBeanMetaData
  | {
  |    String getJndiName()
  |    {
  |        String result = jbossXML.getJndiName();
  |        if (result == null)
  |           return ejbJarXML.getMappedName();
  |    }
  | }
  | 

In fact, with the org.jboss.metaData stuff
it would be trivial to implement this provided the metadata
is split up enough.

You just need two MetaDataContexts one for jboss.xml
and one for ejb-jar.xml

Then the query becomes:
JndiBinding binding = MetaData.getMetaData(JndiBinding.class);

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

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



More information about the jboss-dev-forums mailing list