{"action":"created","comment":{"url":"https://api.github.com/repos/cdi-spec/cdi/pulls/comments/58871630","id":58871630,"diff_hunk":"@@ -0,0 +1,181 @@\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.spi.builder;\n+\n+import javax.enterprise.event.Reception;\n+import javax.enterprise.event.TransactionPhase;\n+import javax.enterprise.inject.Default;\n+import javax.enterprise.inject.spi.AfterBeanDiscovery;\n+import javax.enterprise.inject.spi.AnnotatedMethod;\n+import javax.enterprise.inject.spi.EventMetadata;\n+import javax.enterprise.inject.spi.ObserverMethod;\n+import java.lang.annotation.Annotation;\n+import java.lang.reflect.Method;\n+import java.lang.reflect.Type;\n+import java.util.Set;\n+import java.util.function.BiConsumer;\n+import java.util.function.Consumer;\n+\n+/**\n+ * This API is an helper to build a new {@link ObserverMethod} instance.\n+ * CDI container must provides an implementation of this interface accessible.\n+ *\n+ * This configurator is not thread safe and shall not be used concurrently.\n+ *\n+ * @param <T> type of the event the configured ObserverMethod will observe\n+ * @author Antoine Sabot-Durand\n+ * @see AfterBeanDiscovery#addObserverMethod()\n+ * @since 2.0\n+ */\n+public interface ObserverMethodConfigurator<T> {\n+\n+\n+    /**\n+     * Read observer meta data from a existing {@link java.lang.reflect.Method}\n+     *\n+     * @param method to read meta data from\n+     * @return self\n+     */\n+    ObserverMethodConfigurator<T> read(Method method);\n+\n+    /**\n+     * Read observer meta data from a existing {@link AnnotatedMethod}\n+     *\n+     * @param method to read meta data from\n+     * @return self\n+     */\n+    ObserverMethodConfigurator<T> read(AnnotatedMethod<?> method);\n+\n+    /**\n+     * Read observer meta data from a existing ObserverMethod\n+     *\n+     * @param method to read meta data from\n+     * @return self\n+     */\n+    ObserverMethodConfigurator<T> read(ObserverMethod<T> method);\n+\n+    /**\n+     * Set the class of the Bean containing this observer.\n+     * If not set, the extension class is used.\n+     *\n+     * @param type the bean class containing this configurator.\n+     * @return self\n+     */\n+    ObserverMethodConfigurator<T> beanClass(Class<?> type);","path":"api/src/main/java/javax/enterprise/inject/spi/builder/ObserverMethodConfigurator.java","position":79,"original_position":79,"commit_id":"a65ef4feed9092870618aa25321a00238d8c09d6","original_commit_id":"a65ef4feed9092870618aa25321a00238d8c09d6","user":{"login":"mkouba","id":913004,"avatar_url":"https://avatars.githubusercontent.com/u/913004?v=3","gravatar_id":"","url":"https://api.github.com/users/mkouba","html_url":"https://github.com/mkouba","followers_url":"https://api.github.com/users/mkouba/followers","following_url":"https://api.github.com/users/mkouba/following{/other_user}","gists_url":"https://api.github.com/users/mkouba/gists{/gist_id}","starred_url":"https://api.github.com/users/mkouba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkouba/subscriptions","organizations_url":"https://api.github.com/users/mkouba/orgs","repos_url":"https://api.github.com/users/mkouba/repos","events_url":"https://api.github.com/users/mkouba/events{/privacy}","received_events_url":"https://api.github.com/users/mkouba/received_events","type":"User","site_admin":false},"body":"The point is we should allow this for `AfterBeanDiscovery.addObserverMethod()` or say that `ObserverMethod.getBeanClass()` will return the extension class for this case or something like that...","created_at":"2016-04-07T13:37:24Z","updated_at":"2016-04-07T13:37:24Z","html_url":"https://github.com/cdi-spec/cdi/pull/287#discussion_r58871630","pull_request_url":"https://api.github.com/repos/cdi-spec/cdi/pulls/287","_links":{"self":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/comments/58871630"},"html":{"href":"https://github.com/cdi-spec/cdi/pull/287#discussion_r58871630"},"pull_request":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/287"}}},"pull_request":{"url":"https://api.github.com/repos/cdi-spec/cdi/pulls/287","id":65157238,"html_url":"https://github.com/cdi-spec/cdi/pull/287","diff_url":"https://github.com/cdi-spec/cdi/pull/287.diff","patch_url":"https://github.com/cdi-spec/cdi/pull/287.patch","issue_url":"https://api.github.com/repos/cdi-spec/cdi/issues/287","number":287,"state":"open","locked":false,"title":"CDI-558 Standardize the Meta-Data builders API (BeanBuilder, etc...)","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":"New PR for Configurators and Builders API","created_at":"2016-04-04T14:46:57Z","updated_at":"2016-04-07T13:37:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d49c987192fe6203d56e7f524d43421d0212210","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cdi-spec/cdi/pulls/287/commits","review_comments_url":"https://api.github.com/repos/cdi-spec/cdi/pulls/287/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/287/comments","statuses_url":"https://api.github.com/repos/cdi-spec/cdi/statuses/a65ef4feed9092870618aa25321a00238d8c09d6","head":{"label":"antoinesd:CDI-558","ref":"CDI-558","sha":"a65ef4feed9092870618aa25321a00238d8c09d6","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-04-05T06:40:26Z","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":7576,"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":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"cdi-spec:2.0-EDR2","ref":"2.0-EDR2","sha":"7aac645991f94b9039db81360061996151149c70","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-04T14:29:27Z","pushed_at":"2016-04-05T06:40:27Z","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":8234,"stargazers_count":47,"watchers_count":47,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":9,"forks":32,"open_issues":9,"watchers":47,"default_branch":"2.0-EDR2"}},"_links":{"self":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/287"},"html":{"href":"https://github.com/cdi-spec/cdi/pull/287"},"issue":{"href":"https://api.github.com/repos/cdi-spec/cdi/issues/287"},"comments":{"href":"https://api.github.com/repos/cdi-spec/cdi/issues/287/comments"},"review_comments":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/287/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/287/commits"},"statuses":{"href":"https://api.github.com/repos/cdi-spec/cdi/statuses/a65ef4feed9092870618aa25321a00238d8c09d6"}}}}