@Test public void testStartupWithConfig() { dsm.startup(); }
@Override public void startup() { if (!testing) { String[] extraConfigs = configurationService .getPropertyAsType("service.manager.spring.configs", String[].class); if (extraConfigs != null) { if (springXmlConfigFiles == null) { springXmlConfigFiles = extraConfigs; } else { springXmlConfigFiles = (String[]) ArrayUtils.addAll(springXmlConfigFiles, extraConfigs); } } } long startTime = System.currentTimeMillis(); try { this.running = true; String[] allPaths = getSpringPaths(testing, springXmlConfigFiles, configurationService); applicationContext = new ClassPathXmlApplicationContext(allPaths, false); applicationContext.setAllowBeanDefinitionOverriding(true); applicationContext.setAllowCircularReferences(true); applicationContext.addBeanFactoryPostProcessor( new DSpaceBeanFactoryPostProcessor(this, configurationService, testing)); applicationContext.refresh(); if (developing) { log.warn("Service Manager is running in developmentMode. Services will be loaded on demand only"); } else { applicationContext.getBeanFactory().preInstantiateSingletons(); applicationContext.getBeanFactory().freezeConfiguration(); } registerActivators(); notifyServiceManagerReady(); } catch (IllegalStateException e) { shutdown(); String message = "Failed to startup the DSpace Service Manager: " + e.getMessage(); log.error(message, e); throw new RuntimeException(message, e); } long totalTime = System.currentTimeMillis() - startTime; log.info("Service Manager started up in {} ms with {} services...", totalTime, applicationContext.getBeanDefinitionCount()); }
DSpaceServiceManager implements ServiceManagerSystem { @Override public void startup() { if (!testing) { String[] extraConfigs = configurationService .getPropertyAsType("service.manager.spring.configs", String[].class); if (extraConfigs != null) { if (springXmlConfigFiles == null) { springXmlConfigFiles = extraConfigs; } else { springXmlConfigFiles = (String[]) ArrayUtils.addAll(springXmlConfigFiles, extraConfigs); } } } long startTime = System.currentTimeMillis(); try { this.running = true; String[] allPaths = getSpringPaths(testing, springXmlConfigFiles, configurationService); applicationContext = new ClassPathXmlApplicationContext(allPaths, false); applicationContext.setAllowBeanDefinitionOverriding(true); applicationContext.setAllowCircularReferences(true); applicationContext.addBeanFactoryPostProcessor( new DSpaceBeanFactoryPostProcessor(this, configurationService, testing)); applicationContext.refresh(); if (developing) { log.warn("Service Manager is running in developmentMode. Services will be loaded on demand only"); } else { applicationContext.getBeanFactory().preInstantiateSingletons(); applicationContext.getBeanFactory().freezeConfiguration(); } registerActivators(); notifyServiceManagerReady(); } catch (IllegalStateException e) { shutdown(); String message = "Failed to startup the DSpace Service Manager: " + e.getMessage(); log.error(message, e); throw new RuntimeException(message, e); } long totalTime = System.currentTimeMillis() - startTime; log.info("Service Manager started up in {} ms with {} services...", totalTime, applicationContext.getBeanDefinitionCount()); } }
DSpaceServiceManager implements ServiceManagerSystem { @Override public void startup() { if (!testing) { String[] extraConfigs = configurationService .getPropertyAsType("service.manager.spring.configs", String[].class); if (extraConfigs != null) { if (springXmlConfigFiles == null) { springXmlConfigFiles = extraConfigs; } else { springXmlConfigFiles = (String[]) ArrayUtils.addAll(springXmlConfigFiles, extraConfigs); } } } long startTime = System.currentTimeMillis(); try { this.running = true; String[] allPaths = getSpringPaths(testing, springXmlConfigFiles, configurationService); applicationContext = new ClassPathXmlApplicationContext(allPaths, false); applicationContext.setAllowBeanDefinitionOverriding(true); applicationContext.setAllowCircularReferences(true); applicationContext.addBeanFactoryPostProcessor( new DSpaceBeanFactoryPostProcessor(this, configurationService, testing)); applicationContext.refresh(); if (developing) { log.warn("Service Manager is running in developmentMode. Services will be loaded on demand only"); } else { applicationContext.getBeanFactory().preInstantiateSingletons(); applicationContext.getBeanFactory().freezeConfiguration(); } registerActivators(); notifyServiceManagerReady(); } catch (IllegalStateException e) { shutdown(); String message = "Failed to startup the DSpace Service Manager: " + e.getMessage(); log.error(message, e); throw new RuntimeException(message, e); } long totalTime = System.currentTimeMillis() - startTime; log.info("Service Manager started up in {} ms with {} services...", totalTime, applicationContext.getBeanDefinitionCount()); } DSpaceServiceManager(DSpaceConfigurationService configurationService); protected  DSpaceServiceManager(DSpaceConfigurationService configurationService,
            String... springXmlConfigFiles); }
DSpaceServiceManager implements ServiceManagerSystem { @Override public void startup() { if (!testing) { String[] extraConfigs = configurationService .getPropertyAsType("service.manager.spring.configs", String[].class); if (extraConfigs != null) { if (springXmlConfigFiles == null) { springXmlConfigFiles = extraConfigs; } else { springXmlConfigFiles = (String[]) ArrayUtils.addAll(springXmlConfigFiles, extraConfigs); } } } long startTime = System.currentTimeMillis(); try { this.running = true; String[] allPaths = getSpringPaths(testing, springXmlConfigFiles, configurationService); applicationContext = new ClassPathXmlApplicationContext(allPaths, false); applicationContext.setAllowBeanDefinitionOverriding(true); applicationContext.setAllowCircularReferences(true); applicationContext.addBeanFactoryPostProcessor( new DSpaceBeanFactoryPostProcessor(this, configurationService, testing)); applicationContext.refresh(); if (developing) { log.warn("Service Manager is running in developmentMode. Services will be loaded on demand only"); } else { applicationContext.getBeanFactory().preInstantiateSingletons(); applicationContext.getBeanFactory().freezeConfiguration(); } registerActivators(); notifyServiceManagerReady(); } catch (IllegalStateException e) { shutdown(); String message = "Failed to startup the DSpace Service Manager: " + e.getMessage(); log.error(message, e); throw new RuntimeException(message, e); } long totalTime = System.currentTimeMillis() - startTime; log.info("Service Manager started up in {} ms with {} services...", totalTime, applicationContext.getBeanDefinitionCount()); } DSpaceServiceManager(DSpaceConfigurationService configurationService); protected  DSpaceServiceManager(DSpaceConfigurationService configurationService,
            String... springXmlConfigFiles); boolean isRunning(); ListableBeanFactory getBeanFactory(); @Override ClassPathXmlApplicationContext getApplicationContext(); void notifyServiceManagerReady(); @Override void shutdown(); @Override void startup(); @Override void registerService(String name, Object service); @Override void registerServiceNoAutowire(String name, Object service); @SuppressWarnings("unchecked") @Override T registerServiceClass(String name, Class<T> type); @Override void unregisterService(String name); @SuppressWarnings("unchecked") @Override T getServiceByName(String name, Class<T> type); @SuppressWarnings("unchecked") @Override List<T> getServicesByType(Class<T> type); @Override List<String> getServicesNames(); @Override boolean isServiceExists(String name); @Override Map<String, Object> getServices(); @Override void pushConfig(Map<String, Object> properties); static String[] getSpringPaths(boolean testMode, String[] configPaths,
                                          DSpaceConfigurationService configurationService); }
DSpaceServiceManager implements ServiceManagerSystem { @Override public void startup() { if (!testing) { String[] extraConfigs = configurationService .getPropertyAsType("service.manager.spring.configs", String[].class); if (extraConfigs != null) { if (springXmlConfigFiles == null) { springXmlConfigFiles = extraConfigs; } else { springXmlConfigFiles = (String[]) ArrayUtils.addAll(springXmlConfigFiles, extraConfigs); } } } long startTime = System.currentTimeMillis(); try { this.running = true; String[] allPaths = getSpringPaths(testing, springXmlConfigFiles, configurationService); applicationContext = new ClassPathXmlApplicationContext(allPaths, false); applicationContext.setAllowBeanDefinitionOverriding(true); applicationContext.setAllowCircularReferences(true); applicationContext.addBeanFactoryPostProcessor( new DSpaceBeanFactoryPostProcessor(this, configurationService, testing)); applicationContext.refresh(); if (developing) { log.warn("Service Manager is running in developmentMode. Services will be loaded on demand only"); } else { applicationContext.getBeanFactory().preInstantiateSingletons(); applicationContext.getBeanFactory().freezeConfiguration(); } registerActivators(); notifyServiceManagerReady(); } catch (IllegalStateException e) { shutdown(); String message = "Failed to startup the DSpace Service Manager: " + e.getMessage(); log.error(message, e); throw new RuntimeException(message, e); } long totalTime = System.currentTimeMillis() - startTime; log.info("Service Manager started up in {} ms with {} services...", totalTime, applicationContext.getBeanDefinitionCount()); } DSpaceServiceManager(DSpaceConfigurationService configurationService); protected  DSpaceServiceManager(DSpaceConfigurationService configurationService,
            String... springXmlConfigFiles); boolean isRunning(); ListableBeanFactory getBeanFactory(); @Override ClassPathXmlApplicationContext getApplicationContext(); void notifyServiceManagerReady(); @Override void shutdown(); @Override void startup(); @Override void registerService(String name, Object service); @Override void registerServiceNoAutowire(String name, Object service); @SuppressWarnings("unchecked") @Override T registerServiceClass(String name, Class<T> type); @Override void unregisterService(String name); @SuppressWarnings("unchecked") @Override T getServiceByName(String name, Class<T> type); @SuppressWarnings("unchecked") @Override List<T> getServicesByType(Class<T> type); @Override List<String> getServicesNames(); @Override boolean isServiceExists(String name); @Override Map<String, Object> getServices(); @Override void pushConfig(Map<String, Object> properties); static String[] getSpringPaths(boolean testMode, String[] configPaths,
                                          DSpaceConfigurationService configurationService); static final String CONFIG_PATH; static final String CORE_RESOURCE_PATH; static final String ADDON_RESOURCE_PATH; }