- public void init() {
- try {
- try {
- if (rootDir != null)
- System.setProperty(SlcAntConstants.ROOT_DIR_PROPERTY,
- rootDir.getURL().toString());
- if (confDir != null)
- System.setProperty(SlcAntConstants.CONF_DIR_PROPERTY,
- confDir.getURL().toString());
- } catch (IOException e) {
- throw new SlcAntException("Cannot interpret dir as URL.", e);
- }
- if (workDir != null)
- System.setProperty(SlcAntConstants.WORK_DIR_PROPERTY, workDir
- .toString());
-
- if (confDir != null && contextLocation == null) {
- contextLocation = confDir
- .createRelative("applicationContext.xml");
- }
-
- GenericApplicationContext ctx = new GenericApplicationContext(
- slcRuntime.getRuntimeContext());
- if (contextLocation != null && contextLocation.exists()) {
- XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(
- ctx);
- xmlReader.loadBeanDefinitions(contextLocation);
- }
- ctx.refresh();
- context = ctx;
- } catch (Exception e) {
- throw new SlcAntException(
- "Cannot create SLC app application context.", e);
- }
-
- }
-