{"action":"created","comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/pulls/comments/63380259","id":63380259,"diff_hunk":"@@ -0,0 +1,69 @@\n+/*\n+ * Copyright 2012-2016 the original author or authors.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.springframework.boot.actuate.health;\n+\n+import java.util.Collections;\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import org.springframework.util.Assert;\n+\n+/**\n+ * Default implementation of {@link HealthIndicatorRegistry}.\n+ *\n+ * @author Vedran Pavic\n+ */\n+public class DefaultHealthIndicatorRegistry implements HealthIndicatorRegistry {\n+\n+\tprivate final Map<String, HealthIndicator> healthIndicators =\n+\t\t\tnew HashMap<String, HealthIndicator>();\n+\n+\t@Override\n+\tpublic void register(String name, HealthIndicator healthIndicator) {\n+\t\tAssert.notNull(healthIndicator, \"HealthIndicator must not be null\");\n+\t\tsynchronized (this.healthIndicators) {\n+\t\t\tif (this.healthIndicators.get(name) != null) {","path":"spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/DefaultHealthIndicatorRegistry.java","position":39,"original_position":39,"commit_id":"c166a8a241ae968c4a3d343d3bff41447e860193","original_commit_id":"c166a8a241ae968c4a3d343d3bff41447e860193","user":{"login":"kartoffelsup","id":1819197,"avatar_url":"https://avatars.githubusercontent.com/u/1819197?v=3","gravatar_id":"","url":"https://api.github.com/users/kartoffelsup","html_url":"https://github.com/kartoffelsup","followers_url":"https://api.github.com/users/kartoffelsup/followers","following_url":"https://api.github.com/users/kartoffelsup/following{/other_user}","gists_url":"https://api.github.com/users/kartoffelsup/gists{/gist_id}","starred_url":"https://api.github.com/users/kartoffelsup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kartoffelsup/subscriptions","organizations_url":"https://api.github.com/users/kartoffelsup/orgs","repos_url":"https://api.github.com/users/kartoffelsup/repos","events_url":"https://api.github.com/users/kartoffelsup/events{/privacy}","received_events_url":"https://api.github.com/users/kartoffelsup/received_events","type":"User","site_admin":false},"body":"Why not `Assert.state(!this.healthIndicators.containsKey(name), text)`?","created_at":"2016-05-16T16:19:59Z","updated_at":"2016-05-16T16:19:59Z","html_url":"https://github.com/spring-projects/spring-boot/pull/4965#discussion_r63380259","pull_request_url":"https://api.github.com/repos/spring-projects/spring-boot/pulls/4965","_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-boot/pulls/comments/63380259"},"html":{"href":"https://github.com/spring-projects/spring-boot/pull/4965#discussion_r63380259"},"pull_request":{"href":"https://api.github.com/repos/spring-projects/spring-boot/pulls/4965"}}},"pull_request":{"url":"https://api.github.com/repos/spring-projects/spring-boot/pulls/4965","id":56387047,"html_url":"https://github.com/spring-projects/spring-boot/pull/4965","diff_url":"https://github.com/spring-projects/spring-boot/pull/4965.diff","patch_url":"https://github.com/spring-projects/spring-boot/pull/4965.patch","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4965","number":4965,"state":"open","locked":false,"title":"Introduce HealthIndicatorRegistry","user":{"login":"vpavic","id":1149230,"avatar_url":"https://avatars.githubusercontent.com/u/1149230?v=3","gravatar_id":"","url":"https://api.github.com/users/vpavic","html_url":"https://github.com/vpavic","followers_url":"https://api.github.com/users/vpavic/followers","following_url":"https://api.github.com/users/vpavic/following{/other_user}","gists_url":"https://api.github.com/users/vpavic/gists{/gist_id}","starred_url":"https://api.github.com/users/vpavic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpavic/subscriptions","organizations_url":"https://api.github.com/users/vpavic/orgs","repos_url":"https://api.github.com/users/vpavic/repos","events_url":"https://api.github.com/users/vpavic/events{/privacy}","received_events_url":"https://api.github.com/users/vpavic/received_events","type":"User","site_admin":false},"body":"This PR introduces ```HealthIndicatorRegistry``` which handles registration of ```HealthIndicator``` instances. Registering new ```HealthIndicator``` instances (as well as unregistering) is now possible in runtime (see #4894).\r\n\r\nI've signed the CLA.","created_at":"2016-01-18T20:19:55Z","updated_at":"2016-05-16T16:19:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5d5e67acac2ea2a451b333317d87015c48205a6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spring-projects/spring-boot/pulls/4965/commits","review_comments_url":"https://api.github.com/repos/spring-projects/spring-boot/pulls/4965/comments","review_comment_url":"https://api.github.com/repos/spring-projects/spring-boot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/4965/comments","statuses_url":"https://api.github.com/repos/spring-projects/spring-boot/statuses/c166a8a241ae968c4a3d343d3bff41447e860193","head":{"label":"vpavic:health-indicator-registry","ref":"health-indicator-registry","sha":"c166a8a241ae968c4a3d343d3bff41447e860193","user":{"login":"vpavic","id":1149230,"avatar_url":"https://avatars.githubusercontent.com/u/1149230?v=3","gravatar_id":"","url":"https://api.github.com/users/vpavic","html_url":"https://github.com/vpavic","followers_url":"https://api.github.com/users/vpavic/followers","following_url":"https://api.github.com/users/vpavic/following{/other_user}","gists_url":"https://api.github.com/users/vpavic/gists{/gist_id}","starred_url":"https://api.github.com/users/vpavic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpavic/subscriptions","organizations_url":"https://api.github.com/users/vpavic/orgs","repos_url":"https://api.github.com/users/vpavic/repos","events_url":"https://api.github.com/users/vpavic/events{/privacy}","received_events_url":"https://api.github.com/users/vpavic/received_events","type":"User","site_admin":false},"repo":{"id":43314481,"name":"spring-boot","full_name":"vpavic/spring-boot","owner":{"login":"vpavic","id":1149230,"avatar_url":"https://avatars.githubusercontent.com/u/1149230?v=3","gravatar_id":"","url":"https://api.github.com/users/vpavic","html_url":"https://github.com/vpavic","followers_url":"https://api.github.com/users/vpavic/followers","following_url":"https://api.github.com/users/vpavic/following{/other_user}","gists_url":"https://api.github.com/users/vpavic/gists{/gist_id}","starred_url":"https://api.github.com/users/vpavic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpavic/subscriptions","organizations_url":"https://api.github.com/users/vpavic/orgs","repos_url":"https://api.github.com/users/vpavic/repos","events_url":"https://api.github.com/users/vpavic/events{/privacy}","received_events_url":"https://api.github.com/users/vpavic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vpavic/spring-boot","description":"Spring Boot","fork":true,"url":"https://api.github.com/repos/vpavic/spring-boot","forks_url":"https://api.github.com/repos/vpavic/spring-boot/forks","keys_url":"https://api.github.com/repos/vpavic/spring-boot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vpavic/spring-boot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vpavic/spring-boot/teams","hooks_url":"https://api.github.com/repos/vpavic/spring-boot/hooks","issue_events_url":"https://api.github.com/repos/vpavic/spring-boot/issues/events{/number}","events_url":"https://api.github.com/repos/vpavic/spring-boot/events","assignees_url":"https://api.github.com/repos/vpavic/spring-boot/assignees{/user}","branches_url":"https://api.github.com/repos/vpavic/spring-boot/branches{/branch}","tags_url":"https://api.github.com/repos/vpavic/spring-boot/tags","blobs_url":"https://api.github.com/repos/vpavic/spring-boot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vpavic/spring-boot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vpavic/spring-boot/git/refs{/sha}","trees_url":"https://api.github.com/repos/vpavic/spring-boot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vpavic/spring-boot/statuses/{sha}","languages_url":"https://api.github.com/repos/vpavic/spring-boot/languages","stargazers_url":"https://api.github.com/repos/vpavic/spring-boot/stargazers","contributors_url":"https://api.github.com/repos/vpavic/spring-boot/contributors","subscribers_url":"https://api.github.com/repos/vpavic/spring-boot/subscribers","subscription_url":"https://api.github.com/repos/vpavic/spring-boot/subscription","commits_url":"https://api.github.com/repos/vpavic/spring-boot/commits{/sha}","git_commits_url":"https://api.github.com/repos/vpavic/spring-boot/git/commits{/sha}","comments_url":"https://api.github.com/repos/vpavic/spring-boot/comments{/number}","issue_comment_url":"https://api.github.com/repos/vpavic/spring-boot/issues/comments{/number}","contents_url":"https://api.github.com/repos/vpavic/spring-boot/contents/{+path}","compare_url":"https://api.github.com/repos/vpavic/spring-boot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vpavic/spring-boot/merges","archive_url":"https://api.github.com/repos/vpavic/spring-boot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vpavic/spring-boot/downloads","issues_url":"https://api.github.com/repos/vpavic/spring-boot/issues{/number}","pulls_url":"https://api.github.com/repos/vpavic/spring-boot/pulls{/number}","milestones_url":"https://api.github.com/repos/vpavic/spring-boot/milestones{/number}","notifications_url":"https://api.github.com/repos/vpavic/spring-boot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vpavic/spring-boot/labels{/name}","releases_url":"https://api.github.com/repos/vpavic/spring-boot/releases{/id}","deployments_url":"https://api.github.com/repos/vpavic/spring-boot/deployments","created_at":"2015-09-28T17:03:27Z","updated_at":"2016-01-15T22:11:18Z","pushed_at":"2016-05-15T10:20:51Z","git_url":"git://github.com/vpavic/spring-boot.git","ssh_url":"git@github.com:vpavic/spring-boot.git","clone_url":"https://github.com/vpavic/spring-boot.git","svn_url":"https://github.com/vpavic/spring-boot","homepage":"http://projects.spring.io/spring-boot","size":36805,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spring-projects:master","ref":"master","sha":"cd365bcae1ed96d07e6bacc0fff8e3f1fde8a068","user":{"login":"spring-projects","id":317776,"avatar_url":"https://avatars.githubusercontent.com/u/317776?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"repo":{"id":6296790,"name":"spring-boot","full_name":"spring-projects/spring-boot","owner":{"login":"spring-projects","id":317776,"avatar_url":"https://avatars.githubusercontent.com/u/317776?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-projects/spring-boot","description":"Spring Boot","fork":false,"url":"https://api.github.com/repos/spring-projects/spring-boot","forks_url":"https://api.github.com/repos/spring-projects/spring-boot/forks","keys_url":"https://api.github.com/repos/spring-projects/spring-boot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-projects/spring-boot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-projects/spring-boot/teams","hooks_url":"https://api.github.com/repos/spring-projects/spring-boot/hooks","issue_events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/events{/number}","events_url":"https://api.github.com/repos/spring-projects/spring-boot/events","assignees_url":"https://api.github.com/repos/spring-projects/spring-boot/assignees{/user}","branches_url":"https://api.github.com/repos/spring-projects/spring-boot/branches{/branch}","tags_url":"https://api.github.com/repos/spring-projects/spring-boot/tags","blobs_url":"https://api.github.com/repos/spring-projects/spring-boot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-projects/spring-boot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-projects/spring-boot/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-projects/spring-boot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-projects/spring-boot/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-projects/spring-boot/languages","stargazers_url":"https://api.github.com/repos/spring-projects/spring-boot/stargazers","contributors_url":"https://api.github.com/repos/spring-projects/spring-boot/contributors","subscribers_url":"https://api.github.com/repos/spring-projects/spring-boot/subscribers","subscription_url":"https://api.github.com/repos/spring-projects/spring-boot/subscription","commits_url":"https://api.github.com/repos/spring-projects/spring-boot/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-projects/spring-boot/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-projects/spring-boot/contents/{+path}","compare_url":"https://api.github.com/repos/spring-projects/spring-boot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-projects/spring-boot/merges","archive_url":"https://api.github.com/repos/spring-projects/spring-boot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-projects/spring-boot/downloads","issues_url":"https://api.github.com/repos/spring-projects/spring-boot/issues{/number}","pulls_url":"https://api.github.com/repos/spring-projects/spring-boot/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-projects/spring-boot/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-projects/spring-boot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/labels{/name}","releases_url":"https://api.github.com/repos/spring-projects/spring-boot/releases{/id}","deployments_url":"https://api.github.com/repos/spring-projects/spring-boot/deployments","created_at":"2012-10-19T15:02:57Z","updated_at":"2016-05-16T15:25:23Z","pushed_at":"2016-05-16T13:52:30Z","git_url":"git://github.com/spring-projects/spring-boot.git","ssh_url":"git@github.com:spring-projects/spring-boot.git","clone_url":"https://github.com/spring-projects/spring-boot.git","svn_url":"https://github.com/spring-projects/spring-boot","homepage":"http://projects.spring.io/spring-boot","size":47370,"stargazers_count":5518,"watchers_count":5518,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5435,"mirror_url":null,"open_issues_count":535,"forks":5435,"open_issues":535,"watchers":5518,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-boot/pulls/4965"},"html":{"href":"https://github.com/spring-projects/spring-boot/pull/4965"},"issue":{"href":"https://api.github.com/repos/spring-projects/spring-boot/issues/4965"},"comments":{"href":"https://api.github.com/repos/spring-projects/spring-boot/issues/4965/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-projects/spring-boot/pulls/4965/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-projects/spring-boot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-projects/spring-boot/pulls/4965/commits"},"statuses":{"href":"https://api.github.com/repos/spring-projects/spring-boot/statuses/c166a8a241ae968c4a3d343d3bff41447e860193"}}}}