|
|
|
@ -1,10 +1,13 @@
|
|
|
|
|
package com.fanruan.boot.adaptation; |
|
|
|
|
|
|
|
|
|
import com.fanruan.carina.Carina; |
|
|
|
|
import com.fanruan.carina.context.ContextListener; |
|
|
|
|
import com.fanruan.carina.event.CarinaLifecycleEvent; |
|
|
|
|
import com.fanruan.portal.authority.PortalAuthorityItems; |
|
|
|
|
import com.fanruan.portal.module.PortalModule; |
|
|
|
|
import com.fanruan.portal.module.PortalModuleManager; |
|
|
|
|
import com.fr.event.Event; |
|
|
|
|
import com.fr.event.EventDispatcher; |
|
|
|
|
import com.fr.event.Listener; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.third.guava.collect.Sets; |
|
|
|
|
|
|
|
|
@ -94,14 +97,17 @@ public class DesignServerSupportModule {
|
|
|
|
|
* 启动入口,重建一下展示的module |
|
|
|
|
*/ |
|
|
|
|
public static void rebuild() { |
|
|
|
|
Carina.getApplicationContext().addListener(new ContextListener() { |
|
|
|
|
|
|
|
|
|
EventDispatcher.listen(CarinaLifecycleEvent.AFTER_START, new Listener() { |
|
|
|
|
@Override |
|
|
|
|
public void onStart() { |
|
|
|
|
public void on(Event event, Object o) { |
|
|
|
|
FineLoggerFactory.getLogger().info("start unregister module for embed design server"); |
|
|
|
|
PortalModuleManager.allModules().values().stream() |
|
|
|
|
.filter(m -> !StringUtils.equals(m.getParentID(), PortalAuthorityItems.PORTAL_ROOT_ID)) |
|
|
|
|
.map(PortalModule::getId) |
|
|
|
|
.filter(m -> !SUPPORT_MODULE.contains(m)) |
|
|
|
|
.forEach(PortalModuleManager::unregister); |
|
|
|
|
FineLoggerFactory.getLogger().info("unregister module for embed design server done"); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|