class PropertySourceChangeListener implements SpringListener<SpringEvent<?>> {

    private final static AgentLogger LOGGER = AgentLogger.getLogger(PropertySourceChangeListener.class);

    private final DefaultListableBeanFactory beanFactory;

    public static void register(ConfigurableApplicationContext context) {
        ConfigurableListableBeanFactory configurableListableBeanFactory = context.getBeanFactory();
        if (!(configurableListableBeanFactory instanceof DefaultListableBeanFactory)) {
            LOGGER.debug(
                "beanFactory is not DefaultListableBeanFactory, skip register PropertySourceChangeBootListener, {}",
                ObjectUtils.identityToString(configurableListableBeanFactory));
            return;
        }
        LOGGER.debug("register PropertySourceChangeBootListener, {}",
            ObjectUtils.identityToString(configurableListableBeanFactory));
        PropertySourceChangeListener propertySourceChangeListener = new PropertySourceChangeListener(
            (DefaultListableBeanFactory)configurableListableBeanFactory);
        // add instance to map and instance
        SpringEventSource.INSTANCE.addListener(propertySourceChangeListener);
    }

    public PropertySourceChangeListener(DefaultListableBeanFactory beanFactory) {
        this.beanFactory = beanFactory;
    }

    @Override
    public DefaultListableBeanFactory beanFactory() {
        return beanFactory;
    }

    @Override
    public void onEvent(SpringEvent<?> event) {
        if (event instanceof PropertiesChangeEvent) {
            refreshConfigurationProperties(event.getBeanFactory());
        }
    }

    private void refreshConfigurationProperties(ConfigurableListableBeanFactory eventBeanFactory) {
        for (String singleton : beanFactory.getSingletonNames()) {
            Object bean = beanFactory.getSingleton(singleton);
            Class<?> beanClass = ClassUtils.getUserClass(bean.getClass());

            if (AnnotationHelper.hasAnnotation(beanClass, ConfigurationProperties.class.getName())) {
                LOGGER.debug("refresh configuration properties: {}", beanClass);
                String[] beanNames = beanFactory.getBeanNamesForType(beanClass);
                if (beanNames != null && beanNames.length > 0) {
                    SpringEventSource.INSTANCE.fireEvent(new BeanChangeEvent(beanNames, eventBeanFactory));
                }
            }
        }
    }

    @Override
    public boolean equals(Object o) {<FILL_FUNCTION_BODY>}

    @Override
    public int hashCode() {
        return Objects.hash(beanFactory);
    }
}

        if (this == o) {return true;}
        if (!(o instanceof PropertySourceChangeListener)) {return false;}
        PropertySourceChangeListener that = (PropertySourceChangeListener)o;
        return Objects.equals(beanFactory, that.beanFactory);
    
<no_super_class>