Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow registering BCE in CDI SE without discovery #817

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;

import jakarta.enterprise.inject.build.compatible.spi.BuildCompatibleExtension;
import jakarta.enterprise.inject.spi.Extension;

/**
Expand Down Expand Up @@ -190,22 +191,32 @@ private static SeContainerInitializer findSeContainerInitializer() {
public abstract SeContainerInitializer addPackages(boolean scanRecursively, Package... packages);

/**
* Add extensions to the set of extensions.
* Add portable extensions to the set of extensions.
*
* @param extensions extensions to use in the container
* @param extensions portable extensions to use in the container
* @return self
*/
public abstract SeContainerInitializer addExtensions(Extension... extensions);

/**
* Add extensions to the set of extensions.
* Add portable extensions to the set of extensions.
*
* @param extensions extensions class to use in the container
* @param extensions portable extension classes to use in the container
* @return self
*/
@SuppressWarnings("unchecked")
public abstract SeContainerInitializer addExtensions(Class<? extends Extension>... extensions);

/**
* Add build compatible extensions to the set of extensions.
*
* @param extensions build compatible extension classes to use in the container
* @return self
*/
@SuppressWarnings("unchecked")
public abstract SeContainerInitializer addBuildCompatibleExtensions(
Class<? extends BuildCompatibleExtension>... extensions);

/**
* Add interceptor classes to the list of enabled interceptors for the synthetic bean archive.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.lang.annotation.Annotation;
import java.util.Map;

import jakarta.enterprise.inject.build.compatible.spi.BuildCompatibleExtension;
import jakarta.enterprise.inject.se.SeContainer;
import jakarta.enterprise.inject.se.SeContainerInitializer;
import jakarta.enterprise.inject.spi.Extension;
Expand Down Expand Up @@ -64,6 +65,11 @@ public final SeContainerInitializer addExtensions(Class<? extends Extension>...
return null;
}

@Override
public SeContainerInitializer addBuildCompatibleExtensions(Class<? extends BuildCompatibleExtension>... extensions) {
return null;
}

@Override
public SeContainerInitializer enableInterceptors(Class<?>... interceptorClasses) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.lang.annotation.Annotation;
import java.util.Map;

import jakarta.enterprise.inject.build.compatible.spi.BuildCompatibleExtension;
import jakarta.enterprise.inject.se.SeContainer;
import jakarta.enterprise.inject.se.SeContainerInitializer;
import jakarta.enterprise.inject.spi.Extension;
Expand Down Expand Up @@ -64,6 +65,11 @@ public final SeContainerInitializer addExtensions(Class<? extends Extension>...
return null;
}

@Override
public SeContainerInitializer addBuildCompatibleExtensions(Class<? extends BuildCompatibleExtension>... extensions) {
return null;
}

@Override
public SeContainerInitializer enableInterceptors(Class<?>... interceptorClasses) {
return null;
Expand Down
4 changes: 3 additions & 1 deletion spec/src/main/asciidoc/javase/bootstrap_se.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public abstract class SeContainerInitializer {
public SeContainerInitializer addPackages(boolean scanRecursively, Package... packages);
public SeContainerInitializer addExtensions(Extension... extensions);
public SeContainerInitializer addExtensions(Class<? extends Extension>... extensions);
public SeContainerInitializer addBuildCompatibleExtensions(Class<? extends BuildCompatibleExtension>... extensions);
public SeContainerInitializer enableInterceptors(Class<?>... interceptorClasses);
public SeContainerInitializer enableDecorators(Class<?>... decoratorClasses);
public SeContainerInitializer selectAlternatives(Class<?>... alternativeClasses);
Expand All @@ -65,7 +66,8 @@ Each call returns a new instance of `SeContainerInitializer`. This method throws
* `addBeanClasses()` adds classes to the the synthetic bean archive
* `addPackages()` adds packages content to the synthetic bean archive.
There are other versions of this method, which enables user to add a package according to class or classes it contains and also to add packages recursively.
* `addExtensions()` adds the provided extensions (class or instance) to the synthetic bean archive.
* `addExtensions()` adds the provided portable extensions (class or instance) to the synthetic bean archive.
* `addBuildCompatibleExtensions()` adds the provided build compatible extensions (classes) to the synthetic bean archive.
* `enableInterceptors()` adds interceptor classes to the list of enabled interceptors for the synthetic bean archive.
* `enableDecorators()` adds decorator classes to the list of enabled decorators for the synthetic bean archive.
* `selectAlternatives()` adds alternatives classes to the list of selected alternatives for the synthetic bean archive.
Expand Down