public class

DeprecatedBeanWarner

extends Object
implements BeanFactoryPostProcessor
java.lang.Object
   ↳ org.springframework.beans.factory.config.DeprecatedBeanWarner

Class Overview

Bean factory post processor that logs a warning for Deprecated @Deprecated beans.

Summary

Fields
protected Log logger Logger available to subclasses.
Public Constructors
DeprecatedBeanWarner()
Public Methods
void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
Modify the application context's internal bean factory after its standard initialization.
void setLoggerName(String loggerName)
Set the name of the logger to use.
Protected Methods
boolean isLogEnabled()
Determine whether the logger field is enabled.
void logDeprecatedBean(String beanName, BeanDefinition beanDefinition)
Logs a warning for a bean annotated with Deprecated @Deprecated.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.factory.config.BeanFactoryPostProcessor

Fields

protected Log logger

Also: SpringBeans

Logger available to subclasses.

Public Constructors

public DeprecatedBeanWarner ()

Also: SpringBeans

Public Methods

public void postProcessBeanFactory (ConfigurableListableBeanFactory beanFactory)

Also: SpringBeans

Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.

Parameters
beanFactory the bean factory used by the application context

public void setLoggerName (String loggerName)

Also: SpringBeans

Set the name of the logger to use. The name will be passed to the underlying logger implementation through Commons Logging, getting interpreted as log category according to the logger's configuration.

This can be specified to not log into the category of this warner class but rather into a specific named category.

See Also
  • org.apache.commons.logging.LogFactory#getLog(String)
  • org.apache.log4j.Logger#getLogger(String)
  • getLogger(String)

Protected Methods

protected boolean isLogEnabled ()

Also: SpringBeans

Determine whether the logger field is enabled.

Default is true when the "warn" level is enabled. Subclasses can override this to change the level under which logging occurs.

protected void logDeprecatedBean (String beanName, BeanDefinition beanDefinition)

Also: SpringBeans

Logs a warning for a bean annotated with Deprecated @Deprecated.

Parameters
beanName the name of the deprecated bean
beanDefinition the definition of the deprecated bean