Class BeanTimeStatistics

java.lang.Object
io.microsphere.spring.context.event.BeanTimeStatistics
All Implemented Interfaces:
BeanListener, EventListener, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware

public class BeanTimeStatistics extends Object implements BeanListener, org.springframework.beans.factory.BeanNameAware
Bean Time Statistics
Since:
1.0.0
Author:
Mercy
  • Constructor Details

    • BeanTimeStatistics

      public BeanTimeStatistics()
  • Method Details

    • supports

      public boolean supports(String beanName)
      Description copied from interface: BeanListener
      Supports the bean to be listened or not
      Specified by:
      supports in interface BeanListener
      Parameters:
      beanName - the name of bean
      Returns:
      If false, any method of bean lifecycle will not be called
    • onBeanDefinitionReady

      public void onBeanDefinitionReady(String beanName, org.springframework.beans.factory.support.RootBeanDefinition mergedBeanDefinition)
      Description copied from interface: BeanListener
      Handle the event when the BeanDefinition is ready(merged)
      Specified by:
      onBeanDefinitionReady in interface BeanListener
      Parameters:
      beanName - the bean name
      mergedBeanDefinition - the merged BeanDefinition
    • onBeforeBeanInstantiate

      public void onBeforeBeanInstantiate(String beanName, org.springframework.beans.factory.support.RootBeanDefinition mergedBeanDefinition)
      Description copied from interface: BeanListener
      Handle the event before the bean instantiation
      Specified by:
      onBeforeBeanInstantiate in interface BeanListener
      Parameters:
      beanName - the bean name
      mergedBeanDefinition - the merged BeanDefinition
    • onBeforeBeanInstantiate

      public void onBeforeBeanInstantiate(String beanName, org.springframework.beans.factory.support.RootBeanDefinition mergedBeanDefinition, Constructor<?> constructor, Object[] args)
      Description copied from interface: BeanListener
      Handle the event before the bean instantiation using the constructor
      Specified by:
      onBeforeBeanInstantiate in interface BeanListener
      Parameters:
      beanName - the bean name
      mergedBeanDefinition - the merged BeanDefinition
      constructor - the constructor for bean instantiation
      args - the arguments of constructor
    • onBeforeBeanInstantiate

      public void onBeforeBeanInstantiate(String beanName, org.springframework.beans.factory.support.RootBeanDefinition mergedBeanDefinition, Object factoryBean, Method factoryMethod, Object[] args)
      Description copied from interface: BeanListener
      Handle the event before the bean instantiation using the factory method
      Specified by:
      onBeforeBeanInstantiate in interface BeanListener
      Parameters:
      beanName - the bean name
      mergedBeanDefinition - the merged BeanDefinition
      factoryBean - the factory bean(optional)
      factoryMethod - the factory Method for bean instantiation
    • onAfterBeanInstantiated

      public void onAfterBeanInstantiated(String beanName, org.springframework.beans.factory.support.RootBeanDefinition mergedBeanDefinition, Object bean)
      Description copied from interface: BeanListener
      Handle the event before after the bean instantiation
      Specified by:
      onAfterBeanInstantiated in interface BeanListener
      Parameters:
      beanName - the bean name
      mergedBeanDefinition - the merged BeanDefinition
      bean - the bean has been instantiated, not initialized yet
    • onBeanPropertyValuesReady

      public void onBeanPropertyValuesReady(String beanName, Object bean, org.springframework.beans.PropertyValues pvs)
      Description copied from interface: BeanListener
      Handle the event when the Beans' PropertyValues is ready
      Specified by:
      onBeanPropertyValuesReady in interface BeanListener
      Parameters:
      beanName - the bean name
      bean - the bean has been instantiated, not initialized yet
      pvs - the PropertyValues will be applied on bean
    • onBeforeBeanInitialize

      public void onBeforeBeanInitialize(String beanName, Object bean)
      Description copied from interface: BeanListener
      Handle the event before the bean initialization
      Specified by:
      onBeforeBeanInitialize in interface BeanListener
      Parameters:
      beanName - the bean name
      bean - the bean is not initialized yet
    • onAfterBeanInitialized

      public void onAfterBeanInitialized(String beanName, Object bean)
      Description copied from interface: BeanListener
      Handle the event after the bean initialization
      Specified by:
      onAfterBeanInitialized in interface BeanListener
      Parameters:
      beanName - the bean name
      bean - the bean has been initialized
    • onBeanReady

      public void onBeanReady(String beanName, Object bean)
      Description copied from interface: BeanListener
      Handle the event on the bean ready
      Specified by:
      onBeanReady in interface BeanListener
      Parameters:
      beanName - the bean name
      bean - the bean is prepared
    • onBeforeBeanDestroy

      public void onBeforeBeanDestroy(String beanName, Object bean)
      Description copied from interface: BeanListener
      Handle the event before the bean destroy
      Specified by:
      onBeforeBeanDestroy in interface BeanListener
      Parameters:
      beanName - the bean name
      bean - the bean is to be destroyed
    • onAfterBeanDestroy

      public void onAfterBeanDestroy(String beanName, Object bean)
      Description copied from interface: BeanListener
      Handle the event after the bean destroy
      Specified by:
      onAfterBeanDestroy in interface BeanListener
      Parameters:
      beanName - the bean name
      bean - the bean is destroyed
    • getStopWatch

      public io.microsphere.util.StopWatch getStopWatch()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setBeanName

      public void setBeanName(String name)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware