- SlcAntConstants.EXECATTR_RUNTIME);
- if (runtimeStr != null) {
- try {
- ResourceLoader rl = new DefaultResourceLoader(getClass()
- .getClassLoader());
- try {
- runtimeRes = rl.getResource(runtimeStr);
- } catch (Exception e) {
- // silent
- }
- if (runtimeRes == null || !runtimeRes.exists()) {
- runtimeRes = confDir.createRelative("runtime/"
- + runtimeStr + ".xml");
- }
-
- if (runtimeRes.exists()) {
- GenericApplicationContext ctx = new GenericApplicationContext();
- XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(
- ctx);
- xmlReader.loadBeanDefinitions(runtimeRes);
-
- // Add property place holder
- PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
- ppc.setIgnoreUnresolvablePlaceholders(true);
- ctx.addBeanFactoryPostProcessor(ppc);
-
- ctx.refresh();
-
- runtimeContext = ctx;
- }
- } catch (Exception e) {
- throw new SlcException(
- "Could not initialize runtime context from "
- + runtimeStr, e);
- }
+ AntConstants.EXECATTR_RUNTIME);
+ if (runtimeStr == null)
+ runtimeStr = "default";
+
+ ResourceLoader rl = new DefaultResourceLoader(getClass()
+ .getClassLoader());
+ try {// tries absolute reference
+ runtimeRes = rl.getResource(runtimeStr);
+ } catch (Exception e) {
+ // silent
+ }
+ if (runtimeRes == null || !runtimeRes.exists()) {
+ if (confDir != null)
+ runtimeRes = confDir.createRelative("runtime/" + runtimeStr
+ + ".xml");