{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/comments/35763873","id":35763873,"diff_hunk":"@@ -0,0 +1,47 @@\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.plan;\n+\n+import java.util.Collection;\n+import java.util.ServiceLoader;\n+\n+import com.google.common.collect.Lists;\n+\n+import brooklyn.management.ManagementContext;\n+\n+public class PlanToSpecFactory {\n+    public static PlanToSpecTransformer forMime(ManagementContext mgmt, String mime) {\n+        ServiceLoader<PlanToSpecTransformer> loader = ServiceLoader.load(PlanToSpecTransformer.class);\n+        for (PlanToSpecTransformer transformer : loader) {\n+            transformer.injectManagementContext(mgmt);\n+            if (transformer.accepts(mime)) {\n+                return transformer;\n+            }\n+        }\n+        return null;","path":"core/src/main/java/brooklyn/plan/PlanToSpecFactory.java","position":37,"original_position":37,"commit_id":"d0b8e92661e19495231f320f5f4add40e5b509cc","original_commit_id":"d0b8e92661e19495231f320f5f4add40e5b509cc","user":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"body":"I was wondering if I should add this method at all, currently not used. Makes sense to throw if a specific implementation is not found, will change it.","created_at":"2015-07-29T14:22:38Z","updated_at":"2015-07-29T14:22:38Z","html_url":"https://github.com/apache/incubator-brooklyn/pull/760#discussion_r35763873","pull_request_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/760","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/comments/35763873"},"html":{"href":"https://github.com/apache/incubator-brooklyn/pull/760#discussion_r35763873"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/760"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/760","id":40463233,"html_url":"https://github.com/apache/incubator-brooklyn/pull/760","diff_url":"https://github.com/apache/incubator-brooklyn/pull/760.diff","patch_url":"https://github.com/apache/incubator-brooklyn/pull/760.patch","issue_url":"https://api.github.com/repos/apache/incubator-brooklyn/issues/760","number":760,"state":"open","locked":false,"title":"Pluggable YAML parsers","user":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"body":"* Changes brooklyn-core not to depend on camp-base. Instead plugins (in this case offered by brooklyn-camp) are responsible for parsing the input and creating EntitySpecs from it. The idea is to use the approach for different types of inputs, not just camp yaml, while avoiding pulling in dependencies into core.\r\n* Extract all the code that uses PdpMatcher.parseDeploymentPlan + AssemblyTemplateSpecInstantiator.createSpec/instantiate pairs in a common place - a lot of code repetition\r\n\r\nSupersedes #100, #436, #545, #689.","created_at":"2015-07-21T14:29:15Z","updated_at":"2015-07-29T14:22:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fced419666ed94c0f404bbfd4f8d353cdc62adad","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/760/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/760/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/760/comments","statuses_url":"https://api.github.com/repos/apache/incubator-brooklyn/statuses/d0b8e92661e19495231f320f5f4add40e5b509cc","head":{"label":"neykov:refactor-camp-dependencies-3","ref":"refactor-camp-dependencies-3","sha":"d0b8e92661e19495231f320f5f4add40e5b509cc","user":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"repo":{"id":21119097,"name":"incubator-brooklyn","full_name":"neykov/incubator-brooklyn","owner":{"login":"neykov","id":3612111,"avatar_url":"https://avatars.githubusercontent.com/u/3612111?v=3","gravatar_id":"","url":"https://api.github.com/users/neykov","html_url":"https://github.com/neykov","followers_url":"https://api.github.com/users/neykov/followers","following_url":"https://api.github.com/users/neykov/following{/other_user}","gists_url":"https://api.github.com/users/neykov/gists{/gist_id}","starred_url":"https://api.github.com/users/neykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neykov/subscriptions","organizations_url":"https://api.github.com/users/neykov/orgs","repos_url":"https://api.github.com/users/neykov/repos","events_url":"https://api.github.com/users/neykov/events{/privacy}","received_events_url":"https://api.github.com/users/neykov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/neykov/incubator-brooklyn","description":"Mirror of Apache Brooklyn","fork":true,"url":"https://api.github.com/repos/neykov/incubator-brooklyn","forks_url":"https://api.github.com/repos/neykov/incubator-brooklyn/forks","keys_url":"https://api.github.com/repos/neykov/incubator-brooklyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neykov/incubator-brooklyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neykov/incubator-brooklyn/teams","hooks_url":"https://api.github.com/repos/neykov/incubator-brooklyn/hooks","issue_events_url":"https://api.github.com/repos/neykov/incubator-brooklyn/issues/events{/number}","events_url":"https://api.github.com/repos/neykov/incubator-brooklyn/events","assignees_url":"https://api.github.com/repos/neykov/incubator-brooklyn/assignees{/user}","branches_url":"https://api.github.com/repos/neykov/incubator-brooklyn/branches{/branch}","tags_url":"https://api.github.com/repos/neykov/incubator-brooklyn/tags","blobs_url":"https://api.github.com/repos/neykov/incubator-brooklyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neykov/incubator-brooklyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neykov/incubator-brooklyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/neykov/incubator-brooklyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neykov/incubator-brooklyn/statuses/{sha}","languages_url":"https://api.github.com/repos/neykov/incubator-brooklyn/languages","stargazers_url":"https://api.github.com/repos/neykov/incubator-brooklyn/stargazers","contributors_url":"https://api.github.com/repos/neykov/incubator-brooklyn/contributors","subscribers_url":"https://api.github.com/repos/neykov/incubator-brooklyn/subscribers","subscription_url":"https://api.github.com/repos/neykov/incubator-brooklyn/subscription","commits_url":"https://api.github.com/repos/neykov/incubator-brooklyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/neykov/incubator-brooklyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/neykov/incubator-brooklyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/neykov/incubator-brooklyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/neykov/incubator-brooklyn/contents/{+path}","compare_url":"https://api.github.com/repos/neykov/incubator-brooklyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neykov/incubator-brooklyn/merges","archive_url":"https://api.github.com/repos/neykov/incubator-brooklyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neykov/incubator-brooklyn/downloads","issues_url":"https://api.github.com/repos/neykov/incubator-brooklyn/issues{/number}","pulls_url":"https://api.github.com/repos/neykov/incubator-brooklyn/pulls{/number}","milestones_url":"https://api.github.com/repos/neykov/incubator-brooklyn/milestones{/number}","notifications_url":"https://api.github.com/repos/neykov/incubator-brooklyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neykov/incubator-brooklyn/labels{/name}","releases_url":"https://api.github.com/repos/neykov/incubator-brooklyn/releases{/id}","created_at":"2014-06-23T08:28:52Z","updated_at":"2014-07-10T06:45:07Z","pushed_at":"2015-07-29T14:04:31Z","git_url":"git://github.com/neykov/incubator-brooklyn.git","ssh_url":"git@github.com:neykov/incubator-brooklyn.git","clone_url":"https://github.com/neykov/incubator-brooklyn.git","svn_url":"https://github.com/neykov/incubator-brooklyn","homepage":null,"size":241289,"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":"c2e55c0f0ab9eb5818fc25a0a75457579554353f","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-07-28T09:07:12Z","pushed_at":"2015-07-29T14:04:32Z","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":250958,"stargazers_count":92,"watchers_count":92,"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":12,"forks":79,"open_issues":12,"watchers":92,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/760"},"html":{"href":"https://github.com/apache/incubator-brooklyn/pull/760"},"issue":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/issues/760"},"comments":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/issues/760/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/pulls/760/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/760/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-brooklyn/statuses/d0b8e92661e19495231f320f5f4add40e5b509cc"}}}}