|
|
@ -15,15 +15,18 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package org.pf4j.demo; |
|
|
|
package org.pf4j.demo; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.Constructor; |
|
|
|
import org.pf4j.DefaultPluginFactory; |
|
|
|
import org.pf4j.DefaultPluginFactory; |
|
|
|
import org.pf4j.Plugin; |
|
|
|
import org.pf4j.Plugin; |
|
|
|
import org.pf4j.PluginWrapper; |
|
|
|
import org.pf4j.PluginWrapper; |
|
|
|
import org.pf4j.demo.api.PluginContext; |
|
|
|
import org.pf4j.demo.api.PluginContext; |
|
|
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
import java.lang.reflect.Constructor; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
|
|
|
|
|
|
class DemoPluginFactory extends DefaultPluginFactory { |
|
|
|
class DemoPluginFactory extends DefaultPluginFactory { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(DemoPluginFactory.class); |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected Plugin createInstance(Class<?> pluginClass, PluginWrapper pluginWrapper) { |
|
|
|
protected Plugin createInstance(Class<?> pluginClass, PluginWrapper pluginWrapper) { |
|
|
|
PluginContext context = new PluginContext(pluginWrapper.getRuntimeMode()); |
|
|
|
PluginContext context = new PluginContext(pluginWrapper.getRuntimeMode()); |
|
|
|