Interface InitializingBean

All Known Implementing Classes:
AbstractCacheManager, AbstractCacheResolver, AbstractColumnMaxValueIncrementer, AbstractDataFieldMaxValueIncrementer, AbstractEntityManagerFactoryBean, AbstractFactoryBean, AbstractHandlerMethodMapping, AbstractHandlerMethodMapping, AbstractIdentityColumnMaxValueIncrementer, AbstractJmsListeningContainer, AbstractMessageListenerContainer, AbstractMethodMessageHandler, AbstractMethodMessageHandler, AbstractPdfStamperView, AbstractPollingMessageListenerContainer, AbstractRefreshableConfigApplicationContext, AbstractRefreshableWebApplicationContext, AbstractRequestLoggingFilter, AbstractRoutingConnectionFactory, AbstractRoutingDataSource, AbstractSequenceMaxValueIncrementer, AbstractServiceLoaderBasedFactoryBean, AbstractSingletonProxyFactoryBean, AbstractTemplateView, AbstractTransactionSupportingCacheManager, AbstractUrlBasedView, AbstractUrlBasedView, AbstractXmlApplicationContext, AnnotationConfigWebApplicationContext, AnnotationMBeanExporter, BatchSqlUpdate, BeanConfigurerSupport, BeanValidationPostProcessor, CacheAspectSupport, CacheInterceptor, CacheProxyFactoryBean, CachingConnectionFactory, CachingDestinationResolverProxy, CharacterEncodingFilter, ClassPathXmlApplicationContext, CommonsRequestLoggingFilter, CompositeCacheManager, ConcurrentMapCacheFactoryBean, ConfigurableMimeFileTypeMap, ConnectionFactoryInitializer, ConnectorServerFactoryBean, ContentNegotiatingViewResolver, ContentNegotiationManagerFactoryBean, ContextLifecycleScheduledTaskRegistrar, ConversionServiceFactoryBean, CorsFilter, CronTriggerFactoryBean, CustomSQLExceptionTranslatorRegistrar, CustomValidatorBean, DaoSupport, DatabaseStartupValidator, DataSourceInitializer, DataSourceTransactionManager, DateTimeFormatterFactoryBean, Db2LuwMaxValueIncrementer, Db2MainframeMaxValueIncrementer, DefaultManagedAwareThreadFactory, DefaultManagedTaskExecutor, DefaultManagedTaskScheduler, DefaultMessageHandlerMethodFactory, DefaultMessageListenerContainer, DefaultPersistenceUnitManager, DelegatingConnectionFactory, DelegatingDataSource, DelegatingFilterProxy, DerbyMaxValueIncrementer, EmbeddedDatabaseFactoryBean, EventPublicationInterceptor, ExceptionHandlerExceptionResolver, ExecutorConfigurationSupport, FieldRetrievingFactoryBean, FileSystemXmlApplicationContext, ForkJoinPoolFactoryBean, FormattingConversionServiceFactoryBean, FormContentFilter, ForwardedHeaderFilter, FreeMarkerConfigurationFactoryBean, FreeMarkerConfigurer, FreeMarkerConfigurer, FreeMarkerView, FreeMarkerView, FreeMarkerViewResolver, GenericFilterBean, GenericMessageEndpointManager, GenericSqlQuery, GenericStoredProcedure, GroovyMarkupConfigurer, GroovyMarkupView, GroovyWebApplicationContext, GsonFactoryBean, H2SequenceMaxValueIncrementer, HanaSequenceMaxValueIncrementer, HandlerMappingIntrospector, HibernateDaoSupport, HibernateTemplate, HibernateTransactionManager, HiddenHttpMethodFilter, HsqlMaxValueIncrementer, HsqlSequenceMaxValueIncrementer, InterfaceBasedMBeanInfoAssembler, InternalResourceView, IsolationLevelDataSourceAdapter, IsolationLevelDataSourceRouter, Jackson2ObjectMapperFactoryBean, Jaxb2Marshaller, JCacheAspectSupport, JCacheCacheManager, JCacheInterceptor, JCacheManagerFactoryBean, JdbcAccessor, JdbcDaoSupport, JdbcTemplate, JdbcTransactionManager, JdkHttpClientResourceFactory, JettyClientHttpRequestFactory, JettyResourceFactory, JmsAccessor, JmsDestinationAccessor, JmsGatewaySupport, JmsListenerEndpointRegistrar, JmsMessageEndpointManager, JmsMessagingTemplate, JmsTemplate, JmsTransactionManager, JndiObjectFactoryBean, JndiObjectLocator, JndiObjectTargetSource, JobDetailFactoryBean, JpaTransactionManager, JstlView, JtaTransactionManager, JtaTransactionManagerFactoryBean, KeyNamingStrategy, LazyConnectionDataSourceProxy, ListFactoryBean, LocalConnectionFactoryBean, LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean, LocalSessionFactoryBean, LocalValidatorFactoryBean, MapFactoryBean, MappingSqlQuery, MappingSqlQueryWithParameters, MariaDBSequenceMaxValueIncrementer, MarshallingMessageConverter, MBeanClientInterceptor, MBeanExporter, MBeanProxyFactoryBean, MBeanServerConnectionFactoryBean, MBeanServerFactoryBean, MessageMappingMessageHandler, MessagingMessageConverter, MetadataMBeanInfoAssembler, MetadataNamingStrategy, MethodInvokingBean, MethodInvokingFactoryBean, MethodInvokingJobDetailFactoryBean, MethodInvokingRunnable, MethodMapTransactionAttributeSource, MethodValidationPostProcessor, MultipartFilter, MySQLMaxValueIncrementer, NamedCacheResolver, NamedParameterJdbcDaoSupport, NameMatchTransactionAttributeSource, NotificationListenerBean, NotificationListenerRegistrar, ObjectFactoryCreatingFactoryBean, OncePerRequestFilter, OpenEntityManagerInViewFilter, OpenSessionInterceptor, OpenSessionInViewFilter, OptionalValidatorFactoryBean, OracleSequenceMaxValueIncrementer, PersistenceExceptionTranslationInterceptor, PostgresSequenceMaxValueIncrementer, PreferencesPlaceholderConfigurer, PropertiesFactoryBean, ProviderCreatingFactoryBean, ProxyFactoryBean, R2dbcTransactionManager, RdbmsOperation, ReactorNetty2ResourceFactory, ReactorResourceFactory, RedirectView, RedirectView, RelativeRedirectFilter, RequestContextFilter, RequestMappingHandlerAdapter, RequestMappingHandlerAdapter, RequestMappingHandlerMapping, RequestMappingHandlerMapping, RequestMappingInfoHandlerMapping, RequestMappingInfoHandlerMapping, ResourceAdapterFactoryBean, ResourceBundleViewResolver, ResourceHttpRequestHandler, ResourceUrlEncodingFilter, ResourceWebHandler, RouterFunctionMapping, RouterFunctionMapping, RSocketMessageHandler, ScheduledExecutorFactoryBean, ScheduledTaskRegistrar, SchedulerAccessorBean, SchedulerFactoryBean, ScriptTemplateView, ScriptTemplateView, ScriptTemplateViewResolver, ServerEndpointExporter, ServerHttpObservationFilter, ServerResponseResultHandler, ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean, ServiceLocatorFactoryBean, ServletContextRequestLoggingFilter, ServletServerContainerFactoryBean, ServletWrappingController, SetFactoryBean, ShallowEtagHeaderFilter, SharedEntityManagerBean, SimpAnnotationMethodMessageHandler, SimpleCacheManager, SimpleCacheResolver, SimpleExceptionCacheResolver, SimpleMessageListenerContainer, SimpleThreadPoolTaskExecutor, SimpleTriggerFactoryBean, SingleConnectionFactory, SortedResourcesFactoryBean, SqlCall, SqlFunction, SqlOperation, SqlQuery, SqlServerMaxValueIncrementer, SqlServerSequenceMaxValueIncrementer, SqlUpdate, StoredProcedure, SybaseAnywhereMaxValueIncrementer, SybaseMaxValueIncrementer, TaskExecutorFactoryBean, ThreadPoolExecutorFactoryBean, ThreadPoolTaskExecutor, ThreadPoolTaskScheduler, TransactionAspectSupport, TransactionAwareCacheManagerProxy, TransactionAwareDataSourceProxy, TransactionInterceptor, TransactionProxyFactoryBean, TransactionTemplate, UpdatableSqlQuery, UrlBasedViewResolver, UserCredentialsConnectionFactoryAdapter, UserCredentialsDataSourceAdapter, ViewResolverComposite, WebSocketAnnotationMethodMessageHandler, XmlViewResolver, XmlWebApplicationContext, XsltView, XStreamMarshaller, YamlMapFactoryBean, YamlPropertiesFactoryBean

public interface InitializingBean
Interface to be implemented by beans that need to react once all their properties have been set by a BeanFactory: e.g. to perform custom initialization, or merely to check that all mandatory properties have been set.

An alternative to implementing InitializingBean is specifying a custom init method, for example in an XML bean definition. For a list of all bean lifecycle methods, see the BeanFactory javadocs.

Author:
Rod Johnson, Juergen Hoeller
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.
  • Method Details

    • afterPropertiesSet

      void afterPropertiesSet() throws Exception
      Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

      This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

      Throws:
      Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason