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

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

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

origin: spring-projects/spring-framework

/**
 * Subclasses should call this method to destroy an obsolete prototype instance.
 * @param target the bean instance to destroy
 */
protected void destroyPrototypeInstance(Object target) {
  if (logger.isDebugEnabled()) {
    logger.debug("Destroying instance of bean '" + getTargetBeanName() + "'");
  }
  if (getBeanFactory() instanceof ConfigurableBeanFactory) {
    ((ConfigurableBeanFactory) getBeanFactory()).destroyBean(getTargetBeanName(), target);
  }
  else if (target instanceof DisposableBean) {
    try {
      ((DisposableBean) target).destroy();
    }
    catch (Throwable ex) {
      logger.warn("Destroy method on bean with name '" + getTargetBeanName() + "' threw an exception", ex);
    }
  }
}
origin: Red5/red5-server

} else {
  try {
    factory.destroyBean(name, ctx);
  } catch (Exception e) {
    log.warn("Context destroy failed for: {}", name, e);
origin: org.pustefixframework/pustefix-cdi

public void destroyBean(String beanName, Object beanInstance) {
  beanFactory.destroyBean(beanName, beanInstance);
}

origin: Kixeye/chassis

  beanFactory.destroyBean(FlumeLoggerLoader.PROTOTYPE_BEAN_NAME, loggerLoader);
  loggerLoader = null;
beanFactory.destroyBean(FlumeLoggerLoader.PROTOTYPE_BEAN_NAME, loggerLoader);
loggerLoader = null;
origin: apache/servicemix-bundles

/**
 * Subclasses should call this method to destroy an obsolete prototype instance.
 * @param target the bean instance to destroy
 */
protected void destroyPrototypeInstance(Object target) {
  if (logger.isDebugEnabled()) {
    logger.debug("Destroying instance of bean '" + getTargetBeanName() + "'");
  }
  if (getBeanFactory() instanceof ConfigurableBeanFactory) {
    ((ConfigurableBeanFactory) getBeanFactory()).destroyBean(getTargetBeanName(), target);
  }
  else if (target instanceof DisposableBean) {
    try {
      ((DisposableBean) target).destroy();
    }
    catch (Throwable ex) {
      logger.error("Couldn't invoke destroy method of bean with name '" + getTargetBeanName() + "'", ex);
    }
  }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop

/**
 * Subclasses should call this method to destroy an obsolete prototype instance.
 * @param target the bean instance to destroy
 */
protected void destroyPrototypeInstance(Object target) {
  if (logger.isDebugEnabled()) {
    logger.debug("Destroying instance of bean '" + getTargetBeanName() + "'");
  }
  if (getBeanFactory() instanceof ConfigurableBeanFactory) {
    ((ConfigurableBeanFactory) getBeanFactory()).destroyBean(getTargetBeanName(), target);
  }
  else if (target instanceof DisposableBean) {
    try {
      ((DisposableBean) target).destroy();
    }
    catch (Throwable ex) {
      logger.warn("Destroy method on bean with name '" + getTargetBeanName() + "' threw an exception", ex);
    }
  }
}
org.springframework.beans.factory.configConfigurableBeanFactorydestroyBean

Javadoc

Destroy the given bean instance (usually a prototype instance obtained from this factory) according to its bean definition.

Any exception that arises during destruction should be caught and logged instead of propagated to the caller of this method.

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,
  • containsSingleton,
  • isFactoryBean,
  • isSingleton,
  • registerAlias,
  • addBeanPostProcessor

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • 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