{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/comments/36255506","id":36255506,"diff_hunk":"@@ -0,0 +1,68 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  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,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package brooklyn.config.external;\n+\n+import java.io.IOException;\n+import java.io.InputStream;\n+import java.net.URL;\n+import java.util.Map;\n+import java.util.Properties;\n+\n+import brooklyn.management.ManagementContext;\n+import brooklyn.util.stream.Streams;\n+\n+\n+/**\n+ * Instances are populated from a plain java properties file named in the passed <code>config</code> map\n+ * under the <code>propertiesUrl</code> key:\n+ *\n+ * <pre>\n+ * brooklyn.external.foo = brooklyn.management.config.external.PropertiesFileExternalConfigSupplier\n+ * brooklyn.external.foo.propertiesUrl = http://brooklyn.example.com/config/foo.properties\n+ * </pre>\n+ */\n+public class PropertiesFileExternalConfigSupplier extends AbstractExternalConfigSupplier {\n+\n+    public static final String PROPERTIES_URL = \"propertiesUrl\";\n+\n+    private final Properties properties;\n+\n+    public PropertiesFileExternalConfigSupplier(ManagementContext managementContext, String name, Map<?, ?> config) throws IOException {","path":"core/src/main/java/brooklyn/config/external/PropertiesFileExternalConfigSupplier.java","position":46,"original_position":46,"commit_id":"0a3b53dc32e4c7fd5e2747cd1350bf4b1e52b0bc","original_commit_id":"0a3b53dc32e4c7fd5e2747cd1350bf4b1e52b0bc","user":{"login":"aledsage","id":593113,"avatar_url":"https://avatars.githubusercontent.com/u/593113?v=3","gravatar_id":"","url":"https://api.github.com/users/aledsage","html_url":"https://github.com/aledsage","followers_url":"https://api.github.com/users/aledsage/followers","following_url":"https://api.github.com/users/aledsage/following{/other_user}","gists_url":"https://api.github.com/users/aledsage/gists{/gist_id}","starred_url":"https://api.github.com/users/aledsage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aledsage/subscriptions","organizations_url":"https://api.github.com/users/aledsage/orgs","repos_url":"https://api.github.com/users/aledsage/repos","events_url":"https://api.github.com/users/aledsage/events{/privacy}","received_events_url":"https://api.github.com/users/aledsage/received_events","type":"User","site_admin":false},"body":"Why take a `Map<?, ?> config` in the constructor, rather than passing the properties URL as an explicit parameter (very groovy'ish!)? Is there a special way you envisage this being used?","created_at":"2015-08-04T23:37:34Z","updated_at":"2015-08-04T23:37:34Z","html_url":"https://github.com/apache/incubator-brooklyn/pull/770#discussion_r36255506","pull_request_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/770","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/comments/36255506"},"html":{"href":"https://github.com/apache/incubator-brooklyn/pull/770#discussion_r36255506"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/770"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/770","id":40883771,"html_url":"https://github.com/apache/incubator-brooklyn/pull/770","diff_url":"https://github.com/apache/incubator-brooklyn/pull/770.diff","patch_url":"https://github.com/apache/incubator-brooklyn/pull/770.patch","issue_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues/770","number":770,"state":"open","locked":false,"title":"Externalised configuration","user":{"login":"alasdairhodge","id":837473,"avatar_url":"https://avatars.githubusercontent.com/u/837473?v=3","gravatar_id":"","url":"https://api.github.com/users/alasdairhodge","html_url":"https://github.com/alasdairhodge","followers_url":"https://api.github.com/users/alasdairhodge/followers","following_url":"https://api.github.com/users/alasdairhodge/following{/other_user}","gists_url":"https://api.github.com/users/alasdairhodge/gists{/gist_id}","starred_url":"https://api.github.com/users/alasdairhodge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alasdairhodge/subscriptions","organizations_url":"https://api.github.com/users/alasdairhodge/orgs","repos_url":"https://api.github.com/users/alasdairhodge/repos","events_url":"https://api.github.com/users/alasdairhodge/events{/privacy}","received_events_url":"https://api.github.com/users/alasdairhodge/received_events","type":"User","site_admin":false},"body":"**Bare-bones implementation** of a proposed scheme for YAML blueprints to delegate selected configuration values to runtime-injected suppliers.\r\n\r\n[Rationale, description and discussion in Google docs.](https://docs.google.com/document/d/1_cId6tVZ79ycmvn-DAmFBZDdtQxiHRm9sOilCfMigBc/edit#)","created_at":"2015-07-27T09:16:03Z","updated_at":"2015-08-04T23:37:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f66793fe7fc7d9f8c7b37f6f27a84ad6f6fb383d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/770/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/770/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues/770/comments","statuses_url":"https://api.github.com/repos/apache/incubator-brooklyn/statuses/0a3b53dc32e4c7fd5e2747cd1350bf4b1e52b0bc","head":{"label":"alasdairhodge:externalised-config","ref":"externalised-config","sha":"0a3b53dc32e4c7fd5e2747cd1350bf4b1e52b0bc","user":{"login":"alasdairhodge","id":837473,"avatar_url":"https://avatars.githubusercontent.com/u/837473?v=3","gravatar_id":"","url":"https://api.github.com/users/alasdairhodge","html_url":"https://github.com/alasdairhodge","followers_url":"https://api.github.com/users/alasdairhodge/followers","following_url":"https://api.github.com/users/alasdairhodge/following{/other_user}","gists_url":"https://api.github.com/users/alasdairhodge/gists{/gist_id}","starred_url":"https://api.github.com/users/alasdairhodge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alasdairhodge/subscriptions","organizations_url":"https://api.github.com/users/alasdairhodge/orgs","repos_url":"https://api.github.com/users/alasdairhodge/repos","events_url":"https://api.github.com/users/alasdairhodge/events{/privacy}","received_events_url":"https://api.github.com/users/alasdairhodge/received_events","type":"User","site_admin":false},"repo":{"id":21420915,"name":"incubator-brooklyn","full_name":"alasdairhodge/incubator-brooklyn","owner":{"login":"alasdairhodge","id":837473,"avatar_url":"https://avatars.githubusercontent.com/u/837473?v=3","gravatar_id":"","url":"https://api.github.com/users/alasdairhodge","html_url":"https://github.com/alasdairhodge","followers_url":"https://api.github.com/users/alasdairhodge/followers","following_url":"https://api.github.com/users/alasdairhodge/following{/other_user}","gists_url":"https://api.github.com/users/alasdairhodge/gists{/gist_id}","starred_url":"https://api.github.com/users/alasdairhodge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alasdairhodge/subscriptions","organizations_url":"https://api.github.com/users/alasdairhodge/orgs","repos_url":"https://api.github.com/users/alasdairhodge/repos","events_url":"https://api.github.com/users/alasdairhodge/events{/privacy}","received_events_url":"https://api.github.com/users/alasdairhodge/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alasdairhodge/incubator-brooklyn","description":"Mirror of Apache Brooklyn","fork":true,"url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn","forks_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/forks","keys_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/teams","hooks_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/hooks","issue_events_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/issues/events{/number}","events_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/events","assignees_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/assignees{/user}","branches_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/branches{/branch}","tags_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/tags","blobs_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/statuses/{sha}","languages_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/languages","stargazers_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/stargazers","contributors_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/contributors","subscribers_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/subscribers","subscription_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/subscription","commits_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/contents/{+path}","compare_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/merges","archive_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/downloads","issues_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/issues{/number}","pulls_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/pulls{/number}","milestones_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/milestones{/number}","notifications_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/labels{/name}","releases_url":"https://api.github.com/repos/alasdairhodge/incubator-brooklyn/releases{/id}","created_at":"2014-07-02T10:55:32Z","updated_at":"2015-05-08T15:20:11Z","pushed_at":"2015-07-31T08:26:33Z","git_url":"git://github.com/alasdairhodge/incubator-brooklyn.git","ssh_url":"git@github.com:alasdairhodge/incubator-brooklyn.git","clone_url":"https://github.com/alasdairhodge/incubator-brooklyn.git","svn_url":"https://github.com/alasdairhodge/incubator-brooklyn","homepage":null,"size":240261,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"3e11e3eaa643d70d310d2be8f1ef5b72f8c30227","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":19368221,"name":"incubator-brooklyn","full_name":"apache/incubator-brooklyn","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-brooklyn","description":"Mirror of Apache Brooklyn","fork":false,"url":"https://api.github.com/repos/apache/incubator-brooklyn","forks_url":"https://api.github.com/repos/apache/incubator-brooklyn/forks","keys_url":"https://api.github.com/repos/apache/incubator-brooklyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-brooklyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-brooklyn/teams","hooks_url":"https://api.github.com/repos/apache/incubator-brooklyn/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-brooklyn/events","assignees_url":"https://api.github.com/repos/apache/incubator-brooklyn/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-brooklyn/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-brooklyn/tags","blobs_url":"https://api.github.com/repos/apache/incubator-brooklyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-brooklyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-brooklyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-brooklyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-brooklyn/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-brooklyn/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-brooklyn/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-brooklyn/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-brooklyn/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-brooklyn/subscription","commits_url":"https://api.github.com/repos/apache/incubator-brooklyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-brooklyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-brooklyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-brooklyn/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-brooklyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-brooklyn/merges","archive_url":"https://api.github.com/repos/apache/incubator-brooklyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-brooklyn/downloads","issues_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-brooklyn/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-brooklyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-brooklyn/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-brooklyn/releases{/id}","created_at":"2014-05-02T07:00:07Z","updated_at":"2015-08-02T19:39:37Z","pushed_at":"2015-08-04T22:41:56Z","git_url":"git://github.com/apache/incubator-brooklyn.git","ssh_url":"git@github.com:apache/incubator-brooklyn.git","clone_url":"https://github.com/apache/incubator-brooklyn.git","svn_url":"https://github.com/apache/incubator-brooklyn","homepage":null,"size":251822,"stargazers_count":93,"watchers_count":93,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":79,"mirror_url":"git://git.apache.org/incubator-brooklyn.git","open_issues_count":8,"forks":79,"open_issues":8,"watchers":93,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/770"},"html":{"href":"https://github.com/apache/incubator-brooklyn/pull/770"},"issue":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/issues/770"},"comments":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/issues/770/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/770/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/770/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/statuses/0a3b53dc32e4c7fd5e2747cd1350bf4b1e52b0bc"}}}}