mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
Pluggable renamed to Plugin and moved to the core package
This commit is contained in:
parent
776e4e2390
commit
277134fb24
@ -5,11 +5,11 @@
|
||||
*/
|
||||
package net.azib.ipscan.config;
|
||||
|
||||
import net.azib.ipscan.core.PluginLoader;
|
||||
import net.azib.ipscan.core.Scanner;
|
||||
import net.azib.ipscan.core.ScannerDispatcherThreadFactory;
|
||||
import net.azib.ipscan.core.ScanningResultList;
|
||||
import net.azib.ipscan.core.net.PingerRegistry;
|
||||
import net.azib.ipscan.core.plugins.PluginLoader;
|
||||
import net.azib.ipscan.exporters.*;
|
||||
import net.azib.ipscan.fetchers.*;
|
||||
import net.azib.ipscan.gui.*;
|
||||
|
||||
@ -4,15 +4,14 @@
|
||||
* Licensed under GPLv2.
|
||||
*/
|
||||
|
||||
package net.azib.ipscan.core.plugins;
|
||||
package net.azib.ipscan.core;
|
||||
|
||||
/**
|
||||
* Pluggable
|
||||
* Base interface for all plugins.
|
||||
*
|
||||
* @author Anton Keks
|
||||
*/
|
||||
public interface Pluggable {
|
||||
|
||||
public interface Plugin {
|
||||
/**
|
||||
* @return unique ID of the pluggable, representing it
|
||||
*/
|
||||
@ -1,4 +1,4 @@
|
||||
package net.azib.ipscan.core.plugins;
|
||||
package net.azib.ipscan.core;
|
||||
|
||||
import net.azib.ipscan.config.LoggerFactory;
|
||||
import org.picocontainer.MutablePicoContainer;
|
||||
@ -22,7 +22,7 @@ import java.util.logging.Logger;
|
||||
* These jar files must have their classes listed in <code>META-INF/MANIFEST.MF</code> as <code>IPScan-Plugins</code>.
|
||||
* </li>
|
||||
* </ul>
|
||||
* In either way, all plugins must implement {@link Pluggable} and one or more of the concrete interfaces.
|
||||
* In either way, all plugins must implement {@link net.azib.ipscan.core.Plugin} and one or more of the concrete interfaces.
|
||||
*/
|
||||
public class PluginLoader {
|
||||
static final Logger LOG = LoggerFactory.getLogger();
|
||||
@ -44,10 +44,10 @@ public class PluginLoader {
|
||||
for (String className : classes) {
|
||||
try {
|
||||
Class clazz = Class.forName(className, true, classLoader);
|
||||
if (Pluggable.class.isAssignableFrom(clazz))
|
||||
if (Plugin.class.isAssignableFrom(clazz))
|
||||
container.registerComponentImplementation(clazz);
|
||||
else
|
||||
LOG.warning("Plugin class " + clazz.getName() + " is not assignable to " + Pluggable.class.getName());
|
||||
LOG.warning("Plugin class " + clazz.getName() + " is not assignable to " + Plugin.class.getName());
|
||||
}
|
||||
catch (ClassNotFoundException e) {
|
||||
LOG.warning("Unable to load plugin: " + className);
|
||||
@ -5,12 +5,12 @@
|
||||
*/
|
||||
package net.azib.ipscan.exporters;
|
||||
|
||||
import net.azib.ipscan.core.Plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import net.azib.ipscan.core.plugins.Pluggable;
|
||||
|
||||
/**
|
||||
* An Exporter is a class, which is able to export scanning results into a
|
||||
* specific output format.
|
||||
@ -25,7 +25,7 @@ import net.azib.ipscan.core.plugins.Pluggable;
|
||||
*
|
||||
* @author Anton Keks
|
||||
*/
|
||||
public interface Exporter extends Cloneable, Pluggable {
|
||||
public interface Exporter extends Cloneable, Plugin {
|
||||
|
||||
/**
|
||||
* @return the filename extension of the file type this Exporter produces (like txt, html, etc)
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
*/
|
||||
package net.azib.ipscan.feeders;
|
||||
|
||||
import net.azib.ipscan.core.Plugin;
|
||||
import net.azib.ipscan.core.ScanningSubject;
|
||||
import net.azib.ipscan.core.plugins.Pluggable;
|
||||
|
||||
/**
|
||||
* Interface of a Feeder, which is used to feed scanner with IP addresses.
|
||||
@ -22,7 +22,7 @@ import net.azib.ipscan.core.plugins.Pluggable;
|
||||
*
|
||||
* @author Anton Keks
|
||||
*/
|
||||
public interface Feeder extends Pluggable {
|
||||
public interface Feeder extends Plugin {
|
||||
|
||||
/**
|
||||
* @return true in case there are more IPs left for processing
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
*/
|
||||
package net.azib.ipscan.fetchers;
|
||||
|
||||
import net.azib.ipscan.core.Plugin;
|
||||
import net.azib.ipscan.core.ScanningSubject;
|
||||
import net.azib.ipscan.core.plugins.Pluggable;
|
||||
import net.azib.ipscan.core.values.NotAvailable;
|
||||
import net.azib.ipscan.core.values.NotScanned;
|
||||
|
||||
@ -24,7 +24,7 @@ import net.azib.ipscan.core.values.NotScanned;
|
||||
*
|
||||
* @author Anton Keks
|
||||
*/
|
||||
public interface Fetcher extends Cloneable, Pluggable {
|
||||
public interface Fetcher extends Cloneable, Plugin {
|
||||
|
||||
/**
|
||||
* @return full name to be displayed in the result table column.
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package net.azib.ipscan.core.plugins;
|
||||
|
||||
import net.azib.ipscan.core.PluginLoader;
|
||||
import net.azib.ipscan.core.ScanningSubject;
|
||||
import net.azib.ipscan.fetchers.AbstractFetcher;
|
||||
import org.junit.Test;
|
||||
import org.picocontainer.MutablePicoContainer;
|
||||
|
||||
import static org.mockito.Mockito.*;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
public class PluginLoaderTest {
|
||||
@Test
|
||||
|
||||
Loading…
Reference in New Issue
Block a user