org.springframework.context.ApplicationContext.getParentBeanFactory()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中org.springframework.context.ApplicationContext.getParentBeanFactory()方法的一些代码示例,展示了ApplicationContext.getParentBeanFactory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationContext.getParentBeanFactory()方法的具体详情如下:
包路径:org.springframework.context.ApplicationContext
类名称:ApplicationContext
方法名:getParentBeanFactory

ApplicationContext.getParentBeanFactory介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-security

private Map<String, ?> getBeansOfType(Class<?> type) {
  Map<String, ?> beans = beanFactory.getBeansOfType(type);
  // Check ancestor bean factories if they exist and the current one has none of the
  // required type
  BeanFactory parent = beanFactory.getParentBeanFactory();
  while (parent != null && beans.size() == 0) {
    if (parent instanceof ListableBeanFactory) {
      beans = ((ListableBeanFactory) parent).getBeansOfType(type);
    }
    if (parent instanceof HierarchicalBeanFactory) {
      parent = ((HierarchicalBeanFactory) parent).getParentBeanFactory();
    }
    else {
      break;
    }
  }
  return beans;
}

代码示例来源:origin: Red5/red5-server

/**
 * Setter for application context
 * 
 * @param context
 *            App context
 */
public void setApplicationContext(ApplicationContext context) {
  this.applicationContext = context;
  String deploymentType = System.getProperty("red5.deployment.type");
  logger.debug("Deployment type: " + deploymentType);
  if (deploymentType == null) {
    // standalone core context
    String config = System.getProperty("red5.conf_file");
    if (config == null) {
      config = "red5.xml";
    }
    coreContext = ContextSingletonBeanFactoryLocator.getInstance(config).useBeanFactory("red5.core").getFactory();
  } else {
    logger.info("Setting parent bean factory as core");
    coreContext = applicationContext.getParentBeanFactory();
  }
}

代码示例来源:origin: org.springframework.security/spring-security-config

private Map<String, ?> getBeansOfType(Class<?> type) {
  Map<String, ?> beans = beanFactory.getBeansOfType(type);
  // Check ancestor bean factories if they exist and the current one has none of the
  // required type
  BeanFactory parent = beanFactory.getParentBeanFactory();
  while (parent != null && beans.size() == 0) {
    if (parent instanceof ListableBeanFactory) {
      beans = ((ListableBeanFactory) parent).getBeansOfType(type);
    }
    if (parent instanceof HierarchicalBeanFactory) {
      parent = ((HierarchicalBeanFactory) parent).getParentBeanFactory();
    }
    else {
      break;
    }
  }
  return beans;
}

代码示例来源:origin: net.sf.taverna.t2.infrastructure/platform-spring

/**
 * Delegates to internal ApplicationContext supplied by constructor
 */
public final BeanFactory getParentBeanFactory() {
  return context.getParentBeanFactory();
}

代码示例来源:origin: com.consol.citrus/citrus-ws

public BeanFactory getParentBeanFactory() {
  return applicationContext.getParentBeanFactory();
}
public boolean containsLocalBean(String name) {

代码示例来源:origin: pl.edu.icm.yadda/yadda-common

/**
 * @return
 * @see org.springframework.beans.factory.HierarchicalBeanFactory#getParentBeanFactory()
 */
public BeanFactory getParentBeanFactory() {
  return target.getParentBeanFactory();
}

代码示例来源:origin: unic/neba

@Override
public BeanFactory getParentBeanFactory() {
  return wrapped.getParentBeanFactory();
}

代码示例来源:origin: org.kuali.student.common/ks-common-util

public BeanFactory getParentBeanFactory() {
  return applicationContext.getParentBeanFactory();
}

代码示例来源:origin: org.kuali.student.core/ks-common-util

@Override
public BeanFactory getParentBeanFactory() {
  return applicationContext.getParentBeanFactory();
}

代码示例来源:origin: net.javacrumbs/smock-http

public BeanFactory getParentBeanFactory() {
  return wrappedApplicationContext.getParentBeanFactory();
}

代码示例来源:origin: apache/archiva

@Override
public BeanFactory getParentBeanFactory()
{
  return applicationContext.getParentBeanFactory();
}

代码示例来源:origin: org.springframework.security/org.springframework.security.config

private Map<String,?> getBeansOfType(Class<?> type) {
  Map<String,?> beans = beanFactory.getBeansOfType(type);
  // Check ancestor bean factories if they exist and the current one has none of the required type
  BeanFactory parent = beanFactory.getParentBeanFactory();
  while (parent != null && beans.size() == 0) {
    if (parent instanceof ListableBeanFactory) {
      beans = ((ListableBeanFactory)parent).getBeansOfType(type);
    }
    if (parent instanceof HierarchicalBeanFactory) {
      parent = ((HierarchicalBeanFactory)parent).getParentBeanFactory();
    } else {
      break;
    }
  }
  return beans;
}

代码示例来源:origin: apache/servicemix-bundles

private Map<String, ?> getBeansOfType(Class<?> type) {
  Map<String, ?> beans = beanFactory.getBeansOfType(type);
  // Check ancestor bean factories if they exist and the current one has none of the
  // required type
  BeanFactory parent = beanFactory.getParentBeanFactory();
  while (parent != null && beans.size() == 0) {
    if (parent instanceof ListableBeanFactory) {
      beans = ((ListableBeanFactory) parent).getBeansOfType(type);
    }
    if (parent instanceof HierarchicalBeanFactory) {
      parent = ((HierarchicalBeanFactory) parent).getParentBeanFactory();
    }
    else {
      break;
    }
  }
  return beans;
}

代码示例来源:origin: Kixeye/chassis

if (loggerLoader != null) {
  ConfigurableBeanFactory beanFactory = (ConfigurableBeanFactory) applicationContext.getParentBeanFactory();
  beanFactory.destroyBean(FlumeLoggerLoader.PROTOTYPE_BEAN_NAME, loggerLoader);
  loggerLoader = null;
ConfigurableBeanFactory beanFactory = (ConfigurableBeanFactory) applicationContext.getParentBeanFactory();
beanFactory.destroyBean(FlumeLoggerLoader.PROTOTYPE_BEAN_NAME, loggerLoader);
loggerLoader = null;

相关文章