You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
39 lines
1.3 KiB
3 years ago
|
package com.fr.plugin.yt;
|
||
|
|
||
|
import com.fr.plugin.beans.YTOutputBean;
|
||
|
import com.fr.plugin.context.PluginContext;
|
||
|
import com.fr.plugin.entitys.YtOutputMyEntity;
|
||
|
import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor;
|
||
|
import com.fr.schedule.feature.ScheduleOutputActionEntityRegister;
|
||
|
import com.fr.schedule.feature.output.OutputActionHandler;
|
||
|
|
||
|
public class MyLifeCycleMonitor extends AbstractPluginLifecycleMonitor {
|
||
|
@Override
|
||
|
public void afterRun(PluginContext pluginContext) {
|
||
|
this.registerOutputHandler();
|
||
|
this.addScheduleTableRelation();
|
||
|
// AuthorityContext.getInstance().dispatchAfterInitEvent(new AfterInitEvent() {
|
||
|
// public void run() {
|
||
|
// YituanPri.getInstance().setAuthorityInited(true);
|
||
|
// }
|
||
|
// });
|
||
|
}
|
||
|
|
||
|
private void registerOutputHandler() {
|
||
|
OutputActionHandler.registerHandler(new MyOutputActionHandler(), YTOutputBean.class.getName());
|
||
|
}
|
||
|
|
||
|
private void addScheduleTableRelation() {
|
||
|
ScheduleOutputActionEntityRegister.getInstance().addClass(YtOutputMyEntity.class);
|
||
|
}
|
||
|
|
||
|
private void removeScheduleTableRelation() {
|
||
|
ScheduleOutputActionEntityRegister.getInstance().removeClass(YtOutputMyEntity.class);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void beforeStop(PluginContext pluginContext) {
|
||
|
this.removeScheduleTableRelation();
|
||
|
}
|
||
|
}
|