Plugins throw exceptions for startup errors

This commit is contained in:
Torsten Grote
2016-12-14 09:52:47 -02:00
parent 074f5c2faf
commit ffc9fdbb92
11 changed files with 106 additions and 79 deletions

View File

@@ -3,7 +3,6 @@ package org.briarproject.bramble.api.plugin;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import java.io.IOException;
import java.util.Collection;
@NotNullByDefault
@@ -25,14 +24,14 @@ public interface Plugin {
int getMaxIdleTime();
/**
* Starts the plugin and returns true if it started successfully.
* Starts the plugin.
*/
boolean start() throws IOException;
void start() throws PluginException;
/**
* Stops the plugin.
*/
void stop() throws IOException;
void stop() throws PluginException;
/**
* Returns true if the plugin is running.

View File

@@ -0,0 +1,15 @@
package org.briarproject.bramble.api.plugin;
/**
* An exception that indicates an error starting or stopping a {@link Plugin}.
*/
public class PluginException extends Exception {
public PluginException() {
super();
}
public PluginException(Throwable cause) {
super(cause);
}
}