mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Plugins throw exceptions for startup errors
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user