[jboss-user] [JBoss/Spring Integration] - Re: Deploying multiple XML files as a single SpringApplicati

acricken do-not-reply at jboss.com
Wed Dec 19 15:27:03 EST 2007


It's often useful to break beans out into separate XML files for legibility, as well as making it easier to swap certain portions for different configurations or environments.  While this may speak to an over-reliance on Spring for DI, I still find it useful.  When doing this, it's desirable to avoid the individual XML files being aware of each other if possible.

I find it's a pretty common use case for Spring, eg (from their docs):
 ApplicationContext context = new ClassPathXmlApplicationContext(
  |         new String[] {"applicationContext.xml", "applicationContext-part2.xml"});

In my case, I'm working with an app based heavily on Apache Camel.  I'd like to use the same Apache Camel route definitions but with varying component configurations.  So, use routes-spring.xml, which refers to beans that could be in components-dev-spring.xml or in components-prod-spring.xml depending on the environment.  Currently, if I want to deploy this app to JBoss, I have to resort to hardcoding an import or using JNDI to get at beans.  Am I missing something obvious?

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

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



More information about the jboss-user mailing list