congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ConfigurableBeanFactory.containsSingleton
Code IndexAdd Tabnine to your IDE (free)

How to use
containsSingleton
method
in
org.springframework.beans.factory.config.ConfigurableBeanFactory

Best Java code snippets using org.springframework.beans.factory.config.ConfigurableBeanFactory.containsSingleton (Showing top 6 results out of 315)

origin: spring-projects/spring-framework

/**
 * Determine whether the specified bean is eligible for inclusion in the
 * LiveBeansView JSON snapshot.
 * @param beanName the name of the bean
 * @param bd the corresponding bean definition
 * @param bf the containing bean factory
 * @return {@code true} if the bean is to be included; {@code false} otherwise
 */
protected boolean isBeanEligible(String beanName, BeanDefinition bd, ConfigurableBeanFactory bf) {
  return (bd.getRole() != BeanDefinition.ROLE_INFRASTRUCTURE &&
      (!bd.isLazyInit() || bf.containsSingleton(beanName)));
}
origin: org.springframework/spring-context

/**
 * Determine whether the specified bean is eligible for inclusion in the
 * LiveBeansView JSON snapshot.
 * @param beanName the name of the bean
 * @param bd the corresponding bean definition
 * @param bf the containing bean factory
 * @return {@code true} if the bean is to be included; {@code false} otherwise
 */
protected boolean isBeanEligible(String beanName, BeanDefinition bd, ConfigurableBeanFactory bf) {
  return (bd.getRole() != BeanDefinition.ROLE_INFRASTRUCTURE &&
      (!bd.isLazyInit() || bf.containsSingleton(beanName)));
}
origin: Red5/red5-server

if (factory.containsSingleton(name)) {
  log.warn("Singleton {} already exists, try unload first", name);
  return;
  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");
origin: Red5/red5-server

if (factory.containsSingleton(name)) {
  log.debug("Context found in parent, destroying: {}", name);
  FileSystemXmlApplicationContext ctx = (FileSystemXmlApplicationContext) factory.getSingleton(name);
      ctx.destroy();
    } finally {
      if (factory.containsSingleton(name)) {
        log.debug("Singleton still exists, trying another destroy method");
        ((DefaultListableBeanFactory) factory).destroySingleton(name);
origin: org.springframework.boot/spring-boot-actuator

private static boolean isBeanEligible(String beanName, BeanDefinition bd,
    ConfigurableBeanFactory bf) {
  return (bd.getRole() != BeanDefinition.ROLE_INFRASTRUCTURE
      && (!bd.isLazyInit() || bf.containsSingleton(beanName)));
}
origin: apache/servicemix-bundles

/**
 * Determine whether the specified bean is eligible for inclusion in the
 * LiveBeansView JSON snapshot.
 * @param beanName the name of the bean
 * @param bd the corresponding bean definition
 * @param bf the containing bean factory
 * @return {@code true} if the bean is to be included; {@code false} otherwise
 */
protected boolean isBeanEligible(String beanName, BeanDefinition bd, ConfigurableBeanFactory bf) {
  return (bd.getRole() != BeanDefinition.ROLE_INFRASTRUCTURE &&
      (!bd.isLazyInit() || bf.containsSingleton(beanName)));
}
org.springframework.beans.factory.configConfigurableBeanFactorycontainsSingleton

Javadoc

Check if this bean factory contains a singleton instance with the given name. Only checks already instantiated singletons; does not return true for singleton bean definitions that have not been instantiated yet.

The main purpose of this method is to check manually registered singletons (see registerSingleton). Can also be used to check whether a singleton defined by a bean definition has already been created.

To check whether a bean factory contains a bean definition with a given name, use ListableBeanFactory's containsBeanDefinition. Calling both containsBeanDefinition and containsSingleton answers whether a specific bean factory contains an own bean with the given name.

Use BeanFactory's containsBean for general checks whether the factory knows about a bean with a given name (whether manually registed singleton instance or created by bean definition), also checking ancestor factories.

Popular methods of ConfigurableBeanFactory

  • resolveEmbeddedValue
    Resolve the given embedded value, e.g. an annotation attribute.
  • getBeanExpressionResolver
    Return the resolution strategy for expressions in bean definition values.
  • getBean
  • registerSingleton
    Register the given existing object as singleton in the bean factory, under the given bean name.The g
  • getTypeConverter
    Obtain a type converter as used by this BeanFactory. This may be a fresh instance for each call, sin
  • getBeanClassLoader
    Return this factory's class loader for loading bean classes (only null if even the system ClassLoade
  • containsBean
  • getConversionService
    Return the associated ConversionService, if any.
  • getMergedBeanDefinition
    Return a merged BeanDefinition for the given bean name, merging a child bean definition with its par
  • isCurrentlyInCreation
    Determine whether the specified bean is currently in creation.
  • getSingletonMutex
  • destroySingletons
    Destroy all cached singletons in this factory. To be called on shutdown of a factory.
  • getSingletonMutex,
  • destroySingletons,
  • getSingletonNames,
  • registerDependentBean,
  • destroyBean,
  • isFactoryBean,
  • isSingleton,
  • registerAlias,
  • addBeanPostProcessor

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now