{"action":"created","comment":{"url":"https://api.github.com/repos/cdi-spec/cdi/pulls/comments/68380618","id":68380618,"diff_hunk":"@@ -0,0 +1,316 @@\n+/*\n+ * JBoss, Home of Professional Open Source\n+ * Copyright 2016, Red Hat, Inc., and individual contributors\n+ * by the @authors tag. See the copyright.txt in the distribution for a\n+ * full listing of individual contributors.\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+ * http://www.apache.org/licenses/LICENSE-2.0\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 javax.enterprise.inject.bootstrap;\n+\n+import javax.enterprise.inject.spi.AnnotatedType;\n+import javax.enterprise.inject.spi.Bean;\n+import javax.enterprise.inject.spi.Extension;\n+import java.lang.annotation.Annotation;\n+import java.util.Map;\n+import java.util.ServiceConfigurationError;\n+import java.util.ServiceLoader;\n+\n+/**\n+ * Container initializer to bootstrap CDI in Java SE.\n+ * It is obtained by calling the {@link UserContainerInitializer#getInstance()} static method\n+ * <p>\n+ * <p>\n+ * Typical usage looks like this:\n+ * </p>\n+ * <p>\n+ * <pre>\n+ * UserContainer<Object> container = UserContainerInitializer.getInstance().initialize();\n+ * container.select(Foo.class).get();\n+ * container.event().select(Bar.class).fire(new Bar());\n+ * container.shutdown();\n+ * </pre>\n+ * <p>\n+ * <p>\n+ * The {@link UserContainer} interface implements AutoCloseable:\n+ * </p>\n+ * <p>\n+ * <pre>\n+ * try (UserContainer<Object> container = UserContainerInitializer.getInstance().initialize()) {\n+ *     container.select(Foo.class).get();\n+ * }\n+ * </pre>\n+ * <p>\n+ * <p>\n+ * By default, the discovery is enabled so that all beans from all discovered bean archives are considered. However, it's possible to define a \"synthetic\" bean\n+ * archive, or the set of bean classes and enablement respectively:\n+ * </p>\n+ * <p>\n+ * <pre>\n+ * UserContainer<Object> container = UserContainerInitializer.getInstance().beanClasses(Foo.class, Bar.class).alternatives(Bar.class).initialize());\n+ * </pre>\n+ * <p>\n+ * <p>\n+ * Moreover, it's also possible to disable the discovery completely so that only the \"synthetic\" bean archive is considered:\n+ * </p>\n+ * <p>\n+ * <pre>\n+ * UserContainer<Object> container = UserContainerInitializer.getInstance().disableDiscovery().beanClasses(Foo.class, Bar.class).initialize());\n+ * </pre>\n+ * <p>\n+ * <p>\n+ * <p>\n+ * In the same manner, it is possible to explicitly declare interceptors, decorators, extensions and implementation specific options using the builder.\n+ * </p>\n+ * <p>\n+ * <pre>\n+ * UserContainerInitializer container = UserContainerInitializer.getInstance()\n+ *    .disableDiscovery()\n+ *    .packages(Main.class, Utils.class)","path":"api/src/main/java/javax/enterprise/inject/bootstrap/UserContainerInitializer.java","position":78,"original_position":78,"commit_id":"703db86a6392cc15e64b3cd07a949ef935ebadcd","original_commit_id":"703db86a6392cc15e64b3cd07a949ef935ebadcd","user":{"login":"Emily-Jiang","id":10999780,"avatar_url":"https://avatars.githubusercontent.com/u/10999780?v=3","gravatar_id":"","url":"https://api.github.com/users/Emily-Jiang","html_url":"https://github.com/Emily-Jiang","followers_url":"https://api.github.com/users/Emily-Jiang/followers","following_url":"https://api.github.com/users/Emily-Jiang/following{/other_user}","gists_url":"https://api.github.com/users/Emily-Jiang/gists{/gist_id}","starred_url":"https://api.github.com/users/Emily-Jiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Emily-Jiang/subscriptions","organizations_url":"https://api.github.com/users/Emily-Jiang/orgs","repos_url":"https://api.github.com/users/Emily-Jiang/repos","events_url":"https://api.github.com/users/Emily-Jiang/events{/privacy}","received_events_url":"https://api.github.com/users/Emily-Jiang/received_events","type":"User","site_admin":false},"body":"should be .addPackages","created_at":"2016-06-24T10:28:19Z","updated_at":"2016-06-24T10:28:19Z","html_url":"https://github.com/cdi-spec/cdi/pull/290#discussion_r68380618","pull_request_url":"https://api.github.com/repos/cdi-spec/cdi/pulls/290","_links":{"self":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/comments/68380618"},"html":{"href":"https://github.com/cdi-spec/cdi/pull/290#discussion_r68380618"},"pull_request":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/290"}}},"pull_request":{"url":"https://api.github.com/repos/cdi-spec/cdi/pulls/290","id":70002752,"html_url":"https://github.com/cdi-spec/cdi/pull/290","diff_url":"https://github.com/cdi-spec/cdi/pull/290.diff","patch_url":"https://github.com/cdi-spec/cdi/pull/290.patch","issue_url":"https://api.github.com/repos/cdi-spec/cdi/issues/290","number":290,"state":"open","locked":false,"title":"CDI-568  enhancing Java SE bootstrap API","user":{"login":"antoinesd","id":489817,"avatar_url":"https://avatars.githubusercontent.com/u/489817?v=3","gravatar_id":"","url":"https://api.github.com/users/antoinesd","html_url":"https://github.com/antoinesd","followers_url":"https://api.github.com/users/antoinesd/followers","following_url":"https://api.github.com/users/antoinesd/following{/other_user}","gists_url":"https://api.github.com/users/antoinesd/gists{/gist_id}","starred_url":"https://api.github.com/users/antoinesd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoinesd/subscriptions","organizations_url":"https://api.github.com/users/antoinesd/orgs","repos_url":"https://api.github.com/users/antoinesd/repos","events_url":"https://api.github.com/users/antoinesd/events{/privacy}","received_events_url":"https://api.github.com/users/antoinesd/received_events","type":"User","site_admin":false},"body":"Enhancing the Java SE bootstrap API.","created_at":"2016-05-13T14:17:44Z","updated_at":"2016-06-24T10:28:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2687a8db64a10b434e1616a78b6a75534b7b3542","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cdi-spec/cdi/pulls/290/commits","review_comments_url":"https://api.github.com/repos/cdi-spec/cdi/pulls/290/comments","review_comment_url":"https://api.github.com/repos/cdi-spec/cdi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cdi-spec/cdi/issues/290/comments","statuses_url":"https://api.github.com/repos/cdi-spec/cdi/statuses/703db86a6392cc15e64b3cd07a949ef935ebadcd","head":{"label":"antoinesd:CDI-568","ref":"CDI-568","sha":"703db86a6392cc15e64b3cd07a949ef935ebadcd","user":{"login":"antoinesd","id":489817,"avatar_url":"https://avatars.githubusercontent.com/u/489817?v=3","gravatar_id":"","url":"https://api.github.com/users/antoinesd","html_url":"https://github.com/antoinesd","followers_url":"https://api.github.com/users/antoinesd/followers","following_url":"https://api.github.com/users/antoinesd/following{/other_user}","gists_url":"https://api.github.com/users/antoinesd/gists{/gist_id}","starred_url":"https://api.github.com/users/antoinesd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoinesd/subscriptions","organizations_url":"https://api.github.com/users/antoinesd/orgs","repos_url":"https://api.github.com/users/antoinesd/repos","events_url":"https://api.github.com/users/antoinesd/events{/privacy}","received_events_url":"https://api.github.com/users/antoinesd/received_events","type":"User","site_admin":false},"repo":{"id":16379835,"name":"cdi-spec","full_name":"antoinesd/cdi-spec","owner":{"login":"antoinesd","id":489817,"avatar_url":"https://avatars.githubusercontent.com/u/489817?v=3","gravatar_id":"","url":"https://api.github.com/users/antoinesd","html_url":"https://github.com/antoinesd","followers_url":"https://api.github.com/users/antoinesd/followers","following_url":"https://api.github.com/users/antoinesd/following{/other_user}","gists_url":"https://api.github.com/users/antoinesd/gists{/gist_id}","starred_url":"https://api.github.com/users/antoinesd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoinesd/subscriptions","organizations_url":"https://api.github.com/users/antoinesd/orgs","repos_url":"https://api.github.com/users/antoinesd/repos","events_url":"https://api.github.com/users/antoinesd/events{/privacy}","received_events_url":"https://api.github.com/users/antoinesd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/antoinesd/cdi-spec","description":"CDI specification","fork":true,"url":"https://api.github.com/repos/antoinesd/cdi-spec","forks_url":"https://api.github.com/repos/antoinesd/cdi-spec/forks","keys_url":"https://api.github.com/repos/antoinesd/cdi-spec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/antoinesd/cdi-spec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/antoinesd/cdi-spec/teams","hooks_url":"https://api.github.com/repos/antoinesd/cdi-spec/hooks","issue_events_url":"https://api.github.com/repos/antoinesd/cdi-spec/issues/events{/number}","events_url":"https://api.github.com/repos/antoinesd/cdi-spec/events","assignees_url":"https://api.github.com/repos/antoinesd/cdi-spec/assignees{/user}","branches_url":"https://api.github.com/repos/antoinesd/cdi-spec/branches{/branch}","tags_url":"https://api.github.com/repos/antoinesd/cdi-spec/tags","blobs_url":"https://api.github.com/repos/antoinesd/cdi-spec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/antoinesd/cdi-spec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/antoinesd/cdi-spec/git/refs{/sha}","trees_url":"https://api.github.com/repos/antoinesd/cdi-spec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/antoinesd/cdi-spec/statuses/{sha}","languages_url":"https://api.github.com/repos/antoinesd/cdi-spec/languages","stargazers_url":"https://api.github.com/repos/antoinesd/cdi-spec/stargazers","contributors_url":"https://api.github.com/repos/antoinesd/cdi-spec/contributors","subscribers_url":"https://api.github.com/repos/antoinesd/cdi-spec/subscribers","subscription_url":"https://api.github.com/repos/antoinesd/cdi-spec/subscription","commits_url":"https://api.github.com/repos/antoinesd/cdi-spec/commits{/sha}","git_commits_url":"https://api.github.com/repos/antoinesd/cdi-spec/git/commits{/sha}","comments_url":"https://api.github.com/repos/antoinesd/cdi-spec/comments{/number}","issue_comment_url":"https://api.github.com/repos/antoinesd/cdi-spec/issues/comments{/number}","contents_url":"https://api.github.com/repos/antoinesd/cdi-spec/contents/{+path}","compare_url":"https://api.github.com/repos/antoinesd/cdi-spec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/antoinesd/cdi-spec/merges","archive_url":"https://api.github.com/repos/antoinesd/cdi-spec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/antoinesd/cdi-spec/downloads","issues_url":"https://api.github.com/repos/antoinesd/cdi-spec/issues{/number}","pulls_url":"https://api.github.com/repos/antoinesd/cdi-spec/pulls{/number}","milestones_url":"https://api.github.com/repos/antoinesd/cdi-spec/milestones{/number}","notifications_url":"https://api.github.com/repos/antoinesd/cdi-spec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/antoinesd/cdi-spec/labels{/name}","releases_url":"https://api.github.com/repos/antoinesd/cdi-spec/releases{/id}","deployments_url":"https://api.github.com/repos/antoinesd/cdi-spec/deployments","created_at":"2014-01-30T14:43:02Z","updated_at":"2015-04-30T15:02:23Z","pushed_at":"2016-06-23T12:15:12Z","git_url":"git://github.com/antoinesd/cdi-spec.git","ssh_url":"git@github.com:antoinesd/cdi-spec.git","clone_url":"https://github.com/antoinesd/cdi-spec.git","svn_url":"https://github.com/antoinesd/cdi-spec","homepage":"","size":7615,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"cdi-spec:2.0-EDR2","ref":"2.0-EDR2","sha":"d6e76052b3a0b9f50a200b41224046edb0bfdffa","user":{"login":"cdi-spec","id":2632663,"avatar_url":"https://avatars.githubusercontent.com/u/2632663?v=3","gravatar_id":"","url":"https://api.github.com/users/cdi-spec","html_url":"https://github.com/cdi-spec","followers_url":"https://api.github.com/users/cdi-spec/followers","following_url":"https://api.github.com/users/cdi-spec/following{/other_user}","gists_url":"https://api.github.com/users/cdi-spec/gists{/gist_id}","starred_url":"https://api.github.com/users/cdi-spec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdi-spec/subscriptions","organizations_url":"https://api.github.com/users/cdi-spec/orgs","repos_url":"https://api.github.com/users/cdi-spec/repos","events_url":"https://api.github.com/users/cdi-spec/events{/privacy}","received_events_url":"https://api.github.com/users/cdi-spec/received_events","type":"Organization","site_admin":false},"repo":{"id":1756541,"name":"cdi","full_name":"cdi-spec/cdi","owner":{"login":"cdi-spec","id":2632663,"avatar_url":"https://avatars.githubusercontent.com/u/2632663?v=3","gravatar_id":"","url":"https://api.github.com/users/cdi-spec","html_url":"https://github.com/cdi-spec","followers_url":"https://api.github.com/users/cdi-spec/followers","following_url":"https://api.github.com/users/cdi-spec/following{/other_user}","gists_url":"https://api.github.com/users/cdi-spec/gists{/gist_id}","starred_url":"https://api.github.com/users/cdi-spec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdi-spec/subscriptions","organizations_url":"https://api.github.com/users/cdi-spec/orgs","repos_url":"https://api.github.com/users/cdi-spec/repos","events_url":"https://api.github.com/users/cdi-spec/events{/privacy}","received_events_url":"https://api.github.com/users/cdi-spec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cdi-spec/cdi","description":"CDI specification","fork":false,"url":"https://api.github.com/repos/cdi-spec/cdi","forks_url":"https://api.github.com/repos/cdi-spec/cdi/forks","keys_url":"https://api.github.com/repos/cdi-spec/cdi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cdi-spec/cdi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cdi-spec/cdi/teams","hooks_url":"https://api.github.com/repos/cdi-spec/cdi/hooks","issue_events_url":"https://api.github.com/repos/cdi-spec/cdi/issues/events{/number}","events_url":"https://api.github.com/repos/cdi-spec/cdi/events","assignees_url":"https://api.github.com/repos/cdi-spec/cdi/assignees{/user}","branches_url":"https://api.github.com/repos/cdi-spec/cdi/branches{/branch}","tags_url":"https://api.github.com/repos/cdi-spec/cdi/tags","blobs_url":"https://api.github.com/repos/cdi-spec/cdi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cdi-spec/cdi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cdi-spec/cdi/git/refs{/sha}","trees_url":"https://api.github.com/repos/cdi-spec/cdi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cdi-spec/cdi/statuses/{sha}","languages_url":"https://api.github.com/repos/cdi-spec/cdi/languages","stargazers_url":"https://api.github.com/repos/cdi-spec/cdi/stargazers","contributors_url":"https://api.github.com/repos/cdi-spec/cdi/contributors","subscribers_url":"https://api.github.com/repos/cdi-spec/cdi/subscribers","subscription_url":"https://api.github.com/repos/cdi-spec/cdi/subscription","commits_url":"https://api.github.com/repos/cdi-spec/cdi/commits{/sha}","git_commits_url":"https://api.github.com/repos/cdi-spec/cdi/git/commits{/sha}","comments_url":"https://api.github.com/repos/cdi-spec/cdi/comments{/number}","issue_comment_url":"https://api.github.com/repos/cdi-spec/cdi/issues/comments{/number}","contents_url":"https://api.github.com/repos/cdi-spec/cdi/contents/{+path}","compare_url":"https://api.github.com/repos/cdi-spec/cdi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cdi-spec/cdi/merges","archive_url":"https://api.github.com/repos/cdi-spec/cdi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cdi-spec/cdi/downloads","issues_url":"https://api.github.com/repos/cdi-spec/cdi/issues{/number}","pulls_url":"https://api.github.com/repos/cdi-spec/cdi/pulls{/number}","milestones_url":"https://api.github.com/repos/cdi-spec/cdi/milestones{/number}","notifications_url":"https://api.github.com/repos/cdi-spec/cdi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cdi-spec/cdi/labels{/name}","releases_url":"https://api.github.com/repos/cdi-spec/cdi/releases{/id}","deployments_url":"https://api.github.com/repos/cdi-spec/cdi/deployments","created_at":"2011-05-16T17:27:06Z","updated_at":"2016-04-19T06:35:28Z","pushed_at":"2016-06-23T23:28:01Z","git_url":"git://github.com/cdi-spec/cdi.git","ssh_url":"git@github.com:cdi-spec/cdi.git","clone_url":"https://github.com/cdi-spec/cdi.git","svn_url":"https://github.com/cdi-spec/cdi","homepage":"","size":8286,"stargazers_count":48,"watchers_count":48,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":33,"mirror_url":null,"open_issues_count":8,"forks":33,"open_issues":8,"watchers":48,"default_branch":"2.0-EDR2"}},"_links":{"self":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/290"},"html":{"href":"https://github.com/cdi-spec/cdi/pull/290"},"issue":{"href":"https://api.github.com/repos/cdi-spec/cdi/issues/290"},"comments":{"href":"https://api.github.com/repos/cdi-spec/cdi/issues/290/comments"},"review_comments":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/290/comments"},"review_comment":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/290/commits"},"statuses":{"href":"https://api.github.com/repos/cdi-spec/cdi/statuses/703db86a6392cc15e64b3cd07a949ef935ebadcd"}}}}
{"actor":{"display_login":"Emily-Jiang"}}