Skip to content

Commit

Permalink
WELD-2117 document new activation interceptor.
Browse files Browse the repository at this point in the history
  • Loading branch information
tremes authored and mkouba committed Mar 16, 2016
1 parent eb1950e commit 4e12032
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion docs/reference/src/main/asciidoc/environments.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ try (WeldContainer container = weld.initialize()) {
-----------------------------------------------------------------

Furthermore, it is also possible to create several independent Weld instances.
Code snippet below shows how achieve that:
Code snippet below shows how to achieve that:

[source.JAVA, java]
-----------------------------------------------------------------
Expand All @@ -586,6 +586,28 @@ WeldContainer.instance("one").shutdown();
// Shutdown all the containers initialized by the builder instance
weld.shutdown();
-----------------------------------------------------------------
==== Request Context

Weld introduces `@ActivateRequestScope` interceptor binding and
related `ActivateRequestScopeInterceptor` which enables you to
explicitly activate the request scope and use`@RequestScoped` beans in Java SE.
Following example shows how to achieve that:

[source.JAVA, java]
-----------------------------------------------------------------
public class Foo {
@Inject
MyRequestScopedBean bean;
@ActivateRequestScope
public void executeInRequestContext() {
bean.ping()
}
}
-----------------------------------------------------------------


==== Thread Context

Expand Down

0 comments on commit 4e12032

Please sign in to comment.