Exemplo n.º 1
0
  // Notification that the web application is ready to process requests
  @Override
  public void contextInitialized(ServletContextEvent sce) {
    if (null != servletContext) {
      return;
    }
    System.setProperty("red5.deployment.type", "war");

    servletContext = sce.getServletContext();
    String prefix = servletContext.getRealPath("/");

    long time = System.currentTimeMillis();

    logger.info("RED5 Server (http://www.osflash.org/red5)");
    logger.info("WAR loader");
    logger.debug("Path: " + prefix);

    try {
      // instance the context loader
      contextLoader = createContextLoader();
      applicationContext =
          (ConfigurableWebApplicationContext)
              contextLoader.initWebApplicationContext(servletContext);
      logger.debug("Root context path: " + applicationContext.getServletContext().getContextPath());

      ConfigurableBeanFactory factory = applicationContext.getBeanFactory();

      // register default
      factory.registerSingleton("default.context", applicationContext);

      // get the main factory
      parentFactory = (DefaultListableBeanFactory) factory.getParentBeanFactory();

    } catch (Throwable t) {
      logger.error("", t);
    }

    long startupIn = System.currentTimeMillis() - time;
    logger.info("Startup done in: " + startupIn + " ms");
  }
 @Override
 protected void registerMockFlowBeans(ConfigurableBeanFactory flowBeanFactory) {
   flowBeanFactory.registerSingleton("hospitalManager", hospitalManager);
 }