{"action":"created","comment":{"url":"https://api.github.com/repos/cdi-spec/cdi/pulls/comments/83866115","pull_request_review_id":4680623,"id":83866115,"diff_hunk":"@@ -1580,3 +1594,35 @@ CDI 2.0 introduced the following Configurators interface:\n * <<observer_method_configurator>> for `ObserverMethod` configuration\n \n The container must provide implementation for all these configurators and make them available in matching container lifecycle events as defined in <<init_events>>.\n+\n+[[interception_proxy_factory]]\n+\n+=== Apply interceptor and decorators programmatically\n+\n+Contextual instances of bean having interceptors binding or defined decorators are provided by the container as a proxy.\n+\n+When a bean is defined by a producer method or has a custom bean type, the container doesn't provide this proxy for interceptor or decorator.\n+\n+To allow creation of these proxies programmatically, CDI 2.0 introduces the `javax.enterprise.inject.spi.InterceptionProxyFactory<T>` interface where T is the type of instance to create the proxy for.\n+\n+[source, java]\n+----\n+public interface InterceptionProxyFactory<T> {\n+    InterceptionProxyFactory<T> ignoreFinalMethods();\n+    AnnotatedTypeConfigurator<T> configure();\n+    <U extends T> U createInterceptionProxy(T instance);\n+}\n+----\n+\n+* `ignoreFinalMethods()` forces the creation of the proxy even if the type T contains public final methods.\n+This method will bypass rules defined in <<unproxyable>>\n+Final methods on T won't be available on the produced proxy.\n+* `configure()` returns an `AnnotatedTypeConfigurator` (as defined in <<annotated_type_configurator>>) initialized with the instance type to easily apply specific interceptor binding to apply when creating the proxy.\n+The method always return the same `AnnotatedTypeConfigurator`\n+* `createInterceptionProxy()` returns the proxy adding interceptors and decorators on the provided instance.\n+The method can be only called once, subsequent calls will throw an exception.\n+\n+An `InterceptionProxyFactory` can be obtain be calling `BeanManager.createInterceptionFactory` as defined in <<bm_obtain_interception_proxy_factory>>\n+\n+The container must also provide an instance of `InterceptionProxyFactory` for every producer methods injecting this interface.","path":"spec/src/main/asciidoc/core/spi.asciidoc","position":64,"original_position":64,"commit_id":"6d8dd630e149db60a37f4c92e4e3e53363a8c218","original_commit_id":"6d8dd630e149db60a37f4c92e4e3e53363a8c218","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":"Must provide a built-in bean with bean type `javax.enterprise.inject.spi.InterceptionProxyFactory`, qualifier `@Default` and _\"injectable only in a producer method parameter\"_ (needs rewording).","created_at":"2016-10-18T14:27:34Z","updated_at":"2016-10-18T14:27:34Z","html_url":"https://github.com/cdi-spec/cdi/pull/315#discussion_r83866115","pull_request_url":"https://api.github.com/repos/cdi-spec/cdi/pulls/315","_links":{"self":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/comments/83866115"},"html":{"href":"https://github.com/cdi-spec/cdi/pull/315#discussion_r83866115"},"pull_request":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/315"}}},"pull_request":{"url":"https://api.github.com/repos/cdi-spec/cdi/pulls/315","id":89600456,"html_url":"https://github.com/cdi-spec/cdi/pull/315","diff_url":"https://github.com/cdi-spec/cdi/pull/315.diff","patch_url":"https://github.com/cdi-spec/cdi/pull/315.patch","issue_url":"https://api.github.com/repos/cdi-spec/cdi/issues/315","number":315,"state":"open","locked":false,"title":"CDI-580 Allow interceptors and decorators to be applied to the return value of a producer","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":"CDI-580 Allow interceptors and decorators to be applied to the return value of a producer method\nAlso works for custom beans create()","created_at":"2016-10-17T10:49:51Z","updated_at":"2016-10-18T14:27:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c0a09920518c5bfd17bbf62f35fdd67a14fe444","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cdi-spec/cdi/pulls/315/commits","review_comments_url":"https://api.github.com/repos/cdi-spec/cdi/pulls/315/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/315/comments","statuses_url":"https://api.github.com/repos/cdi-spec/cdi/statuses/6d8dd630e149db60a37f4c92e4e3e53363a8c218","head":{"label":"antoinesd:CDI-580","ref":"CDI-580","sha":"6d8dd630e149db60a37f4c92e4e3e53363a8c218","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-10-17T12:29:45Z","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":7670,"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:master","ref":"master","sha":"bfdad8a8dfa620557366cfd17e201e6d12f5b87b","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-10-17T20:24:40Z","pushed_at":"2016-10-17T12:51:41Z","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":8478,"stargazers_count":83,"watchers_count":83,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":15,"forks":34,"open_issues":15,"watchers":83,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/315"},"html":{"href":"https://github.com/cdi-spec/cdi/pull/315"},"issue":{"href":"https://api.github.com/repos/cdi-spec/cdi/issues/315"},"comments":{"href":"https://api.github.com/repos/cdi-spec/cdi/issues/315/comments"},"review_comments":{"href":"https://api.github.com/repos/cdi-spec/cdi/pulls/315/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/315/commits"},"statuses":{"href":"https://api.github.com/repos/cdi-spec/cdi/statuses/6d8dd630e149db60a37f4c92e4e3e53363a8c218"}}}}
{"actor":{"display_login":"mkouba"}}