com.zusmart.sample.plugin.DemoPlugin Maven / Gradle / Ivy
The newest version!
package com.zusmart.sample.plugin;
import java.lang.annotation.Annotation;
import com.zusmart.basic.toolkit.StringUtils;
import com.zusmart.inject.context.ApplicationContext;
import com.zusmart.inject.plugin.Plugin;
import com.zusmart.inject.plugin.PluginManager;
public class DemoPlugin extends Plugin{
public DemoPlugin(Annotation annotation, PluginManager pluginManager, ApplicationContext applicationContext) {
super(annotation, pluginManager, applicationContext);
}
@Override
protected void doStart() throws Exception {
EnableDemoPlugin plugin = this.getAnnotation();
if(StringUtils.isBlank(plugin.printStart())){
return;
}
System.err.println(plugin.printStart());
}
@Override
protected void doClose() throws Exception {
EnableDemoPlugin plugin = this.getAnnotation();
if(StringUtils.isBlank(plugin.priceClose())){
return;
}
System.err.println(plugin.priceClose());
}
}