Skip to content

Commit 29b1e30

Browse files
authored
Revert "CDI-626 How should CDI.current() and CDI.getBeanManager() behave for non-CDI apps?"
1 parent ae57657 commit 29b1e30

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

api/src/main/java/javax/enterprise/inject/spi/CDI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public abstract class CDI<T> implements Instance<T> {
4444
* access the container is used.
4545
* </p>
4646
*
47-
* @throws IllegalStateException if no {@link CDIProvider} is available
47+
* @throws IllegalStateException if no CDI provider is available
4848
*
4949
*/
5050
public static CDI<Object> current() {
@@ -55,7 +55,7 @@ public static CDI<Object> current() {
5555
*
5656
* @return the {@link CDIProvider} retrieved by serviceloader or setted by user
5757
*/
58-
private static CDIProvider getCDIProvider() {
58+
public static CDIProvider getCDIProvider() {
5959
if (configuredProvider != null) {
6060
return configuredProvider;
6161
} else {

api/src/main/java/javax/enterprise/inject/spi/CDIProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public interface CDIProvider {
2929
* Provides access to the current container
3030
*
3131
* @return the CDI instance for the current container
32-
* @throws IllegalStateException if no CDI container is available
3332
*/
3433
CDI<Object> getCDI();
3534

spec/src/main/asciidoc/core/spi.asciidoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ public abstract class CDI<T> implements Instance<T> {
235235
}
236236
----
237237

238-
A portable extension or other object may obtain a reference to the current container by calling `CDI.current()`.
239-
`CDI.getBeanManager()` may be called at any time after the container fires the `BeforeBeanDiscovery` container lifecycle event until the container fires the `BeforeShutdown` container lifecycle event.
238+
A portable extension or other object may obtain a reference to the current container by calling `CDI.current()`. `CDI.getBeanManager()` may be called at any time after the container fires the `BeforeBeanDiscovery` container lifecycle event until the container fires the `BeforeShutdown` container lifecycle event.
240239
Other methods on `CDI` may be called after the application initialization is completed until the application shutdown starts.
241240
If methods on `CDI` are called at any other time, non-portable behavior results.
242241

0 commit comments

Comments
 (0)