Skip to content
Snippets Groups Projects
Commit ef0a2965 authored by felmer's avatar felmer
Browse files

SP-245, BIS-150: Adding log message to Bootstrapper

SVN: 26421
parent 294ef0bb
No related branches found
No related tags found
No related merge requests found
......@@ -18,12 +18,16 @@ package ch.systemsx.cisd.common.spring;
import java.util.ArrayList;
import org.apache.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.support.AbstractRefreshableConfigApplicationContext;
import ch.systemsx.cisd.common.logging.LogCategory;
import ch.systemsx.cisd.common.logging.LogFactory;
/**
* Bootstrapper bean responsible for loading resources conditionally basing on property values.
* Normally properties are initialized by Spring after all beans are being instanced - this class
......@@ -33,6 +37,8 @@ import org.springframework.context.support.AbstractRefreshableConfigApplicationC
*/
public class Bootstrapper implements ApplicationContextAware, InitializingBean
{
private static final Logger operationLog = LogFactory.getLogger(LogCategory.OPERATION, Bootstrapper.class);
private AbstractRefreshableConfigApplicationContext context;
private String[] configLocations;
......@@ -83,8 +89,10 @@ public class Bootstrapper implements ApplicationContextAware, InitializingBean
}
}
operationLog.info("Refreshing application context with " + allConfigLocations);
context.setConfigLocations(allConfigLocations.toArray(new String[allConfigLocations.size()]));
context.refresh();
operationLog.info("Refreshed application context with " + allConfigLocations);
}
private static boolean evaluateCondition(String condition)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment