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

feat: share ExtensionGetter Bean with plugins for extension retrieval #6365

Merged
Merged
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 @@ -16,13 +16,13 @@ public interface ExtensionGetter {
<T extends ExtensionPoint> Mono<T> getEnabledExtension(Class<T> extensionPoint);

/**
* Get the extension(s) according to the {@link ExtensionPointDefinition} queried
* Get the extension(s) according to the {@code ExtensionPointDefinition} queried
* by incoming extension point class.
*
* @param extensionPoint extension point class
* @return implementations of the corresponding extension point.
* @throws IllegalArgumentException if the incoming extension point class does not have
* the {@link ExtensionPointDefinition}.
* the {@code ExtensionPointDefinition}.
*/
<T extends ExtensionPoint> Flux<T> getEnabledExtensions(Class<T> extensionPoint);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import run.halo.app.infra.ExternalUrlSupplier;
import run.halo.app.notification.NotificationCenter;
import run.halo.app.notification.NotificationReasonEmitter;
import run.halo.app.plugin.extensionpoint.ExtensionGetter;
import run.halo.app.security.LoginHandlerEnhancer;

/**
Expand Down Expand Up @@ -66,6 +67,8 @@ public static ApplicationContext create(ApplicationContext rootContext) {
.ifUnique(pluginsRootGetter ->
beanFactory.registerSingleton("pluginsRootGetter", pluginsRootGetter)
);
beanFactory.registerSingleton("extensionGetter",
rootContext.getBean(ExtensionGetter.class));
// TODO add more shared instance here

sharedContext.refresh();
Expand Down