congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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

  • Start an intent from android
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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