Codota Logo
ConfigurableBeanFactory.containsSingleton
Code IndexAdd Codota 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)

  • Common ways to obtain ConfigurableBeanFactory
private void myMethod () {
ConfigurableBeanFactory c =
  • Codota IconConfigurableApplicationContext configurableApplicationContext;configurableApplicationContext.getBeanFactory()
  • Codota IconDefaultMessageHandlerMethodFactory defaultMessageHandlerMethodFactory;(ConfigurableBeanFactory) defaultMessageHandlerMethodFactory.beanFactory
  • Smart code suggestions by Codota
}
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

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now