=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/DefaultSchemaService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/DefaultSchemaService.java 2016-01-27 07:18:12 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/DefaultSchemaService.java 2016-03-07 14:09:22 +0000 @@ -37,10 +37,11 @@ import org.hisp.dhis.system.util.ReflectionUtils; import org.hisp.dhis.translation.TranslationService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.core.OrderComparator; import org.springframework.util.StringUtils; -import javax.annotation.PostConstruct; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; @@ -50,7 +51,8 @@ /** * @author Morten Olav Hansen */ -public class DefaultSchemaService implements SchemaService +public class DefaultSchemaService + implements ApplicationListener, SchemaService { private Map, Schema> classSchemaMap = new HashMap<>(); @@ -72,8 +74,7 @@ @Autowired private TranslationService translationService; - @PostConstruct - public void init() + public void onApplicationEvent( ContextRefreshedEvent contextRefreshedEvent ) { for ( SchemaDescriptor descriptor : descriptors ) { @@ -99,7 +100,7 @@ updateSelf( schema ); } } - + @Override public Schema getSchema( Class klass ) {