{"id":19215036,"url":"https://github.com/chgl16/spring-bean-lifecycle","last_synced_at":"2026-06-10T20:32:08.445Z","repository":{"id":107504324,"uuid":"133796326","full_name":"chgl16/spring-bean-lifecycle","owner":"chgl16","description":"Spring Bean生命周期的学习","archived":false,"fork":false,"pushed_at":"2019-04-12T10:56:08.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-13T20:07:40.573Z","etag":null,"topics":["spring-bean"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chgl16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-17T10:15:47.000Z","updated_at":"2019-04-12T10:56:10.000Z","dependencies_parsed_at":"2023-06-18T20:19:16.387Z","dependency_job_id":null,"html_url":"https://github.com/chgl16/spring-bean-lifecycle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chgl16/spring-bean-lifecycle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chgl16%2Fspring-bean-lifecycle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chgl16%2Fspring-bean-lifecycle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chgl16%2Fspring-bean-lifecycle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chgl16%2Fspring-bean-lifecycle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chgl16","download_url":"https://codeload.github.com/chgl16/spring-bean-lifecycle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chgl16%2Fspring-bean-lifecycle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34170162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["spring-bean"],"created_at":"2024-11-09T14:12:30.170Z","updated_at":"2026-06-10T20:32:08.427Z","avatar_url":"https://github.com/chgl16.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Spring-Bean-lifecycle\nSpring Bean生命周期的学习\n\nConsole:  \nbean生命周期第一步, 实例化对象，调用了Person的构造函数  \nbean生命周期第二步， 属性注入，setXxx()方法  \nbean生命周期第三步,BeanNameAware接口，实现其setBeanName方法    arg0: person  \nbean生命周期第四步，BeanFactoryAware接口，实现其setBeanFactory方法， arg0: org.springframework.beans.factory.support.DefaultListableBeanFactory@3567135c: defining beans [person,employee,myBeanPostProcessor,myBeanNameAware]; root of factory hierarchy  \nbean生命周期第五步，ApplicationContextAware接口，实现其setApplicationContext方法， arg0: org.springframework.context.support.ClassPathXmlApplicationContext@433c675d: startup date [Thu May 17 17:43:45 CST 2018]; root of context hierarchy  \nbean生命周期第六步，postProcessBeforeInitialization 被调用  arg1:person  \nbean生命周期第七步，InitializingBean 接口  \nbean生命周期第八步，自定义的初始化方法，在配置中 init-method=\"init\"  \nbean生命周期第九步，postProcessAfterInitialization 被调用    arg1:top.chgl16.myspring.beanlife.Person@6500df86  \n\n\u003chr\u003e\n\nbean生命周期第一步, 实例化对象，调用了Employee的构造函数  \nbean生命周期第六步，postProcessBeforeInitialization 被调用  arg1:employee  \nbean生命周期第九步，postProcessAfterInitialization 被调用    arg1:top.chgl16.myspring.beanlife.Employee@4cf777e8  \n\n\u003chr\u003e\n\n测试 MyBeanNameAware, 配置后被当做一个单独的bean而已  \nbean生命周期第六步，postProcessBeforeInitialization 被调用  arg1:myBeanNameAware  \nbean生命周期第九步，postProcessAfterInitialization 被调用    arg1:top.chgl16.myspring.beanlife.MyBeanNameAware@2f686d1f  \nbean生命周期第十步，Hello chgl16\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchgl16%2Fspring-bean-lifecycle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchgl16%2Fspring-bean-lifecycle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchgl16%2Fspring-bean-lifecycle/lists"}