Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.ConfigurableBeanFactory.containsSingleton()


    } catch (IOException e) {
      log.error("Error looking for config file", e);
    }
    // add the context to the parent, this will be red5.xml
    ConfigurableBeanFactory factory = ((ConfigurableApplicationContext) applicationContext).getBeanFactory();
    if (factory.containsSingleton(name)) {
      log.warn("Singleton {} already exists, try unload first", name);
      return;
    }
    // if parent context was not set then lookup red5.common
    if (parentContext == null) {
View Full Code Here


      return;
    }
    // if parent context was not set then lookup red5.common
    if (parentContext == null) {
      log.debug("Lookup common - bean:{} local:{} singleton:{}",
          new Object[] { factory.containsBean("red5.common"), factory.containsLocalBean("red5.common"), factory.containsSingleton("red5.common"), });
      parentContext = (ApplicationContext) factory.getBean("red5.common");
    }
    if (config.startsWith("/")) {
      // Spring always interprets files as relative, so will strip a leading slash unless we tell
      // it otherwise. It also appears to not need this for Windows
View Full Code Here

    String[] bnames = BeanFactoryUtils.beanNamesIncludingAncestors(context);
    for (String bname : bnames) {
      log.debug("Bean: {}", bname);
    }
    ConfigurableBeanFactory factory = ((ConfigurableApplicationContext) applicationContext).getBeanFactory();
    if (factory.containsSingleton(name)) {
      log.debug("Context found in parent, destroying: {}", name);
      FileSystemXmlApplicationContext ctx = (FileSystemXmlApplicationContext) factory.getSingleton(name);
      if (ctx.isRunning()) {
        log.debug("Context was running, attempting to stop");
        ctx.stop();
View Full Code Here

          factory.destroyBean(name, ctx);
        } catch (Exception e) {
          log.warn("Context destroy failed for: {}", name, e);
          ctx.destroy();
        } finally {
          if (factory.containsSingleton(name)) {
            log.debug("Singleton still exists, trying another destroy method");
            ((DefaultListableBeanFactory) factory).destroySingleton(name);
          }
        }
      }
View Full Code Here

      //shutdown our jmx agent
      JMXAgent.shutdown();
      //shutdown spring
      FileSystemXmlApplicationContext appContext = (FileSystemXmlApplicationContext) getApplicationContext();
      ConfigurableBeanFactory factory = appContext.getBeanFactory();
      if (factory.containsSingleton("default.context")) {
        for (String scope : factory.getRegisteredScopeNames()) {
          logger.debug("Registered scope: " + scope);
        }
        for (String singleton : factory.getSingletonNames()) {
          logger.debug("Registered singleton: " + singleton);
View Full Code Here

      // get web application context from the servlet context
      ConfigurableWebApplicationContext applicationContext = (ConfigurableWebApplicationContext) servletContext
          .getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
      ConfigurableBeanFactory factory = applicationContext
          .getBeanFactory();
      if (factory.containsSingleton("default.context")) {
        for (String scope : factory.getRegisteredScopeNames()) {
          logger.debug("Registered scope: " + scope);
        }
        for (String singleton : factory.getSingletonNames()) {
          logger.debug("Registered singleton: " + singleton);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.