Skip to content

Instantly share code, notes, and snippets.

@josiahhaswell
Last active July 31, 2019 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josiahhaswell/9ae0acd7322bef7e31b2bba81c8c1216 to your computer and use it in GitHub Desktop.
Save josiahhaswell/9ae0acd7322bef7e31b2bba81c8c1216 to your computer and use it in GitHub Desktop.
public interface PluginManager {
/**
*
* @param filter
* @return the set of plugins for which the filter returns true
*/
List<Plugin> list(Predicate<Plugin> filter);
/** Wait until all pending deployments have been deployed */
void waitForStartup();
/** @return the number of plugins waiting to be deployed */
int pendingDeploymentCount();
/**
* Retrieve the plugin at the given coordinate
*
* @param coordinate
* @return
*/
Plugin lookup(PluginCoordinate coordinate) throws PluginNotFoundException;
/**
* @param event
* @param mode
* @param <T>
*/
<T> void dispatchAll(Event<T> event, Event.Mode mode);
/**
* @param event
* @param mode
* @param targets
* @param <T>
*/
<T> void dispatch(Event<T> event, Event.Mode mode, PluginCoordinate... targets);
/** @return */
List<Plugin> list();
/**
* @param items
* @return
*/
List<Plugin> list(List<PluginCoordinate> items) throws PluginNotFoundException;
/** @return */
Path getPluginDirectory();
/** @return the data directory for sunshower::kernel */
Path getDataDirectory();
/**
* @param coordinate the plugin to retrieve the data directory from
* @return the data directory for the given plugin
*/
Path getDataDirectory(PluginCoordinate coordinate);
/**
* @param coordinate
* @return
*/
Path getPluginDirectory(PluginCoordinate coordinate);
/** Trigger rescan for plugin */
void rescan();
void register(Plugin plugin);
String getNativeId(PluginCoordinate coordinate);
Plugin.State getState(PluginCoordinate coordinate);
void setState(PluginCoordinate coordinate, Plugin.State state);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment