/** {@inheritDoc} */ @Override public synchronized void stop() { RepositoryImpl repository = (RepositoryImpl) getComponentInstanceOfType(RepositoryImpl.class); try { repository.setState(ManageableRepository.OFFLINE); } catch (RepositoryException e) { log.error("Can not switch repository to OFFLINE", e); } super.stop(); super.unregisterAllComponents(); }
private static void initContainer() { try { ExoContainer container_ = RootContainer.getInstance(); if (container_ != null) { container_.stop(); container_.dispose(); } String containerConf = ForumServiceTestCase.class.getResource("/conf/portal/configuration.xml").toString(); StandaloneContainer.addConfigurationURL(containerConf); container = StandaloneContainer.getInstance(); String loginConf = Thread.currentThread() .getContextClassLoader() .getResource("conf/portal/login.conf") .toString(); if (System.getProperty("java.security.auth.login.config") == null) System.setProperty("java.security.auth.login.config", loginConf); ExoContainerContext.setCurrentContainer(container); } catch (Exception e) { log.error("Failed to initialize standalone container: ", e); } }