Examples of containsSingleton()


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

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

      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

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

    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

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

          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

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

      //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

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

      // 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

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

      String[] beanNames = bf.getBeanDefinitionNames();
      for (int i = 0; i < beanNames.length; i++) {
        String beanName = beanNames[i];
        BeanDefinition bd = bf.getBeanDefinition(beanName);
        if (bd.getRole() != BeanDefinition.ROLE_INFRASTRUCTURE &&
            (!bd.isLazyInit() || bf.containsSingleton(beanName))) {
          result.append("{\n\"bean\": \"").append(beanName).append("\",\n");
          String scope = bd.getScope();
          if (!StringUtils.hasText(scope)) {
            scope = BeanDefinition.SCOPE_SINGLETON;
          }
View Full Code Here

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

    // Detect any custom bean name generation strategy supplied through the enclosing application context
    SingletonBeanRegistry singletonRegistry = null;
    if (registry instanceof SingletonBeanRegistry) {
      singletonRegistry = (SingletonBeanRegistry) registry;
      if (!this.localBeanNameGeneratorSet && singletonRegistry.containsSingleton(CONFIGURATION_BEAN_NAME_GENERATOR)) {
        BeanNameGenerator generator = (BeanNameGenerator) singletonRegistry.getSingleton(CONFIGURATION_BEAN_NAME_GENERATOR);
        this.componentScanBeanNameGenerator = generator;
        this.importBeanNameGenerator = generator;
      }
    }
View Full Code Here

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

    }
    this.reader.loadBeanDefinitions(parser.getConfigurationClasses());

    // Register the ImportRegistry as a bean in order to support ImportAware @Configuration classes
    if (singletonRegistry != null) {
      if (!singletonRegistry.containsSingleton(IMPORT_REGISTRY_BEAN_NAME)) {
        singletonRegistry.registerSingleton(IMPORT_REGISTRY_BEAN_NAME, parser.getImportRegistry());
      }
    }

    if (this.metadataReaderFactory instanceof CachingMetadataReaderFactory) {
View Full Code Here

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

    // Detect any custom bean name generation strategy supplied through the enclosing application context
    SingletonBeanRegistry singletonRegistry = null;
    if (registry instanceof SingletonBeanRegistry) {
      singletonRegistry = (SingletonBeanRegistry) registry;
      if (!this.localBeanNameGeneratorSet && singletonRegistry.containsSingleton(CONFIGURATION_BEAN_NAME_GENERATOR)) {
        BeanNameGenerator generator = (BeanNameGenerator) singletonRegistry.getSingleton(CONFIGURATION_BEAN_NAME_GENERATOR);
        this.componentScanBeanNameGenerator = generator;
        this.importBeanNameGenerator = generator;
      }
    }
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.