Browse Source

添加生命周期监听

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