Removed PluginDeclaration class according to the new APis version
This commit is contained in:
parent
f245458aad
commit
26bb859e9e
|
@ -0,0 +1,4 @@
|
|||
groupId=${groupId}
|
||||
artifactId=${artifactId}
|
||||
version=${version}
|
||||
description=${description}
|
|
@ -1,2 +1,3 @@
|
|||
/org.eclipse.jdt.core.prefs
|
||||
/org.eclipse.core.resources.prefs
|
||||
/org.eclipse.m2e.core.prefs
|
||||
|
|
12
pom.xml
12
pom.xml
|
@ -45,6 +45,18 @@
|
|||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<!-- Test Dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
public class HelloWorldPlugin extends Plugin<HelloWorldPluginDeclaration> {
|
||||
public class HelloWorldPlugin extends Plugin {
|
||||
|
||||
/**
|
||||
* Logger
|
||||
|
@ -20,9 +20,9 @@ public class HelloWorldPlugin extends Plugin<HelloWorldPluginDeclaration> {
|
|||
|
||||
public static final String SLEEP_TIME = "sleepTime";
|
||||
|
||||
public HelloWorldPlugin(HelloWorldPluginDeclaration pluginDeclaration) {
|
||||
super(pluginDeclaration);
|
||||
logger.debug("contructor");
|
||||
public HelloWorldPlugin() {
|
||||
super();
|
||||
logger.debug("{} contructor", this.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
/**{@inheritDoc}*/
|
||||
|
@ -66,5 +66,10 @@ public class HelloWorldPlugin extends Plugin<HelloWorldPluginDeclaration> {
|
|||
logger.debug("onStop()");
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
|
||||
public Map<String,String> getSupportedCapabilities() {
|
||||
logger.debug("getSupportedCapabilities() {}", HelloWorldPlugin.class.getSimpleName());
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.vremanagement.helloworld;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.gcube.vremanagement.executor.plugin.Plugin;
|
||||
import org.gcube.vremanagement.executor.plugin.PluginDeclaration;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
public class HelloWorldPluginDeclaration implements PluginDeclaration {
|
||||
/**
|
||||
* Logger
|
||||
*/
|
||||
private static Logger logger = LoggerFactory.getLogger(HelloWorldPlugin.class);
|
||||
|
||||
/**
|
||||
* Plugin name used by the Executor to retrieve this class
|
||||
*/
|
||||
public static final String NAME = "HelloWorld";
|
||||
|
||||
public static final String DESCRIPTION = "Hello World Smart Executor Plugin";
|
||||
|
||||
public static final String VERSION = "1.0.0";
|
||||
|
||||
/**{@inheritDoc}*/
|
||||
@Override
|
||||
public void init() {
|
||||
logger.debug(String.format("%s initialized", HelloWorldPlugin.class.getSimpleName()));
|
||||
}
|
||||
|
||||
/**{@inheritDoc}*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
/**{@inheritDoc}*/
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return DESCRIPTION;
|
||||
}
|
||||
|
||||
/**{@inheritDoc}*/
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
/**{@inheritDoc}*/
|
||||
@Override
|
||||
public Map<String, String> getSupportedCapabilities() {
|
||||
Map<String, String> discoveredCapabilities = new HashMap<String, String>();
|
||||
discoveredCapabilities.put("HelloKey", "HelloValue");
|
||||
return discoveredCapabilities;
|
||||
}
|
||||
|
||||
/**{@inheritDoc}*/
|
||||
@Override
|
||||
public Class<? extends Plugin<? extends PluginDeclaration>> getPluginImplementation() {
|
||||
return HelloWorldPlugin.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return String.format("{"
|
||||
+ "name:%s,"
|
||||
+ "version:%s,"
|
||||
+ "description:%s,"
|
||||
+ "pluginImplementation:%s,"
|
||||
+ "}",
|
||||
getName(),
|
||||
getVersion(),
|
||||
getDescription(),
|
||||
getPluginImplementation().getClass().getSimpleName());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue