Browse Source

添加生命周期监听

pull/2/head
Roger.Chen 4 years ago
parent
commit
5921803db6
  1. 5
      plugin.xml
  2. 23
      src/main/java/com/fr/plugin/showtype/NewPreviewInitializeMonitor.java

5
plugin.xml

@ -5,11 +5,11 @@
<active>yes</active>
<version>1.0</version>
<env-version>10.0</env-version>
<jartime>2020-08-24</jartime>
<jartime>2020-08-27</jartime>
<vendor>finereport.mata</vendor>
<description><![CDATA[新预览显示类型]]></description>
<change-notes><![CDATA[
<p>[2020-08-24]新预览显示类型</p>
<p>[2020-08-27]新预览显示类型</p>
]]>
</change-notes>
<extra-core>
@ -19,4 +19,5 @@
<ShowTypeProvider class="com.fr.plugin.showtype.NewPreviewTypeProvider"/>
</extra-decision>
<function-recorder class="com.fr.plugin.showtype.NewPreviewType"/>
<lifecycle-monitor class="com.fr.plugin.showtype.NewPreviewInitializeMonitor"/>
</plugin>

23
src/main/java/com/fr/plugin/showtype/NewPreviewInitializeMonitor.java

@ -0,0 +1,23 @@
package com.fr.plugin.showtype;
import com.fr.decision.web.MainComponent;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor;
import com.fr.web.struct.Registry;
/**
* @Author Roger
* @Date 2020/8/27 8:54
* @Version 10.0
*/
public class NewPreviewInitializeMonitor extends AbstractPluginLifecycleMonitor {
@Override
public void afterRun(PluginContext pluginContext) {
Registry.register(MainComponent.class, NewPreviewComponent.KEY);
}
@Override
public void beforeStop(PluginContext pluginContext) {
Registry.remove(MainComponent.class, NewPreviewComponent.KEY);
}
}
Loading…
Cancel
Save